5👍
✅
Try:
class ApplicationTable(ItemTable):
class Meta:
model = Application
fields = ItemTable.Meta.fields + ('jira_bucket_name',)
You’ll have the same problems extending Meta
in a table, as you will in a normal Django model.
4👍
You didnt add ,
(comma) to one-element tuple. Try to change this line Meta.attrs['fields'] += ('jira_bucket_name')
in ApplicationTable
to:
Meta.attrs['fields'] += ('jira_bucket_name',)
if it didnt help try to create Meta class outsite model class definition:
class ItemTableMeta:
model = Item
attrs = {"class":"paleblue"}
fields = ('name', 'primary_tech', 'primary_biz', 'backup_tech', 'backup_biz')
class ApplicationTableMeta(ItemTableMeta):
model = Application
fields = ItemTableMeta.fields + ('jira_bucket_name',)
class ItemTable(tables.Table):
#...
Meta = ItemTableMeta
class ApplicationTable(ItemTable):
#...
Meta = ApplicationTableMeta
👤ndpu
- [Django]-How come my template tag doesn't work in Django Templates?
- [Django]-Django Rest Framework: PUT/POST fails in case of blank optional fields in nested serializer
- [Django]-How to generate unique 8 length number, for account ID for example (Python,Django)
0👍
You may need to take this up with the django-tables author. This is not a problem with standard Django.
Source:stackexchange.com