# Path: authentication/models.py
# class User(AbstractUser):
#     tagline = StringField(max_length=140, required=False)
#     created_at = DateTimeField(default=datetime.utcnow)
#     updated_at = DateTimeField()
# 
# 
#     USERNAME_FIELD = 'email'
#     REQUIRED_FIELDS = ['username']


from datetime import datetime
from mongoengine import Document, ReferenceField, StringField, DateTimeField, CASCADE
from authentication.models import User
# coding=utf-8


class Post(Document):
    author = ReferenceField(User, required=True, reverse_delete_rule=CASCADE)
    content = StringField(max_length=240, required=True)


# Path: authentication/models.py
# class User(AbstractUser):
#     tagline = StringField(max_length=140, required=False)
#     created_at = DateTimeField(default=datetime.utcnow)
#     updated_at = DateTimeField()
# 
# 
#     USERNAME_FIELD = 'email'
#     REQUIRED_FIELDS = ['username']


# Path: posts/models.py
from datetime import datetime
from mongoengine import Document, ReferenceField, StringField, DateTimeField, CASCADE
from authentication.models import User

# coding=utf-8


class Post(Document):
    author = ReferenceField(User, required=True, reverse_delete_rule=CASCADE)
    content = StringField(max_length=240, required=True)


    created_at = DateTimeField(default=datetime.utcnow)