Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Implement resource documentation generator for models #2

Open
@bruth

Description

@bruth

The metadata that can be obtained from options passed into serialize can be used to extract various field labels, docstrings, etc. about the resource. A new function serialize_docs (a clever name) could take the same options and a top-level model object that the resource represents.

>>> serialize_docs(User, **data_template)
{ ... }

This of course only works if the data is derived from a model or queryset. As an added bonus, if a model instance (rather than the model class) is passed in, the generated docs could provide an example value.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions