jazzband / django-mongonaut

Built from scratch to replicate some of the Django admin functionality and add some more, to serve as an introspective interface for Django and Mongo.
MIT License
240 stars 67 forks source link

DictField doesn't work #95

Open Jesuszilla opened 7 years ago

Jesuszilla commented 7 years ago

ValidationError at /mongonaut/lawn/CharacterInfo/583a5fcdf971d92c77b5989a/edit/

ValidationError (CharacterInfo:583a5fcdf971d92c77b5989a) (Only dictionaries may be used in a DictField: ['groove'])

This happens with the following models:

`class LocalizedCharField(EmbeddedDocument): EN = StringField(max_length=128,required=True) JP = StringField(max_length=128)

class LocalizedStringField(EmbeddedDocument): EN = StringField() JP = StringField()

class CharacterInfo(Document): charName = StringField(max_length=128, required=True) displayName = EmbeddedDocumentField(LocalizedCharField) nationality = EmbeddedDocumentField(LocalizedCharField) game = EmbeddedDocumentField(LocalizedCharField) system = EmbeddedDocumentField(LocalizedCharField) voice = EmbeddedDocumentField(LocalizedCharField) graphic = EmbeddedDocumentField(LocalizedCharField) introduction = EmbeddedDocumentField(LocalizedStringField) defaultPalIndices = StringField(max_length=128) groove = DictField()

def __unicode__(self):
    return self.charName

class Meta(object):
    verbose_name = "Character"
    verbose_name_plural = "Characters"

`

And it doesn't matter if I use the string {"groove": { "movement": 1, "justdefend": 1, "parry": 1, "scancel": 1, "counter_attack": 1, "counter_movement": 1, "small_jump": 1, "safe_fall": 1, "air_guard": 1, "evasive": 1, "gauge": 1 }}

or

"groove": { "movement": 1, "justdefend": 1, "parry": 1, "scancel": 1, "counter_attack": 1, "counter_movement": 1, "small_jump": 1, "safe_fall": 1, "air_guard": 1, "evasive": 1, "gauge": 1 }

or even

{ "movement": 1, "justdefend": 1, "parry": 1, "scancel": 1, "counter_attack": 1, "counter_movement": 1, "small_jump": 1, "safe_fall": 1, "air_guard": 1, "evasive": 1, "gauge": 1 }