You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classCategoryManager(models.Manager):
""" A manager that adds an "active()" method for all active categories """use_in_migrations=Truedefactive(self):
""" Only categories that are active """returnself.get_queryset().filter(active=True)
and maybe even the same to the CategoryRelationManager.
If you agree with this proposal, I could write a pull request if you wish.
The text was updated successfully, but these errors were encountered:
Hello,
first of all thank your for this django package. I am in the process of replacing my own Category models with this package.
I was trying to write a data migration, but ran into a problem when trying to access the object manager in the Category model
caused following Error message:
I found out that in order to use a custom manager in RunPython data migrations you have to set the
use_in_migrations
attribute toTrue
, as described here: https://docs.djangoproject.com/en/1.11/topics/migrations/#model-managersIn your package it would mean
and maybe even the same to the CategoryRelationManager.
If you agree with this proposal, I could write a pull request if you wish.
The text was updated successfully, but these errors were encountered: