4 ms·
Zachary, today I was thinking along the same lines and I really really like your proposal! How do you propose object-based views to expand beyond the generic c
by wimfeijen 14y ago
Zachary, today I was thinking along the same lines and I really really like your proposal!
How do you propose object-based views to expand beyond the generic cases in order to handle for example multiple forms, or hiding a field from a form and then adding that (for example request.user) after form validation, before save , or add some additional logic to a detail view?
In my opinion, IDS['slug'] would be neater than ids.SLUG
And now for something completely different:
An other idea of mine which keeps going around in my head is having addable forms, so you can do total_form = profile_form + company_form and easily validate etc. What do you think?
- zacharyvoase 14y agoRegarding handling multiple forms: I don't actually propose handling that. Python is good for writing code, which normally ends up being pretty expressive. The more we try to encapsulate that behavior in frameworks, the worse that code looks, and the more difficult to debug it becomes. I do believe that having a collection of 'form combinators' would be useful.