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 latest version license requirements status

Quick start

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

INSTALLED_APPS = (
    ...
    'modelsdoc',
)
  1. 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'
MODELSDOC_INCLUDE_AUTO_CREATED = True

Python and Django Support

Django.1.5

Django1.6

Django1.7

Django1.8

Django1.9

Django1.10

Django1.11

Python 2.7

PyPy

Python 3.3

Python 3.4

Python 3.5

Python 3.6

License

MIT Licence. See the LICENSE file for specific terms.

History

0.1.7(May 29, 2017)

  • Add Support Django1.11 and Python 3.6

0.1.6(Nov 4, 2016)

  • Add Support Django1.10

0.1.5(May 4, 2016)

  • Add Support Python3.5 and Django1.9

0.1.4(Sep 23, 2015)

  • Fixed bug. When print models, linebreak is ignored.

  • Add ManyToManyField’s info on “listing_models” results.

0.1.3(Jul 19, 2015)

  • Fixed bug. install test code.

  • Add new option “MODELSDOC_INCLUDE_AUTO_CREATED”

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.7.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

django_modelsdoc-0.1.7-py2.py3-none-any.whl (12.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for django-modelsdoc-0.1.7.tar.gz
Algorithm Hash digest
SHA256 ac96eda4d2570f7fc534d7fdafca6835c61ac8c025486879f43fa6d1597ec51b
MD5 3563b467a02f7459cd462bf391449b5a
BLAKE2b-256 3a8b7ac219573881c7e3367df63c9034d342383ab9ebc6ff3c9ac825658e7cb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_modelsdoc-0.1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 19f30275b9b6a8ddd5f99592bf7987938a52988dadfc70b49d642a7dc7a22209
MD5 8ce044942192b9b6d865f61d03a25505
BLAKE2b-256 96e27adc30bdd51d75390bc133d51240aa564fb5fe51df75acd3bb77c62b667e

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