ulule / django-badgify

A reusable application to create your own badge engine using Django
MIT License
83 stars 15 forks source link

Trouble with custom model #10

Open dima-kov opened 8 years ago

dima-kov commented 8 years ago

Hello! There is such issue here, but I want to tell about the bug, I think.

Next, when adding CustomModel to models.py and set CustomModel path in 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

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?

rudymenendez commented 7 years ago

Has anyone solved this?