<s> from uuid import uuid4 , UUID <EOL> from datetime import datetime <EOL> from sqlalchemy import Column , DateTime , ForeignKey , Text <EOL> from sqlalchemy . orm import relationship <EOL> from changes . config import db <EOL> from changes . db . types . guid import GUID <EOL> class AdminMessage ( db . Model ) : <EOL> """<STR_LIT>""" <EOL> __tablename__ = '<STR_LIT>' <EOL> id = Column ( GUID , primary_key = True , default = uuid4 ) <EOL> user_id = Column ( GUID , ForeignKey ( '<STR_LIT>' , ondelete = "<STR_LIT>" ) , nullable = False ) <EOL> message = Column ( Text ) <EOL> date_created = Column ( DateTime , default = datetime . utcnow ) <EOL> user = relationship ( '<STR_LIT>' , foreign_keys = [ user_id ] , innerjoin = False ) <EOL> def __init__ ( self , ** kwargs ) : <EOL> super ( AdminMessage , self ) . __init__ ( ** kwargs ) <EOL> if self . id is None : <EOL> self . id = UUID ( '<STR_LIT>' ) <EOL> if self . date_created is None : <EOL> self . date_created = datetime . utcnow ( ) </s>
