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

recast doesn't work when passing a class and not a string #65

Open
souliane opened this issue Jan 18, 2023 · 0 comments
Open

recast doesn't work when passing a class and not a string #65

souliane opened this issue Jan 18, 2023 · 0 comments

Comments

@souliane
Copy link
Contributor

souliane commented Jan 18, 2023

Python 3.10.7
Django==4.1.5
django-typed-models 0.12.0

recast() does not work when passing a class and not a string.

Here, base will be self.__class__ because typed model subclasses also have the _typedmodels_registry attribute.

Later, this will evaluates to False if the target typ is not the same as self.__class__.

PS: the test here works because BigCat is a Feline. It should be change so that the target model is not a subclass of self.__class__.

souliane added a commit to souliane/django-typed-models that referenced this issue Jan 18, 2023
Reverse the MRO list so that we really get the base typed model,
and not the closest subclass.
craigds added a commit that referenced this issue Mar 14, 2023
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

1 participant