django-tables2 icon indicating copy to clipboard operation
django-tables2 copied to clipboard

Introduce a Cell object

Open miracle2k opened this issue 13 years ago • 1 comments

See the discussion here:

http://github.com/isolationism/django-tables/commit/179fc7a4d04578fc93849a5d7755a7d97e7351db

miracle2k avatar Oct 13 '10 17:10 miracle2k

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:

  1. Documentation

  2. Tests for the new functionality, where necessary.

  3. 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.

  4. 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.

  5. 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.

miracle2k avatar Oct 13 '10 17:10 miracle2k