3

How do I edit the values in the fields in django-tables2?

This is what I have written in my Tables.py file. It displays edLevel as 6 but field isn't editable any more.

TEMPLATE:

<input id="count" maxlength="100" name="count" type="text"/>

Tables.py:

class IngredientsTable(tables.Table):
    edLevel = tables.TemplateColumn(TEMPLATE)

    def render_edLevel(self):
        value = 6
        return (value)

    class Meta:
        model = Ingredients
Bhavesh Odedra
  • 10,990
  • 12
  • 33
  • 58
Amritha Menon
  • 145
  • 1
  • 2
  • 10
  • I ended up solving this by creating a new column type: https://github.com/szeitlin/django-tables2/blob/master/django_tables2/columns/editablecolumn.py – szeitlin Aug 03 '15 at 19:49

0 Answers0