Sortability of a column with a callable "data" option is inconsistent
Bug #282964 reported by
Michael Elsdörfer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
django-tables |
Fix Committed
|
Undecided
|
Michael Elsdörfer |
Bug Description
ModelTables only.
If a column's "data" argument is a callable object, that column will remain sortable as long as it's name still refers to a valid Django ORM field.
If however the column's "data" argument is a string that points to a callable method on the model instance (or related instances), the column will never be sortable, regardless of whether a valid ORM field is still behind it or not.
The behaviour should be the same in both cases, or the difference clearly documented. It seems most sensible to change the latter case to match the former. The relevant code that needs adjusting is in models.
To post a comment you must log in.
See also django-apps discussion:
http:// groups. google. com/group/ django- apps/msg/ 0da3e57249a10cd b?hl=en