-
Notifications
You must be signed in to change notification settings - Fork 131
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
Fields order for mongoengine is broken #89
Comments
The |
I've found the problem. When I define fields = ['title', 'slug', 'channel', 'channels', 'summary', 'body', 'published'] It works well. But, if I include the EmbeddedDocumment it faills and raises that error. fields = ['title', 'slug', 'channel', 'channels', 'summary', 'body', 'published',
'comments'] In the above case I included comments in the list field. class Comment(db.EmbeddedDocument, Publishable):
body = db.StringField(verbose_name="Comment", required=True)
author = db.StringField(verbose_name="Name", max_length=255, required=True)
published = db.BooleanField(default=True)
def __unicode__(self):
return "{}-{}...".format(self.author, self.body[:10])
meta = {
'indexes': ['-created_at'],
'ordering': ['-created_at']
}
#And int he Post class
comments = db.ListField(db.EmbeddedDocumentField(Comment)) The problem, I guess is that it is looking for all the defined fields in the embedded document itself. So there is a problem when using EmbeddedDocuments and fields argument. |
@rochacbruno Can you tell me which |
THX ! |
I have this issue too. Searched for the answer, found this post, but no answer. What's the fix? Because I want to order the fields AND include the EmbeddedDocument. |
Hi, it was working a week ago but now is broken.
I defined: https://github.com/rochacbruno/quokka/blob/master/quokka/modules/posts/admin.py#L35
And admin rendered in the model defined order.
The text was updated successfully, but these errors were encountered: