HTML in Admin.fields 'description'

0 views
Skip to first unread message

Luke Plant

unread,
May 19, 2008, 1:38:16 PM5/19/08
to django-d...@googlegroups.com
The 'description' option in Admin.fields is currently broken with
respect to the documentation, due to autoescape. See:

http://www.djangoproject.com/documentation/model-api/#description

I propose fixing the documentation, not the code, since you can just
use 'mark_safe' if you don't want it to be escaped.

If anyone disagrees, let me know, otherwise I'll fix it and add it to
BackwardsIncompatibleChanges.

Thanks,

Luke

--
"I don't want to achieve immortality through my work. I want to
achieve it by not dying." -- Woody Allen

Luke Plant || http://lukeplant.me.uk/

Ramiro Morales

unread,
May 22, 2008, 2:46:34 PM5/22/08
to django-d...@googlegroups.com
Hi Luke,

On Mon, May 19, 2008 at 2:38 PM, Luke Plant <L.Pla...@cantab.net> wrote:
>
> The 'description' option in Admin.fields is currently broken with
> respect to the documentation, due to autoescape. See:
>
> http://www.djangoproject.com/documentation/model-api/#description
>
> I propose fixing the documentation, not the code, since you can just
> use 'mark_safe' if you don't want it to be escaped.
>
> If anyone disagrees, let me know, otherwise I'll fix it and add it to
> BackwardsIncompatibleChanges.
>

Sorry for not seeing your email message before.

When I saw changeset 7545 I tried searching Trac for some related open ticket
that could be closed.

What I found instead was changeset [1]7078.

Doesn't it make the part about using mark_safe() of your change to
model-api.txt a bit unnecesary or misleading?.

Regards,

--
Ramiro Morales

1. http://code.djangoproject.com/changeset/7078

Luke Plant

unread,
May 22, 2008, 3:28:41 PM5/22/08
to django-d...@googlegroups.com
On Thursday 22 May 2008 19:46:34 Ramiro Morales wrote:
> Hi Luke,

>
> When I saw changeset 7545 I tried searching Trac for some related
> open ticket that could be closed.
>
> What I found instead was changeset [1]7078.
>
> Doesn't it make the part about using mark_safe() of your change to
> model-api.txt a bit unnecesary or misleading?.

Hmm, something funny here... I didn't actually check the template
code, but was simply noticing that my HTML was being escaped. But
why...?

...ah, because I'm using a custom override for one of my admin
templates, which hadn't merged in changeset 7078! My bad.

Thanks for catching this. I'll revert my change to the docs.

Cheers,

Luke

--
There was a young man from Peru
Whose limericks stopped at line two.

Luke Plant || http://lukeplant.me.uk/

Reply all
Reply to author
Forward
0 new messages