Getting Started
Django-InLaws is a pluggable app that requires very little to get it working in your project.
Add “inlaws” to your INSTALLED_APPS setting in your project’s settings.py file.
Create an “admin” directory in your project’s template directory.
MyProject
+- templates
+- admin
Create a file called change_form.html.
MyProject
+- templates
+- admin
`- change_form.html
The contents of the file should be:
{% extends "inlaws/change_form.html" %}
What items are shown
Several criteria must be met:
- The model has a ForeignKey, ManyToManyField, or OneToOneField field in its model. For example django.contrib.comments.models.Comment has a ForeignKey related to User. Therefore Comment entries will be displayed on the appropriate User‘s admin change form.
- The model has a registered ModelAdmin class. For example, django.contrib.admin.models.LogEntry has a ForeignKey relating to User, but does not have a ModelAdmin registered. Therefore you will not see any LogEntry items on any User change form.
- The model is not in the ADMIN_RELATED_EXCLUDES setting. This setting allows you to specifically exclude models from appearing, even in the first two criteria are met. ADMIN_RELATED_EXCLUDES is simply a list or tuple of strings in 'appname.model' format.