Thanks for the help. I created the custom widget. It works OK but I
cannot figure out how to get my custom class (for css) to render .
Please check this out when you get a chance.
class NakedLabelWidget(forms.Widget):
  """
  A widget that produces a naked label
  """
  def __init__(self, attrs=None):
    ""
    super(NakedLabelWidget, self).__init__(attrs)

  def render(self, name, value, attrs=None):
     return '' #super(NakedLabelWidget, self).render( attrs)

class NakedLabelField(forms.NullBooleanField):
    widget = NakedLabelWidget(attrs={'class':'special'})


On May 11, 9:15 pm, George Song <geo...@damacy.net> wrote:
> On 5/11/2009 12:29 PM,Nash-twrote:
>
> > I apologize if this is a dumb newbie question...
> > I am trying to create a newform label that doesn't have an associated
> > input field. This label is used as a title for a set of  input fields.
> > I don't want to use django templates because of the way the form/data
> > is passed around and saved on the server side.
> > Any advice?
>
> I'm not sure I understand entirely what you're doing. In any case, you
> have a few options:
>
> 1. If this is one specific form, you can just override it's rendering
> method, or write your own rendering method for that form which takes
> care of generating the correct label at the right place.
>
> 2. Write a custom widget, since widgets are responsible for rendering
> fields out to the form.
>
> --
> George
--~--~---------~--~----~------------~-------~--~----~
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