Closed phoolish closed 12 years ago
Running django 1.3 and latest pull from django-mongoadmin repo. Am I missing something?
here is my admin.py
from mongoadmin import site, DocumentAdmin, InlineDocumentAdmin from dataportal.models import DataType, Geography, Category class DataTypeInline(InlineDocumentAdmin): document = DataType model = DataType class GeographyInline(InlineDocumentAdmin): document = Geography model = Geography class DataPortalDocumentAdmin(DocumentAdmin): inlines = [DataTypeInline, GeographyInline] site.register(Category, DataPortalDocumentAdmin)
And my models.py
from mongoengine import Document, EmbeddedDocument, EmbeddedDocumentField, StringField, BooleanField, ListField, ReferenceField, IntField, FloatField, ValidationError, queryset_manager, PULL, DENY class DataType(Document): name = StringField(max_length=120, required=True, unique=True) description = StringField() quarter = BooleanField(default=False) datatype = ListField(ReferenceField('self', reverse_delete_rule=PULL)) def __unicode__(self): return self.name class Geography(Document): area = StringField(max_length=120) geography = ListField(StringField(max_length=120)) description = StringField() def __unicode__(self): return self.area class Category(Document): name = StringField(max_length=120, required=True) description = StringField() datatype = ListField(ReferenceField(DataType, reverse_delete_rule=PULL)) geography = ListField(ReferenceField(Geography, reverse_delete_rule=PULL)) def __unicode__(self): return self.name
Duplicates #9
Running django 1.3 and latest pull from django-mongoadmin repo. Am I missing something?
here is my admin.py
And my models.py