

def __ddl__(self, column_type):
    'Return a list of Node instances that defines the column.'
    ddl = [self.as_entity(), self.__ddl_column__(column_type)]
    if (not self.null):
        ddl.append(SQL('NOT NULL'))
    if self.primary_key:
        ddl.append(SQL('PRIMARY KEY'))
    if self.sequence:
        ddl.append(SQL(("DEFAULT NEXTVAL('%s')" % self.sequence)))
    if self.constraints:
        ddl.extend(self.constraints)
    return ddl

dataset/ETHPy150Open coleifer/peewee/peewee.py Field.__ddl__/original