mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
added registry, hacked admin w/ new templates for category editor
This commit is contained in:
commit
c6f269985e
1 changed files with 11 additions and 0 deletions
11
categories/fields.py
Normal file
11
categories/fields.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
from django.db.models import ForeignKey, ManyToManyField
|
||||
from categories.models import Category
|
||||
|
||||
class CategoryM2MField(ManyToManyField):
|
||||
def __init__(self, **kwargs):
|
||||
super(CategoryM2MField, self).__init__(to=Category, **kwargs)
|
||||
|
||||
|
||||
class CategoryFKField(ForeignKey):
|
||||
def __init__(self, **kwargs):
|
||||
super(CategoryFKField, self).__init__(to=Category, **kwargs)
|
||||
Loading…
Reference in a new issue