Package: django-model-info
django-model-infoA Django Management Command for displaying details about your project's models.Warning: This project is still very new. Expect to see proper testing and an example app demonstrating the command soon.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:basic details about each model, such as the database table name, the file and line number where the model is located, etc.what fields are availablehow each field is referred to in queries (direct/reverse relations)each field’s classeach field’s representation type in the databasewhat methods are availablemethod signaturesmethod location and line numberetcThis package takes the originallist_model_infocommand I wrote for django-extensions to a whole new level. I attempted to simplify some aspects of configuration, while increasing the overall amount of information provided.The beautiful interface is thanks torichDocumentationThe full documentation will (soon) be athttps://django-model-info.readthedocs.io.QuickstartInstall django-model-info:pip install django-model-infoAdd it to your `INSTALLED_APPS`:INSTALLED_APPS=(...'django_model_info.apps.DjangoModelInfoConfig',...)Run the management command:>>>pythonmanage.pymodel_infoAn example of the resulting output can be seenhere. This example shows the most verbose (level 3)  details for a single model.FeaturesYou can customize the output in a number of ways.VerbosityVerbosity levels adjust the amount of information displayed to the console, and is set with the-vor--verbosityargument.0  - Model names only - Convenient when you just need a list of all your project's models in one place1  - Model names, field names, and non-dunder/common model method names2  - Model names, field names & details, and non-dunder/common model method names & details3  - Model names, field names & details, and all model method names & full detailsNote: The default verbosity indjango-model-infois2From the command-line:>>>pythonmanage.pymodel_info--v0>>>pythonmanage.pymodel_info--verbosity0You can specify a different default verbosity value in your settings file.MODEL_INFO_VERBOSITY=1FilterBy default, all models within your project are processed and displayed. For large projects, this can result in an enormous output. If you want to limit output to a subset of models, you can use the-for--filterargument, providing one or more of the following:Models, in the form ofappname.ModelApps, in the form ofappnameIf Django is unable to find provided entries, a message will be written to the console, and the remaining models will be processed and displayed.From the command-line, here is an example that processes all models in themyappandauthapps, and also theotherapp.SpecificModelmodel:>>>pythonmanage.pymodel_info--fmyappotherapp.SpecificModelauth
>>>pythonmanage.pymodel_info--filtermyappotherapp.SpecificModelauthYou can specify a list of default apps and models to process in your settings file. Using the command-line example names above:MODEL_INFO_FILTER=["myapp","otherapp.SpecificModel","auth"]Exportdjango-model-infocan optionally export the console output to an html or text file. The extension of the provided filename must be.txt,.htm, or.html.>>>pythonmanage.pymodel_info-emyfilename.html
>>>pythonmanage.pymodel_info--exportmyfilename.htmlRunning TestsIn progress.source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackagerichHistory0.2.1 (2021-12-13)Fix incorrct type checking placement.0.2.0 (2021-12-13)Improve argument handling.Improve readme.Update PyPI classifiers.0.1.0 (2021-12-12)First release on PyPI.