Changing the Template container node detection code to use the child_nodelists attrib...
[philo.git] / admin / base.py
1 from django.contrib import admin
2 #from django.contrib.contenttypes.models import ContentType
3 from django.contrib.contenttypes import generic
4 #from django import forms
5 #from django.conf import settings
6 #from django.utils.translation import ugettext as _
7 #from django.utils.safestring import mark_safe
8 #from django.utils.html import escape
9 #from django.utils.text import truncate_words
10 from philo.models import *
11 #from philo.admin import widgets
12 #from django.core.exceptions import ValidationError, ObjectDoesNotExist
13 #from validators import TreeParentValidator, TreePositionValidator
14
15
16 COLLAPSE_CLASSES = ('collapse', 'collapse-closed', 'closed',)
17
18
19 class AttributeInline(generic.GenericTabularInline):
20         ct_field = 'entity_content_type'
21         ct_fk_field = 'entity_object_id'
22         model = Attribute
23         extra = 1
24         template = 'admin/philo/edit_inline/tabular_collapse.html'
25         allow_add = True
26
27
28 class RelationshipInline(generic.GenericTabularInline):
29         ct_field = 'entity_content_type'
30         ct_fk_field = 'entity_object_id'
31         model = Relationship
32         extra = 1
33         template = 'admin/philo/edit_inline/tabular_collapse.html'
34         allow_add = True
35
36
37 class EntityAdmin(admin.ModelAdmin):
38         inlines = [AttributeInline, RelationshipInline]
39         save_on_top = True