newforms print unformatted

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

newforms print unformatted

dougalg@gmail.com

Hi there. When I write forms, I generally prefer to just write them as
so:

<fieldset>
     <legend>A Form</legend>
     <label for="anitem">Item 1:</label> <input type="text"
name="anitem" id="anitem" />
</fieldset>

Unfortunately, there does not appear to be a method for printing out
forms without <p>, <li> or any table tags.

Would it be reasonable to suggest that such a method be implemented?


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

Reply | Threaded
Open this post in threaded view
|

Re: newforms print unformatted

Felix Ingram

On 29/12/06, [hidden email] <[hidden email]> wrote:

>
> Hi there. When I write forms, I generally prefer to just write them as
> so:
>
> <fieldset>
>      <legend>A Form</legend>
>      <label for="anitem">Item 1:</label> <input type="text"
> name="anitem" id="anitem" />
> </fieldset>
>
> Unfortunately, there does not appear to be a method for printing out
> forms without <p>, <li> or any table tags.
>
> Would it be reasonable to suggest that such a method be implemented?

Some people have asked for their own particular output preference to
be supported but I think that the official line is that 'no more will
be added but look how easy it is to do your own'. (I like the idea of
bare output though).

An example:

def bare(self):
        "Returns this form rendered as bare HTML for use in fieldsets."
        return self._html_output(u'%(errors)s%(label)s %(field)s',
u'%s', '', False)

Haven't tested this but you would need to add this method to your form
and call it from the template.

Best of luck,

Felix

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

Reply | Threaded
Open this post in threaded view
|

Re: newforms print unformatted

dougalg@gmail.com

Thanks a lot. I will do that, it works fine great.


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