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

Trouble with custom model #10

Open
dima-kov opened this issue Jan 29, 2016 · 1 comment
Open

Trouble with custom model #10

dima-kov opened this issue Jan 29, 2016 · 1 comment

Comments

@dima-kov
Copy link

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

  • Firstly, from docs:
    from badgify.models import base and base.Badge but there is no Badge class in base module. And init is empty. So is it right?

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
Copy link

Has anyone solved this?

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

2 participants