class Job(sqlobject.SQLObject): job_id = sqlobject.StringCol() vault_name = sqlobject.StringCol(length=20, default=None) action = sqlobject.StringCol(length=20, default="") creation_date = sqlobject.DateCol(default=None) has_completed = sqlobject.BoolCol(default=False) completion_date = sqlobject.DateCol(default=None) status_code = sqlobject.StringCol(length=10, default="") response_text = sqlobject.StringCol()
class Product(sqlobject.SQLObject): _connection = establish_connection() productName = sqlobject.StringCol(length=100) energyPoints = sqlobject.IntCol(default=None) date = sqlobject.DateCol() def __repr__(self): return "date: {} name = {}, energy = {}".format(self.date,\ self.productName, self.energyPoints)
class Source(so.SQLObject): """ Model a datasource of exported or manually created webpage data. """ # Creation date of source. This could be the last day that a source # was used and that could be related to moving away from using a device # or exporting data from a company computer before leaving a job. date_created = so.DateCol(notNull=True) date_created_idx = so.DatabaseIndex(date_created) # The format of the datasource. format_ = so.ForeignKey('Format', notNull=True) # The web browser where the data originated. browser = so.ForeignKey('Browser') # The location where one lived and worked when creating the datasource. location = so.ForeignKey('Location') # True if it was work related, false if it was personal. is_work = so.BoolCol(notNull=True)
class Web_services(sqlobject.SQLObject): endpoint = sqlobject.StringCol(length=250) name = sqlobject.StringCol(length=30) keywords = sqlobject.StringCol() datekeyword = sqlobject.DateCol()
class EventObject(sqlobject.SQLObject): name = sqlobject.StringCol(alternateID=True) date = sqlobject.DateCol(notNull=True) description = sqlobject.StringCol()