Git Product home page Git Product logo

Comments (4)

bhch avatar bhch commented on June 4, 2024

Why can't you ignore the key if it has an empty value?

I think I can add a keyword called skip_if_empty which will omit the key from the final data, but I'd like to know some use-cases and reasons for this feature.

from django-jsonform.

alexgmin avatar alexgmin commented on June 4, 2024

It's mostly about not having to store data that isn't needed, and that the admin is not the only source of inputs, so now we would have to replicate the behavior of the library also in other places if we want to keep everything standardized.
The workaround isn't hard (just deleting keys with empty values in an extended model field), so you can close the issue if you don't think it's a good feature.

from django-jsonform.

bhch avatar bhch commented on June 4, 2024

I'll just keep it open for now. I'll think about it.

I'm also looking to implement validation logic soon, so that would make it easier for you to normalize the data before saving.

from django-jsonform.

bhch avatar bhch commented on June 4, 2024

Fixed in v2.10.0. A new argument called pre_save_hook can be used for processing json data before saving.

from django-jsonform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.