8000 Documentation/feature: programatically-defined columns (from M2M objects, or another model) · Issue #989 · jieter/django-tables2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Documentation/feature: programatically-defined columns (from M2M objects, or another model) #989
Open
@evildmp

Description

@evildmp

If it's possible to have programatically-defined columns, that should be documented.

I don't think it is, and so far I haven't been able to achieve it anyway, so I am not sure if it's even possible, but if I have a couple of pointers I'll be happy to write it up in the documentation.

Example use case: A child has a height. But Child.height alone perhaps isn't adequate, because children grow, so we might also have a model for Year, and a through model that allows us to record a Child's height for each Year. In the table we'd therefore want a column for each Year:

Child       1998  1999  2000   
----------------------------        
Eldest       155   162   170
Youngest      53    61    72
Middlest      80    91   103

It's possible to acquire both the Year column headings and data by looping over attributes in the template, but that negates much of the convenience that has been afforded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0