6👍
If you can’t accomplish what you want with just subclassing admin.ModelAdmin
, you can create a directory “admin/auth” in your template directory and put a “change_form.html” in there. In this template you can override blocks that are available e.g. {% block after_related_objects %}
.
Have a look at django/contrib/templates/admin/change_form.html
to see how they do stuff, e.g.:
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="../../../jsi18n/"></script>
{{ media }}
{% endblock %}
appending stuff to the extrahead
block.
2👍
Have a look at
django/contrib/admin/templates/admin/auth/user/
This should contain a couple of templates for modifying the users.
You can override these by copying them to TEMPLATE_DIR/admin/auth
and then changing them.
Also, have a look @ django/contrib/admin/templates/admin/change_form.html
This is the file you’d copy and change (to TEMPLATE_DIR/admin/auth/user/
) to override the change form for that model.
- [Django]-Mongo DB or Couch DB with django for building an app that is similar to top coder?
- [Django]-How to get the length of a TextField in Django?
- [Django]-A pip install doesn't add anything to pipFile or pipFile.lock
- [Django]-How can I know if a email is sent correctly with Django/Python?
- [Django]-Initial form data from model – Django
0👍
I’d override the admin/auth/user/change_form.html template and add a custom template tag to handle whatever queries need to be done to fetch the data you need to display.
- [Django]-Django – Ordered Table
- [Django]-How do I populate a hidden required field in django forms?
- [Django]-Django, dynamic apps support
- [Django]-How can I limit http method to a Django REST api
- [Django]-Keep User and Group in same section in Django admin panel