On Thu, Feb 26, 2009 at 9:56 PM, Jack Orenstein <j...@geophile.com> wrote:
>
> On Feb 26, 2009, at 9:44 PM, Alex Gaynor wrote:
>
> > On Thu, Feb 26, 2009 at 9:42 PM, Jack Orenstein <j...@geophile.com>
> > wrote:
> >
> > Suggestion: Instead of hardwiring formatting into Django, allow
> > attributes to specify formatting. E.g., here is the minimal HTML for
> > radio buttons for selecting gender:
> >
> >     <input type="radio" name="gender" value="m">Male
> >     <input type="radio" name="gender" value="f">Female
> >
> > I might want to generate some HTML before the first input, after the
> > last, and between adjacent inputs. RadioFieldRenderer does this in a
> > hardcoded way. How about providing, through the API, widget
> > attributes such as 'before', 'after', and 'in_between'? These could
> > default to what RadioFieldRendered does, but I could also substitute
> > my own.
>
>
> But that includes the default formatting I'm trying to get rid of.
> E.g., for the radio example:
>
> <ul>
> <li><label for="id_gender_0"><input type="radio" id="id_gender_0"
> value="m" name="gender" /> male</label></li>
> <li><label for="id_gender_1"><input type="radio" id="id_gender_1"
> value="f" name="gender" /> female</label></li>
> </ul>
>
> I want to get rid of the ul and li tags, and just put a <br> between
> the two inputs.
>
> I'm going to try subclassing RadioSelect and overriding render.
>
> Jack
>
> >
>
Yep that's the right technique for now, there's  aticket to make those
widgets that have multiple tags(checkbox and radio input) iterable so you
could iterate over it nicely.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to