Comments (1)
Can you please attach a sample script to explain the current and expected behavior? I am trying out the below where serialize_when_none
when set to True has the field in serialized value. When set to False doesn't have the field in the serialized value.
from schematics.models import Model
from schematics.types import StringType, ListType
class ModelB(Model):
field1 = ListType(StringType(), serialize_when_none=True)
field2 = ListType(StringType(), serialize_when_none=False)
model = ModelB()
print(model.serialize())
python samplelistnone.py
{'field1': None}
from schematics.
Related Issues (20)
- When using multiple inheritance, rogue field errors for any inherited models
- Serializable property is not filled when import data
- ETA for a new release HOT 7
- HashType requires LENGTH HOT 1
- SyntaxWarning with a literal
- Fix simple typo: overriden -> overridden HOT 2
- BaseType's has no attribute 'model_class' HOT 2
- RecursionError when using @serializable HOT 2
- Have you considered the possibility to replace blacklist/whitelist terminology by using better terminology?
- Project is still being maintened HOT 9
- Request for joining the organisation
- I want To Join this organization.
- Question: PolyModelType that selects Model based on field value of parent HOT 1
- Question: Parsing data between JSON schemas HOT 1
- schematics.exceptions.ConversionError: [u'No default or explicit locales were given.'] HOT 1
- Python 3.10 - Schematics finally broke HOT 4
- cannot collect all model errors HOT 1
- the traceback including the line number where the validation error occurred
- Question: How to deal with models referencing each other? HOT 5
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 schematics.