Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with django-simple-history anymore #643

Closed
ArkNieckarz opened this issue Jan 11, 2019 · 5 comments
Closed

Not working with django-simple-history anymore #643

ArkNieckarz opened this issue Jan 11, 2019 · 5 comments

Comments

@ArkNieckarz
Copy link

Get error: ValueError: table data is of type <class 'App.models.HistoricalContactActivity'> but <class 'App.models.ContactActivity'> is specified in Table.Meta.model

Basically set_table in TableQuerysetData (in data.py) checks for self.model != table._meta.model which brakes tables with historical "field" in it.
How to set the class meta model of the history model of a concrete model class?

@jieter
Copy link
Owner

jieter commented Jan 17, 2019

I think this error is causing more Harm than good. Maybe we should consider using a warning instead?

@ArkNieckarz
Copy link
Author

Well maybe gradually, in a defined future version, throw an error but for now a warning with some clear meaning would help.
I have it working now, by not defining a model at all - but then have to define all of my fields. This is then duplicating what the model itself has already defined (in most cases that's fine). So duplicating field definition is not desirable.
But would be nice to figure out a way to use the "base" model and to also look at other _meta(s) if there are present?
This project is great and want to see it grow!

@jieter
Copy link
Owner

jieter commented Jan 21, 2019

@ArkNieckarz I was going to say you should try to put HistoricalContactActivity in the Meta.model attribute, but It's not importable. I still think making this error a warning is the way to go.

@jieter jieter closed this as completed in 9f8ea3f Jan 21, 2019
@jieter
Copy link
Owner

jieter commented Jan 21, 2019

released 2.0.4

@fgiudici95
Copy link

Hi @ArkNieckarz,
I have your same problem.
How can you render a Historical^ object using django-tables2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants