def __init__(self, db, table, id, primary_key='id'): '''Create a Record Object given a vlib.db Object, a table name, and a record Id id column can also be an sql where clause, like 'order_no="TC-100903401"' Meant to be subclassed, as follows: from datarecord import DataRecord class User(DataRecord): def __init__(self, id): DataRecord.__init__(db.getInstance(), 'user', id) u = User(1) print u.name u2 = User("name='Fernandez'") print u2.phone ''' self.db = db self.table = table self.id = id self.primary_key = primary_key DataTable.__init__(self, db, table) self.debug_sql = DEBUG self._loadData()
def __init__ (self, db, tablename, id_field=None): '''Given a db connection, and a table name, that conforms to the Attributes Model load data. ''' DataTable.__init__(self, db, tablename) self.id_field = id_field if id_field \ else plural2singular(tablename) + '_id' self._loadTable() self._setConstants()
def __init__(self, db, tablename, id_field=None): '''Given a db connection, and a table name, that conforms to the Attributes Model load data. ''' DataTable.__init__(self, db, tablename) self.id_field = id_field if id_field \ else plural2singular(tablename) + '_id' self._loadTable() self._setConstants()
def __init__(self, db, table, id): '''Create a Record Object given a vlib.db Object, a table name, and a record Id Meant to be subclassed, as follows: class user(Record): def __init__(self, id): Record.__init__(db.getInstance(), 'user', id) ''' self.db = db self.table = table self.id = id DataTable.__init__(self, db, table) self.debug_sql = DEBUG self._loadData()
def __init__(self, db, table, id, primary_key='id'): '''Create a Record Object given a vlib.db Object, a table name, and a record Id Meant to be subclassed, as follows: from datarecord import DataRecord class user(DataRecord): def __init__(self, id): DataRecord.__init__(db.getInstance(), 'user', id) u = User(1) print u.name ''' self.db = db self.table = table self.id = id self.primary_key = primary_key DataTable.__init__(self, db, table) self.debug_sql = DEBUG self._loadData()
def __init__(self): DataTable.__init__(self, db.getInstance(), 'schools') self.conf = conf.getInstance()
def __init__(self): self.db = db.getInstance() DataTable.__init__(self, self.db, 'page_pics')
def __init__(self): self.db = db.getInstance() DataTable.__init__(self, self.db, 'follows')
def __init__(self): self.db = db.getInstance() self.conf = conf.getInstance() self.activity_notifications = ActivityNotifications() DataTable.__init__(self, db.getInstance(), 'messages')