properties in option must not be sqlalchemy object
This commit is contained in:
parent
69de44bbb4
commit
d545c6883c
2 changed files with 7 additions and 3 deletions
|
@ -489,12 +489,13 @@ class _Base(SqlAlchemyBase):
|
||||||
|
|
||||||
def impl_getproperties(self):
|
def impl_getproperties(self):
|
||||||
session = self.getsession()
|
session = self.getsession()
|
||||||
return session.query(_PropertyOption).filter_by(option=self.id).all()
|
for prop in session.query(_PropertyOption).filter_by(option=self.id).all():
|
||||||
|
yield prop.name
|
||||||
|
|
||||||
def _set_master_slaves(self, option):
|
def _set_master_slaves(self, option):
|
||||||
session = self.getsession()
|
session = self.getsession()
|
||||||
opt = session.query(_Base).filter_by(id=self.id).first()
|
opt = session.query(_Base).filter_by(id=self.id).first()
|
||||||
opt._master_slaves = option.id
|
opt._master_slaves = option._p_.id
|
||||||
self.commit(session)
|
self.commit(session)
|
||||||
|
|
||||||
def _get_master_slave(self):
|
def _get_master_slave(self):
|
||||||
|
|
|
@ -83,7 +83,10 @@ class Settings(Cache, SqlAlchemyBase):
|
||||||
del(session)
|
del(session)
|
||||||
|
|
||||||
def getproperties(self, path, default_properties):
|
def getproperties(self, path, default_properties):
|
||||||
return self._properties.get(path, set(default_properties))
|
ret = self._properties.get(path)
|
||||||
|
if ret is None:
|
||||||
|
return set(default_properties)
|
||||||
|
return ret
|
||||||
|
|
||||||
def hasproperties(self, path):
|
def hasproperties(self, path):
|
||||||
return path in self._properties
|
return path in self._properties
|
||||||
|
|
Loading…
Reference in a new issue