Open variable opened 11 years ago
It looks like there is an error in the add_category_fields command. I'll get this fixed right away
@variable Can you check the latest commit to see if it solves your problem?
Thanks for fixing it, but I couldn't wait for the fix and went ahead hardcoded the foreign key to my models. So now your test is as good as my test.
I have read about the lazy connection at the bottom of this link https://django-categories.readthedocs.org/en/latest/getting_started.html#connecting-your-model-with-django-categories
I have also read about the actual steps to make it happen in this link https://django-categories.readthedocs.org/en/latest/registering_models.html#registering-models
So I put this inside my settings.py
django-categories
CATEGORIES_SETTINGS = { 'M2M_REGISTRY': { 'articles.Blog': 'categories', } }
when I run "python manage.py add_category_fields articles" I get this error: ImportError: cannot import name MODEL_REGISTRY
I also tried putting the following into init.py from categories import registration from articles.models import Blog registration.register_m2m(Blog)
But nothing happens.
The bottom of this link https://django-categories.readthedocs.org/en/latest/registering_models.html#registering-a-many-to-many-relationship shows sample code using categories.register_m2m, but categories module doesn't have register_m2m, it's inside registration.py. I doubt the accuracy of the document.