Comments (4)
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.
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.
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.
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)
- Produce helpful error messages when default data doesn't match the schema HOT 12
- UI is inconsistent when reading recursive data HOT 2
- Trouble with Schema: Combining `anyOf` and `additionalProperties` HOT 2
- Wrong code example in allOf docs
- Invalid schema: Key 'type' must be a valid JavaScript Object HOT 2
- Validation doesn't work properly because errorMap is sent to browser as JSON data but on the browser it is never parsed to JSON.
- Error messages (error_map) from multiple validators are not merged
- Typo in docs
- Callable schemas and initial values HOT 4
- widget.data in editor.html template is of no use
- Admin form widget not appearing locally HOT 7
- Support for dark mode HOT 2
- Validation error if choice as object in list HOT 2
- Add support for required properties array
- True and False values pass validation tests for integer/number
- Is there a way to use this widget outside of admin site? HOT 6
- Required fields validation on nested objects HOT 2
- List of items not supported HOT 2
- Union type for items not supported HOT 2
- Add 'hidden' widget HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-jsonform.