Arrumar model Event

parent 249eb7ff
import mongoengine
class User(mongoengine.EmbeddedDocument):
id = mongoengine.StringField(field="id", max_length=255, required=True)
first_name = mongoengine.StringField(field="first_name", max_length=255, required=True)
last_name = mongoengine.StringField(field="last_name", max_length=255, required=True)
email = mongoengine.EmailField(field="email", max_length=255, required=True)
class Event(mongoengine.Document):
name = mongoengine.StringField(max_length=255, required=True)
......@@ -9,4 +17,4 @@ class Event(mongoengine.Document):
ends_on = mongoengine.DateTimeField(required=True)
local = mongoengine.StringField(max_length=255, required=True)
description = mongoengine.StringField(max_length=255, required=True)
owner = mongoengine.ListField(mongoengine.ReferenceField("User"))
owner = mongoengine.EmbeddedDocumentListField(User)
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