Class views in Django
Posted
by Sebastjan Trepca
on Stack Overflow
See other posts from Stack Overflow
or by Sebastjan Trepca
Published on 2008-08-03T15:55:28Z
Indexed on
2010/05/27
14:11 UTC
Read the original article
Hit count: 167
Django view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented approach.
For example, I have a page that displays a user. This page is very similar to page that displays a group, but it's still not so similar to just use another data model. Group also has members etc...
One way would be to point views to class methods and then extend that class. Has anyone tried this approach or has any other idea?
© Stack Overflow or respective owner