docs/list_model_info.rst
:synopsis: Lists out all the fields and methods for models in installed apps.
When working with large projects or when returning to a code base after some time away, it can be challenging to remember all of the fields and methods associated with your models. This command makes it easy to see:
Commandline arguments ^^^^^^^^^^^^^^^^^^^^^ You can configure the output in a number of ways.
::
$ ./manage.py list_model_info --field-class
::
$ ./manage.py list_model_info --db-type
::
$ ./manage.py list_model_info --signature
::
$ ./manage.py list_model_info --all-methods
::
$ ./manage.py list_model_info --model users.User
You can combine arguments. for instance, to list all methods and show the method signatures for the User model within the users app::
$ ./manage.py list_model_info --all --signature --model users.User
Settings Configuration ^^^^^^^^^^^^^^^^^^^^^^
You can specify default values in your settings.py to simplify running this command.
.. tip:: Commandline arguments override the following settings, allowing you to change options on the fly.
To show each field's class::
MODEL_INFO_FIELD_CLASS = True
To show each field's database type representation::
MODEL_INFO_DB_TYPE = True
To show each method's signature::
MODEL_INFO_SIGNATURE = True
To show all model methods, including private methods and django's default methods::
MODEL_INFO_ALL_METHODS = True
To output only information for a single model, specify the app and model using dot notation::
MODEL_INFO_MODEL = 'users.User'