django-tables2
django-tables2 copied to clipboard
Introduce a Cell object
See the discussion here:
http://github.com/isolationism/django-tables/commit/179fc7a4d04578fc93849a5d7755a7d97e7351db
I've created a branch based on Kevin's changes and incorporating some of my own:
http://github.com/miracle2k/django-tables/tree/cellobj
Here's some things that are missing before this can be merged:
-
Documentation
-
Tests for the new functionality, where necessary.
-
Make the test suite work - currently we have 11 failing tests, because the Cell object doesn't behave in all respects like the individual data types obviously. In some cases, it might be possible to make Cell compatible. In many others, we are probably going to have to accept that this is in some cases a backwards-incompatible change. One hack we could try though is dynamically inheriting the Cell object from whatever type the raw data is.
-
I'd like to see if it makes sense to move the data rendering (i.e. the _render methods) to the Cell object itself, rather than passing it the rendered result.
-
and 4) are related I think, because if the Cell object could be officially designated to always contain a string representation (that is, it'd be a container for the rendered result), then it would still be backwards-incompatible, but it would differentiate it's role.