Implement a new property as list type (like extra_argument) into the ListView class
|Reported by:||sylock||Owned by:||Fandekasp|
|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:1 Changed 5 years ago by sylock
- Cc sylock added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Type changed from Uncategorized to New feature
comment:3 Changed 4 years ago by Fandekasp
- Easy pickings set
- Needs documentation set
- Needs tests set
- Owner changed from nobody to Fandekasp
- Triage Stage changed from Unreviewed to Accepted
comment:5 Changed 4 years ago by Fandekasp
- Triage Stage changed from Accepted to Design decision needed