I have a reusable search form and want to display a different form
header based on where/how the search is called from (I get this from
the url). In the search template I'd like to test a variable to
determine which header to display. I need to somehow pass variable
from the view the template - something like this:

    form = SearchForm({'Retired' :'Retired Staff''})

then in the search template check the Retired variable :

<p/>
    {% if Retired %}
        <h3>  Search Retired Staff List.</h3>
    {% endif %}
</p>

The generic search form class is"
class   SearchForm(forms.Form):

    # Create a Search Form - set form header to value passed by
caller

    query = forms.CharField(
            label=u'Search by Employee ID ',
            widget=forms.TextInput(attrs={'size': 32})
            )

The catch here is that the variable is not a field on the form. So how
can Ito pass context info at form creation time? Is this possible?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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