Hi Kyle,

My take would be this: What does the code look like if you don't use FormView but just write a function view? How does that compare to using a CBV? This may be the simpler method you are missing - if you are finding you are fighting with inherited functionality, just don't inherit it.

Luke


On 09/03/2019 03:55, Kye Russell wrote:
Hi,

Sometimes it is appropriate to for a HTML form to use the GET method for submission (usually search / filter forms).

My impression has always been that in order to build a FormView-based view that acts on GET data, you have to override a few methods on your class (which involves understanding how FormView works). Even as someone with a fairly good understanding of these classes, I sometimes have to reference a previously-written example to make sure I've got it right.

I am aware of the existence of django-filter[0] which takes care of this for you, however at times I find it hard to justify adding it to a project just to deal with this.

I have the following questions:

* Is my understanding of the current process correct, or is there an easier way that I've missed?
* Is this documented anywhere? I looked at the Django 'working with forms' documentation[1], and whilst it discusses the different scenarios in which you'd use GET vs POST, it does not seem to discuss implementations in a CBV context.
* Is there enough of a generic use-case where FormView / FormMixin / ProcessFormView could be altered to support this? Or are there subtleties / nuances in each implementation that make a generic solution hard to develop?

Sorry if this is the wrong avenue to discuss this. I am approaching it from the position of wanting to alter Django to better support this use case, but I'm aware that I may have just missed a Blessed method in the docs.

Kye



--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANK-ykkMtxezA9cHN8jQ_czLn6OYtdDn6JYbjNgASyyqHH-aAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/668e083b-d3c1-8a5b-989e-03a0a85d895a%40cantab.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to