def _init(self, *a, **kw): SQLObject._init(self, *a, **kw) if not self.hash: self._generateHash() if not path.exists(self.getFullpath()): Repo.init(self.getFullpath(), mkdir=True, bare=True) self._initHooks(self.getFullpath()) self.addPrivilege(".*", ".*", "CRUD", self.member) self.addHook("update", "phoenix authorize")
def _init(self, id, increment=False, connection=None, selectResults=None, *args, **kw): """Constructor override to get occurence updates""" SQLObject._init(self, id, connection=None, selectResults=None, *args, **kw) if increment: self.increment()
def createDb(): ret = connectDb() for cls in SQLObject.__subclasses__(): cls.createTable(True) for cls in DataPoint.__subclasses__(): cls.createTable(True) User.deleteMany("1 = 1") User(name="Blue", rfid="01005D0EB9EB", email="") User(name="Red", rfid="01000543581F", email="") return ret
def set(self, **kwargs): kwargs = kwargs.copy() profile = kwargs.pop('profile', None) SQLObject.set(self, **kwargs) if profile is not None: self._set_profile(profile)
def _init(self, *args, **kw): SQLObject._init(self, *args, **kw) if hasattr(self, "keystring"): Key._writeKey(self.id, self.keystring) del self.keystring self.initialized = True