Skip to main content

Create models definitions document from your Django project.

Project description

Create models definitions document from your django project. This project help the documentation related to Django models.

travis coveralls.io downloads latest version license requirements status

Quick start

1. Add “modelsdoc” to your INSTALLED_APPS setting like this

INSTALLED_APPS = (
    ...
    'modelsdoc',
)

2. Run python manage.py listing_models to listing model definition

Option

–app(-a)

You can pass specify app name. Listing only the specified app.

$ python manage.py listing_models --app polls

–output(-o)

It writes the results to the specified file.

$ python manage.py listing_models --output sample.rst

–format(-f)

You can choice output format. rst (reStructuredText) or md (Markdown). Default format is rst.

$ python manage.py listing_models --format md

Customize Settings

MODELSDOC_APPS

You can specify the apps and change the order.

# output only models of poll
MODELSDOC_APPS = (polls,)

MODELSDOC_DISPLAY_FIELDS

You can specify the field value and change the order.

MODELSDOC_DISPLAY_FIELDS = (
    ('Fullname', 'verbose_name'),
    ('Name', 'name'),
    ('Type', 'db_type'),
    ('PK', 'primary_key'),
    ('Unique', 'unique'),
    ('Index', 'db_index'),
    ('Null/Blank', 'null_blank'),
    ('Comment', 'comment'),
)

MODELSDOC_MODEL_OPTIONS

# TODO more documented

MODELSDOC_MODEL_OPTIONS = (
    'unique_together',
    'index_together',
    'ordering',
    'permissions',
    'get_latest_by',
    'order_with_respect_to',
    'db_tablespace',
    'abstract',
    'swappable',
    'select_on_save',
    'default_permissions',
    'default_related_name'
)

Other settings

# TODO more documented

MODELSDOC_OUTPUT_TEMPLATE = 'modelsdoc/models'
MODELSDOC_OUTPUT_FORMAT = 'rst' # default format
MODELSDOC_MODEL_WRAPPER = 'modelsdoc.wrappers.ModelWrapper'
MODELSDOC_FIELD_WRAPPER = 'modelsdoc.wrappers.FieldWrapper'

Python and Django Support

Django.1.5

Django1.6

Django1.7

Django1.8

Python 2.7

PyPy

Python 3.3

Python 3.4

License

MIT Licence. See the LICENSE file for specific terms.

History

0.1.2(Jun 21, 2015)

  • Bug fixed. Not include output templates.

0.1.0(Jun 21, 2015)

  • First release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-modelsdoc-0.1.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

django_modelsdoc-0.1.2-py2.py3-none-any.whl (16.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-modelsdoc-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django-modelsdoc-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b1889d5bdf6ec226d57e353cbf5325543f54da34a9ef832009a9725744f352df
MD5 5a476c81b4289726c209845ad2d2e552
BLAKE2b-256 420400fc15566aea2310457cc752f0ae504110e582d9484288ca93d6a70b3caf

See more details on using hashes here.

File details

Details for the file django_modelsdoc-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_modelsdoc-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 58465145e903ed4fb44171db3e5af22df03d21dca7c72fb3549d9a597ac8a0d3
MD5 c6e74b49669ec2aa5b8c66aee5f3138c
BLAKE2b-256 65791505012b112b445b6dcb5dcfbacf0bce543177828d448085213361196477

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page