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

Some issues regarding the docs for app overriding #55

Closed
kkomninos opened this issue Mar 21, 2017 · 4 comments
Closed

Some issues regarding the docs for app overriding #55

kkomninos opened this issue Mar 21, 2017 · 4 comments

Comments

@kkomninos
Copy link
Contributor

Hi! I am trying to override a class in models.py following doc instructions. It finally worked but I would like to provide some points.

In overriding code example at https://django-machina.readthedocs.io/en/stable/customization/recipes/overriding_models.html :

# -*- coding: utf-8 -*-

from __future__ import unicode_literals

from machina.apps.forum_conversation.abstract_models import AbstractTopic

# Custom models should be declared before importing
# django-machina models

class Topic(AbstractTopic):
    icon = models.ImageField(verbose_name="Icon", upload_to="forum/topic_icons")

from machina.apps.forum_conversation.models import *  # noqa

seems to be missing:

from django.db import models

In the whole example doc about overriding app/model, the app to override is reffered as "forum_conversation" but at https://django-machina.readthedocs.io/en/stable/customization/recipes/overriding_models.html the migration command is: $ django-admin makemigrations forum_conversations

Another issue I got:
'ImportError: No module named apps.forum_conversation.registry_config'
when apps directory was inside project directory.

I had to remove "yourproject" from line ] + get_machina_apps(['yourproject.apps.forum_conversation', ]) and move apps one folder up (out of project), or keep apps directory inside project and add project name to registry_config : name = yourproject.apps.forum_conversation

and __init__.py: default_app_config = 'yourproject.apps.forum_conversation.registry_config.ConversationRegistryConfig'

@ellmetha
Copy link
Owner

Hey @kkomninos! Thanks for your observations! Would you mind creating a Pull Request in order to fix these issues? This would be much appreciated. 😃

@kkomninos
Copy link
Contributor Author

Yes I'll try to do it :)

@ellmetha
Copy link
Owner

Fixed in 69b8a99. Thanks! 😉

@kkomninos
Copy link
Contributor Author

Welcome 😉

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