Django newforms RadioSelect issue

3 views
Skip to first unread message

Simon Li

unread,
Jun 30, 2008, 10:31:36 PM6/30/08
to django-d...@googlegroups.com
Hi Guys;

I use Django newforms,I met a problem

UserRole=(['admin','administrator'],['user','Normal User'])
user_role =
forms.CharField(widget=forms.RadioSelect(choices=UserRole),error_messages={'required':u'You
must choose one!'})

the code is rendered to html is:

<ul><li><label><input type="radio" name="user_role" value="admin" /> Administrator</label></li>
<li><label><input type="radio" name="user_role" value="user" /> Normal User</label></li>
</ul>


I do NOT like the <ul><li> etc, I hope it can be rendered to simple format,
<label><input type="radio" name="user_role" value="admin" /> Administrator</label>
<label><input type="radio" name="user_role" value="user" /> Normal User</label>

I want to get ride of the <ul><li>, could you guys help me?


Best Regards
-Simon Li


Collin Grady

unread,
Jun 30, 2008, 10:37:53 PM6/30/08
to django-d...@googlegroups.com
Questions of this nature should go on django-users, not
django-developers - this list is for the development of Django itself,
not usage questions :)

--
Collin Grady

Sentimentality -- that's what we call the sentiment we don't share.
-- Graham Greene

Bulkan Evcimen

unread,
Jun 30, 2008, 10:39:03 PM6/30/08
to Django developers
On Jul 1, 12:31 pm, Simon Li <simonli...@gmail.com> wrote:
> Hi Guys;
>
> I use Django newforms,I met a problem

Hi, this is the wrong list to post your question about *using* Django,
next time post your question to django-users
see; http://www.djangoproject.com/documentation/newforms/#outputting-forms-as-html

Cheers

--
http://bulkan-evcimen.com

Malcolm Tredinnick

unread,
Jun 30, 2008, 10:39:04 PM6/30/08
to django-d...@googlegroups.com

On Tue, 2008-07-01 at 10:31 +0800, Simon Li wrote:
> Hi Guys;
>
> I use Django newforms,I met a problem
[...]

> I want to get ride of the <ul><li>, could you guys help me?

Please post questions like this to the django-users list. This list
(django-developers) is for the development of Django itself, not the use
of Django.

Thanks,
Malcolm


Jeremy Dunck

unread,
Jul 1, 2008, 12:10:50 AM7/1/08
to django-d...@googlegroups.com, django-d...@googlegroups.com
Wow, we're a bit quick on the draw, huh? :)

On Jun 30, 2008, at 21:39, Malcolm Tredinnick <malcolm@pointy-

Reply all
Reply to author
Forward
0 new messages