Hi,

I have added a * to required fields. (Some of my forms do not have any
required fields.) I want to do this:

<html>
  {% if form|has_req_field %}
      * = Required Field
  {% endif %}

  {# put form here #}

</html>

And my filter looks like this:

def has_req_field(value, arg=None):

    for field in value.fields:
        if field.field.required:
            return True

    return False

I get the impression that my template truns the form into a string and
then passes the string into my filter function ('str' object has no
attribute 'field').

Is there any way to get the form intact out of the template and into
python?

Or is there a better way to find out if there is at least one required
field of my form.

Thanks!

/Per
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to