I am using django admin and grappelli and wanted to override the default view for a certain model.
I overrode the grapelli change_form
template:
```
{% extends "grappelli:admin/change_form.html" %}
{% block javascripts %}
{{ block.super }}
<script type="text/javascript">{{Object}}</script>
{% endblock %}
```
I have 2 questions:
Object
nor opts
seem to work. Thanks in advance.
you can override with change_view in admin.py and pass variables through extra_context. e.g:
class GivenModel(models.Model):
def change_view(self, request, object_id, form_url='', extra_context=None):
your_obj = GivenModel.objects.get(id=asset_id.group(1))
extra_context = {'title': your_obj.description}
return super(GivenModel, self).change_view(request, object_id, form_url, extra_context)