Skip to content

Prototype top and second level APIs #24

Description

@mjtamlyn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions