mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
fix ValueError in tests
This commit is contained in:
parent
2c1130c9b8
commit
7d93346352
1 changed files with 2 additions and 6 deletions
|
|
@ -7,19 +7,15 @@ class CategoryM2MField(ManyToManyField):
|
||||||
"""A many to many field to a Category model."""
|
"""A many to many field to a Category model."""
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
from .models import Category
|
|
||||||
|
|
||||||
if "to" in kwargs:
|
if "to" in kwargs:
|
||||||
kwargs.pop("to")
|
kwargs.pop("to")
|
||||||
super(CategoryM2MField, self).__init__(to=Category, **kwargs)
|
super(CategoryM2MField, self).__init__(to="categories.Category", **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class CategoryFKField(ForeignKey):
|
class CategoryFKField(ForeignKey):
|
||||||
"""A foreign key to the Category model."""
|
"""A foreign key to the Category model."""
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
from .models import Category
|
|
||||||
|
|
||||||
if "to" in kwargs:
|
if "to" in kwargs:
|
||||||
kwargs.pop("to")
|
kwargs.pop("to")
|
||||||
super(CategoryFKField, self).__init__(to=Category, **kwargs)
|
super(CategoryFKField, self).__init__(to="categories.Category", **kwargs)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue