Tuesday, July 26, 2011

making a search page using generic class views

hello,

I am trying to migrate my function based views to class based ones. I
have a search page with a form (which is represented by MySearchForm
class). The form's action URL is set to the current page (<form
action="." method="post">). When the form is submitted the search
results are shown in the page below the form. in other words I do not
have a "success URL" used by several ready-made views in
django.views.generic namespace, so I think I cannot use them. Does
this mean I need to write my view from scratch? so far I think that I
need to have:

class MySearchView(ListView, ProcessFormView) :
...

Does this look right? If so, where does MySearchForm come in to play?
how do I instantiate it and check for validity?

I am new to this, so I am lost because the documentation is very raw.
Basically my question is how do I implement such a view? would someone
please help?

thanks
konstantin

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate