Assuming its the same images you want to display for a given model, you could create a custom form for that model. See: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#templates-which-may-be-overridden-per-app-or-model
On Dec 14, 3:25 am, "Elmar A." <oxyf...@googlemail.com> wrote: > Hi > > I'd like to add some additional HTML to to a model form in the admin > backend. This HTML does not have any relevant form-functionality, i.e. > it should just be displayed for the user. > > But I need the model instance to create the HTML. Basically, I want to > fetch some images and show them to the user. Theses images should be > located in a folder derived from a property of the model instance. > > Now I'm wondering what's the best way to do it (maybe I'm just > over-engeneering here…): > - adding some dummyfield with a widget rendering to the html I want. A > formfield is not designed to do this > - creating a widget rendering the formelement + my html. But I want to > decide where to place this html > - extending the override the ModelForm's as_p etc. methods: not very dry > - ? > > In all cases I'm not sure how to access the model, too. > Formfields/Widgets do not have access to the model instance itself, > just to their corresponding value, do they? > > So, if I missed something in the docs, just point me there. Any hints > appreciated. > > Thanks in advance > Elmar -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.