On Sep 4, 12:44 pm, Reinout van Rees <rein...@vanrees.org> wrote: > On 04-09-11 21:28, Reinout van Rees wrote: > > > On the other hand, from an object oriented viewpoint, the class based > > views seem to be pretty powerless and non-object-oriented. To me, it > > almost seems like they're artificially "castrated" to make function > > views look good :-) That's probably not the intention, but... > > Ehm, the current classes based views are pretty good, apart from the > view-not-in-context problem that I see. > > That's the one point on which I find those CBV's to be somewhat powerless. > > Upon re-reading it sounded a bit like I think the whole of class based > views is powerless and bad, but that was *totally* not my intention :-) > I love 'em :-)
This is probably an overly simplistic implementation, but would something like this work, more broadly covering Jacob's concerns in the ticket about template authors being able to shoot themselves in the foot? It seems less effective to mark all required methods with alters_data, as this method also wouldn't prevent get(), post(), etc. from being called in subclassed views (which could potentially generate recursive loops). https://github.com/tobiasmcnulty/django/compare/master...ticket-16744 On a side note, I noticed that get_context_data in TemplateView behaves differently than all the others, as it puts kwargs in a 'params' variable instead of copying the kwargs directly into the context. Is this intentional? I'm not super-familiar with class based generic views, but it seemed odd to me. Cheers, Tobias -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.