Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DictField doesn't work #95

Open
Jesuszilla opened this issue Dec 10, 2016 · 0 comments
Open

DictField doesn't work #95

Jesuszilla opened this issue Dec 10, 2016 · 0 comments

Comments

@Jesuszilla
Copy link

Jesuszilla commented Dec 10, 2016

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 }

@Jesuszilla Jesuszilla changed the title DictField simply doesn't work DictField doesn't work #bug Dec 11, 2016
@Jesuszilla Jesuszilla changed the title DictField doesn't work #bug DictField doesn't work Dec 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant