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

Implement resource documentation generator for models #2

Open
bruth opened this issue Sep 11, 2012 · 0 comments
Open

Implement resource documentation generator for models #2

bruth opened this issue Sep 11, 2012 · 0 comments

Comments

@bruth
Copy link
Owner

bruth commented Sep 11, 2012

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant