Created
October 5, 2014 16:21
-
-
Save rkorkosz/e2053be1142fc46de881 to your computer and use it in GitHub Desktop.
Mongoengine models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoengine | |
from mongoengine.django.auth import User | |
mongoengine.connect('todo') | |
class TodoItem(mongoengine.Document): | |
title = mongoengine.StringField(max_length=140) | |
due_date = mongoengine.DateTimeField(blank=True, null=True) | |
completed = mongoengine.BooleanField() | |
completed_date = mongoengine.DateTimeField(blank=True, null=True) | |
created_by = mongoengine.ReferenceField(User, related_name='todo_created_by') | |
note = mongoengine.StringField(blank=True, null=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment