newforms rendering method

0 views
Skip to first unread message

~Kender

unread,
Dec 15, 2006, 8:07:17 PM12/15/06
to Django developers
Couple of things. Firstly, I'd like to see a new rendering method..

Specifically
as_div():
<div><label for="id_subject">Subject:</label><input id="id_subject"
type="text" name="subject" maxlength="100" /></div>

Cause a paragraph isn't always semantically correct, and lists and
tables are ugly w/ screen readers.

I'd also like the ability for the method to take an optional class
argument to set the class attribute of the wrapping elements.

as_div( class="form-row" )
<div class="form-row"><label for="id_subject">Subject:</label><input
id="id_subject" type="text" name="subject" maxlength="100" /></div>

etc.

Please consider these options. If needed I can submit a patch for this.

Thanks,
Chad Simmons

Adrian Holovaty

unread,
Dec 16, 2006, 1:10:22 PM12/16/06
to django-d...@googlegroups.com
On 12/15/06, ~Kender <pol...@gmail.com> wrote:
> Couple of things. Firstly, I'd like to see a new rendering method..
>
> Specifically
> as_div():
> <div><label for="id_subject">Subject:</label><input id="id_subject"
> type="text" name="subject" maxlength="100" /></div>
>
> Cause a paragraph isn't always semantically correct, and lists and
> tables are ugly w/ screen readers.

Hi Chad,

Thanks for this submission, but we've had at least three requests for
other Form rendering methods, and more are inevitable, so I've decided
that we're not adding any other rendering methods for now. It's just
not possible to please everybody.

With that said, obviously you can add your as_div() method to your own
Form subclasses, so you can use it yourself.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com

Reply all
Reply to author
Forward
0 new messages