def created_at(self): """ Creation timestamp """ column = Column( DateTime(timezone=True), server_default=func.now() ) # pylint: disable=protected-access column._creation_order = 9900 return column
def id(self): col_type = Integer col_kwargs = dict(autoincrement=True) info = dict( generated=True, ordering=0, exposed_name='id', type='Integer', nullable=False, unique=True, ) col_args = getattr(self, '__id_args__', tuple()) col_kwargs.update(getattr(self, '__id_kwargs__', dict())) id = Column(col_type, *col_args, primary_key=True, info=info, **col_kwargs) id._creation_order = -1 return id
def OColumn(*args, _order, **kwargs): '''manually-ordered column''' col = Column(*args, **kwargs) col._creation_order = _order return col
def id(cls): column = Column(INTEGER, primary_key=True) column._creation_order = 0 return column