Introspection tools for Django
Project description
Django Introspection
Introspection tools for Django
Install
pip install django-introspection
Usage
from introspection.inspector import inspect
# get a list of apps objects:
apps = inspect.apps()
# get a list of apps names:
apps = inspect.app_names()
# get a list of models objects:
models = inspect.models("auth")
# get info about an app:
app_info = inspect.app("auth")
# get info about a model:
model_info = inspect.model("auth", "User")
Management command
Print details about a model or app
# inspect an app
python3 manage.py inspect auth
# or for a model
python3 manage.py inspect auth.User
Output:
========================================================
Fields
========================================================
# Found 14 fields:
profile OneToOneField with related name user
id AutoField
password CharField
last_login DateTimeField
is_superuser BooleanField
username CharField
first_name CharField
last_name CharField
email CharField
is_staff BooleanField
is_active BooleanField
date_joined DateTimeField
groups ManyToManyField with related name user
user_permissions ManyToManyField with related name user
========================================================
Relations
========================================================
# Found 5 external relations :
admin.LogEntry.user from auth.User.id ManyToOneRel
account.EmailAddress.user from auth.User.id ManyToOneRel
socialaccount.SocialAccount.user from auth.User.id ManyToOneRel
reversion.Revision.user from auth.User.id ManyToOneRel
polls.Vote.user from auth.User.id ManyToOneRel
========================================================
Instances
========================================================
# Found 558 instances of User
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-introspection-0.5.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f27bc0ba469f6fed6795cbddbef74e35d8b179bd3ade71bee438ef3891e626de |
|
MD5 | 14cef1e54495bbec0b7dc7a7cdf17506 |
|
BLAKE2b-256 | 5d4d5920fcf8ac9b13b14a3974d6759616c816a7e3d767dbcb23d64b4f10aa51 |
Close
Hashes for django_introspection-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ba772a7c6a2cbad91a019383e19385e6b1d7151872e280b04f10db2bc8bd01f |
|
MD5 | dbb36481bd81dc13111b7162b95e9e8e |
|
BLAKE2b-256 | b3d1906fb06ea45aec017f64c4b46a0e491a3c43775baac323b1bacee30a7550 |