Adicionar EmbeddedDocuments em models

parent b8a931ff
from mongoengine import EmbeddedDocument, fields
from eventos.core.models import Event, User
class Owner(EmbeddedDocument):
id = fields.ReferenceField(User, required=True)
first_name = fields.StringField(max_length=255, required=True)
last_name = fields.StringField(max_length=255, required=True)
email = fields.EmailField(max_length=255, required=True)
class EventSubmission(EmbeddedDocument):
id = fields.ReferenceField(Event, required=True)
name = fields.StringField(max_length=255, required=True)
name_english = fields.StringField(max_length=255, required=True)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment