Open dima-kov opened 8 years ago
Hello! There is such issue here, but I want to tell about the bug, I think.
from badgify.models import base
base.Badge
base
Next, when adding CustomModel to models.py and set CustomModel path in settings.py:
settings.py
from badgify.models.base.badge import Badge as BaseBadge class GuidaBadge(BaseBadge): class Meta(BaseBadge.Meta): abstract = False
and after run manage.py shell (or runserver or makemigartion) Python will run code line by line: so firstly from badgify.models.base.badge import Badge as BaseBadge would be run. But there is Badge = load_class(settings.BADGE_MODEL) https://github.com/ulule/django-badgify/blob/master/badgify/models/__init__.py#L8
from badgify.models.base.badge import Badge as BaseBadge
Badge = load_class(settings.BADGE_MODEL)
in init.py of models. So python will try to load my custom model while custom model is not run by python. So it is impossible to create custom model.
Have you tried to make custom model?
Has anyone solved this?
Hello! There is such issue here, but I want to tell about the bug, I think.
from badgify.models import base
andbase.Badge
but there is no Badge class inbase
module. And init is empty. So is it right?Next, when adding CustomModel to models.py and set CustomModel path in
settings.py
:and after run manage.py shell (or runserver or makemigartion) Python will run code line by line: so firstly
from badgify.models.base.badge import Badge as BaseBadge
would be run. But there isBadge = load_class(settings.BADGE_MODEL)
https://github.com/ulule/django-badgify/blob/master/badgify/models/__init__.py#L8in init.py of models. So python will try to load my custom model while custom model is not run by python. So it is impossible to create custom model.
Have you tried to make custom model?