<s> from flask . ext . sqlalchemy import SQLAlchemy <EOL> import time <EOL> import random <EOL> db = SQLAlchemy ( ) <EOL> def new_cat_name ( prefix = "<STR_LIT>" ) : <EOL> """<STR_LIT>""" <EOL> return "<STR_LIT>" % ( prefix , random . randint ( <NUM_LIT:0> , <NUM_LIT> ) ) <EOL> class BaseModel ( db . Model ) : <EOL> __abstract__ = True <EOL> __table_args__ = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:utf8>' <EOL> } <EOL> class Cat ( BaseModel ) : <EOL> """<STR_LIT>""" <EOL> __tablename__ = "<STR_LIT>" <EOL> id = db . Column ( db . Integer , primary_key = True ) <EOL> born_at = db . Column ( db . Integer , nullable = False , default = time . time ) <EOL> name = db . Column ( db . String , <EOL> nullable = False , <EOL> default = new_cat_name , <EOL> unique = True ) </s>
