We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Top level API should be ideally similar to form/serializer, but it should be informed by a "second level" API which is purely functional.
I have something like this in my head:
# Read mode a = Adapter() data = a.adapt(initial={'instance': model_instance}) # Write mode a = Adapter() data = a.adapt(initial={'instance': model_instance}, data=request.data) processed_data, errors = a.validate(data) assert not errors output = a.process(processed_data) assert output['instance'] == model_instance
Note that no step needs to use a.blah for any blah except the structure of a.
a.blah
a
The text was updated successfully, but these errors were encountered:
I'm happy to give this a go :)
Sorry, something went wrong.
Looks great! Just one quick question: how would you create a form with initial data which don't come from a model instance, ie. a plain dict ?
a.adapt(initial={'data': {'email': 'you@example.com'}})
Another question is, how do you add a form field ?
Is it possible to also write this without any model instance to see how this would look like ?
Issue mjtamlyn#24: high level tutorial
e6b0f40
No branches or pull requests
Top level API should be ideally similar to form/serializer, but it should be informed by a "second level" API which is purely functional.
I have something like this in my head:
Note that no step needs to use
a.blah
for any blah except the structure ofa
.The text was updated successfully, but these errors were encountered: