Implement a new property as list type (like extra_argument) into the ListView class
|Reported by:||sylock||Owned by:||Adrien Lemaire|
|Severity:||Normal||Keywords:||extra_context generic views listview|
|Cc:||sylock, lemaire.adrien@…||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||yes|
|Needs tests:||yes||Patch needs improvement:||no|
In the deprecated implementation of generic views (as functions) there was the extra_context list to pass extra arguments to the template.
Since 1.3 and the new implementation of generic views as classes doing the same need the creation of a new customized class which inherits from the ListView class as documented here (in the extra_context chapter): https://docs.djangoproject.com/en/dev/topics/generic-views-migration/#the-context-data-for-object-list-views
It's not pythonic since the new implementation recquire more knowledge of the underlying code, and basicaly, more code to do the same! So it's a regression from my point of view.
It would be really simple to solve it keeping classes implementation by creating a new property as list type. So when instanciate the ListView class we would be able to give the extra variables as arguments.
Really need little modification to the existing code!
Change History (6)
comment:3 Changed 5 years ago by
|Owner:||changed from nobody to Adrien Lemaire|
|Triage Stage:||Unreviewed → Accepted|