django-adapters
django-adapters copied to clipboard
Map existing configuration of (everything) to the 6 steps
@ian-foote
Currently working on this at https://github.com/Ian-Foote/new-serializers-notes.
Where do we want to have metadata like labels and help text? Clearly these are used in the render step, but they're also the sort of thing that might appear in a DRF Metadata
class to be returned by an OPTIONS
request.
They are part of the "rendering" step, but that doesn't mean that they only belong in the renderer. Thinking about the structural object underneath, it looking something like:
{
'fields': [...],
'serialization': [...],
'input': [...],
'deserialization': [...],
'rendering': [...],
}
or something along those lines might make sense. fields
might just be a list of names which everything else refers to. It's entirely possible that the API for declaring things may flatten this stuff together, but we can extract it like the above. Rendering step could optionally include layout information for example if you like that kind of thing.
I think I've covered most of the public Django forms api now. On to DRF!
I've added some notes on Serializer
and its subclasses: https://github.com/Ian-Foote/new-serializers-notes/commit/92c4668ff9a3c7094ba20472ea4e187d925c2488