git.ithinksw.org
/
philo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'entity_raw_id_fields'
[philo.git]
/
admin
/
base.py
diff --git
a/admin/base.py
b/admin/base.py
index
0413dde
..
acba9c3
100644
(file)
--- a/
admin/base.py
+++ b/
admin/base.py
@@
-5,8
+5,9
@@
from django.http import HttpResponse
from django.utils import simplejson as json
from django.utils.html import escape
from philo.models import Tag, Attribute
from django.utils import simplejson as json
from django.utils.html import escape
from philo.models import Tag, Attribute
-from philo.
form
s import AttributeForm, AttributeInlineFormSet
+from philo.
admin.forms.attribute
s import AttributeForm, AttributeInlineFormSet
from philo.admin.widgets import TagFilteredSelectMultiple
from philo.admin.widgets import TagFilteredSelectMultiple
+from mptt.admin import MPTTModelAdmin
COLLAPSE_CLASSES = ('collapse', 'collapse-closed', 'closed',)
COLLAPSE_CLASSES = ('collapse', 'collapse-closed', 'closed',)
@@
-33,6
+34,14
@@
class EntityAdmin(admin.ModelAdmin):
save_on_top = True
save_on_top = True
+class TreeAdmin(MPTTModelAdmin):
+ pass
+
+
+class TreeEntityAdmin(TreeAdmin, EntityAdmin):
+ pass
+
+
class TagAdmin(admin.ModelAdmin):
list_display = ('name', 'slug')
prepopulated_fields = {"slug": ("name",)}
class TagAdmin(admin.ModelAdmin):
list_display = ('name', 'slug')
prepopulated_fields = {"slug": ("name",)}