Skip to main content

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

Django2.0

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.

Authors

  • tell-k

  • wanshot

History

0.1.11(Nov 28, 2019)

  • Add models.yaml template file.

0.1.10(Nov 28, 2019)

  • Add Support YAML format.

0.1.9(Feb 8, 2018)

0.1.8(Dec 3, 2017)

  • Add Support Django2.0

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

Metadata

Release files for django-modelsdoc 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-modelsdoc 0.1.11
File Size Uploaded
django-modelsdoc-0.1.11.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-modelsdoc 0.1.11
File Interpreter ABI Platform
django_modelsdoc-0.1.11-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 29.1 kB

Release files / django-modelsdoc-0.1.11.tar.gz

Download URL django-modelsdoc-0.1.11.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6c290716198a35cab4f4519e55f81b77f76dbdcd49ce2aba4313af2e8fd8e308
BLAKE2b-256 checksum
How to use checksums
2826fc83b092e4b087f32a36ec9bdc7a02f262bfe9868cf04ebed3a49eae58e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3

Release files / django_modelsdoc-0.1.11-py2.py3-none-any.whl

Download URL django_modelsdoc-0.1.11-py2.py3-none-any.whl
Size 12.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
21c5b56bfd480feb59e4d8c4d6dc5b3848a8cbd5877cd50b739d1ae4371f23d7
BLAKE2b-256 checksum
How to use checksums
3a5add0097a8e7cab4cc8382dfcc4ad0642e64dec90a56c3cb9e8fbe77a8b5b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.11 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page