shahjapan
shahjapan

Reputation: 14355

how can we set safe template tag for admin change_form.html

how can we set safe template tag for admin change_form.html, I want to display HTML data instead of TextArea Input for admin form,

I've a django field which is excluded in admin form, that field contains HTML data - which is dynamically generated - u can say reporting data,

I want to display that HTML data with safe templatetag below the other form fields.

Upvotes: 1

Views: 996

Answers (1)

cethegeek
cethegeek

Reputation: 6394

Your question is vague, so it is hard to help you.

If what you are trying to do is display the contents of a field in a read-only manner, Django 1.2 has read-only fields. That will display the contents of the field in text, regardless of the widget that would display for the field if it were not read-only.


Edit: Ah, so you have a field containing HTML and you just want to render its contents at the bottom of the Admin page.

I think the only recourse in this case is to override the django admin template. You will probably have to override change_form.html.

Upvotes: 1

Related Questions