On Mon, 2007-06-25 at 08:22 -0700, AnaReis wrote:
> Hi,
> I was trying to change the way in which the errors are presented in a
> form.
> I tried to put them in:
> <tr><td align="center"><b>{{field.label}}:</b></td><td>{{field}}{% if
> field.field.required %}<span class="highlight">*</span>{%endif%}</
> td>{%if field.errors%}<td><span class="highlight">{{field.errors}}</
> span></td>{%endif%}</tr>
> but I still get them formatted as an <ul> and I would like the errors
> to appear as simple text..I'm beginning to suspect this is a slight design flaw in newforms: the presentation of error messages is hard-coded into the way the ErrorList class (in newforms.utils) is used in the HTML rendering. I can think of a couple of backwards-compatible ways we might be able to change this. I'll bounce some ideas of the developers list. > I tried these instructions in this page: > http://code.djangoproject.com/wiki/TemplatedForm > But I can't seem to make it work.. > I have this error on my models.py: Exception Value: name > 'TemplatedForm' is not defined > I understand that I have to import something, I just don't know how to > import it... You have to import TemplatedForm from whichever file you defined it in. Both TemplatedForm and the new form subclass you are creating are just classes in your Python code. Import them as you would any othre class in Python. Regards, Malcolm -- How many of you believe in telekinesis? Raise my hand... http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

