required=True in newforms Fields does not result in an change in as_p

1 view
Skip to first unread message

anders conbere

unread,
Apr 12, 2007, 2:50:32 PM4/12/07
to django-d...@googlegroups.com
I noticed this today when writing some forms, and whipped up a quick
patch. It could probably use one or two more eyes to look at it. a) so
it doesn't get lost, b) to come up with some better variable names.

The problem is pretty simple, as_p, as_ul and as_table, don't include
an option to pass css classes into their fields. As a result it
impossibly to change the appearance of required fields. My patch
simple adds a new label into the string that defines each row, creates
a css_classes list that stores each of the classes to be added to the
row delineator, and the concatenates them with spaces and dumps them
in.

~ Anders

anders conbere

unread,
Apr 12, 2007, 2:51:07 PM4/12/07
to django-d...@googlegroups.com
ugh.. forgot to include a link to the ticket I made with my patch in it.

http://code.djangoproject.com/ticket/4024

Waylan Limberg

unread,
Apr 12, 2007, 4:58:57 PM4/12/07
to django-d...@googlegroups.com
There's already a ticket on this (3512) with a few patches and
discussion. I would suggest marking your's as a duplicate.

http://code.djangoproject.com/ticket/3512

anders conbere wrote:
> ugh.. forgot to include a link to the ticket I made with my patch in it.
>
> http://code.djangoproject.com/ticket/4024
>
> >
>

--
Waylan Limberg
way...@gmail.com

anders conbere

unread,
Apr 12, 2007, 5:29:46 PM4/12/07
to django-d...@googlegroups.com
terrific, marked as a duplicate (which is horribly counter intuitive in trac)

~ Anders

Reply all
Reply to author
Forward
0 new messages