properties in option must not be sqlalchemy object

This commit is contained in:
Emmanuel Garette 2016-09-30 23:07:46 +02:00
parent 69de44bbb4
commit d545c6883c
2 changed files with 7 additions and 3 deletions

View File

@ -489,12 +489,13 @@ class _Base(SqlAlchemyBase):
def impl_getproperties(self):
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):
session = self.getsession()
opt = session.query(_Base).filter_by(id=self.id).first()
opt._master_slaves = option.id
opt._master_slaves = option._p_.id
self.commit(session)
def _get_master_slave(self):

View File

@ -83,7 +83,10 @@ class Settings(Cache, SqlAlchemyBase):
del(session)
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):
return path in self._properties