From 3b0b3cdfd970d71168d59108b73c0386d2941968 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 20 Jan 2014 14:58:48 +0100 Subject: [PATCH] p8p --- tiramisu/option.py | 4 ++-- tiramisu/storage/sqlalchemy/option.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tiramisu/option.py b/tiramisu/option.py index b6e01e8..a295737 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -35,7 +35,6 @@ from tiramisu.autolib import carry_out_calculation #FIXME : need storage... from tiramisu.storage.sqlalchemy.option import StorageBase, StorageOptionDescription -from sqlalchemy.ext.declarative import declarative_base, declared_attr name_regexp = re.compile(r'^\d+') forbidden_names = ('iter_all', 'iter_group', 'find', 'find_first', @@ -56,6 +55,8 @@ def valid_name(name): return False #____________________________________________________________ # + + class Base(StorageBase): def __init__(self, name, doc, default=None, default_multi=None, requires=None, multi=False, callback=None, @@ -1281,7 +1282,6 @@ class OptionDescription(BaseOption, StorageOptionDescription): self._cache_consistencies[opt] = tuple(cons) self._readonly = True - # ____________________________________________________________ def impl_set_group_type(self, group_type): """sets a given group object to an OptionDescription diff --git a/tiramisu/storage/sqlalchemy/option.py b/tiramisu/storage/sqlalchemy/option.py index b408daa..9d56607 100644 --- a/tiramisu/storage/sqlalchemy/option.py +++ b/tiramisu/storage/sqlalchemy/option.py @@ -17,8 +17,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # ____________________________________________________________ -from tiramisu.setting import multitypes - +from tiramisu.i18n import _ from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy import create_engine, Column, Integer, String, Boolean, \ @@ -38,6 +37,7 @@ require_table = Table('require', SqlAlchemyBase.metadata, Column('right_id', Integer, ForeignKey('baseoption.id')) ) + class _RequireExpected(SqlAlchemyBase): __tablename__ = 'expected' id = Column(Integer, primary_key=True) @@ -218,12 +218,13 @@ class _Base(SqlAlchemyBase): def _add_callback(self, key, values): self._callback_params.append(_CallbackParam(key, values)) - + def _add_validator(self, key, values): self._validator_params.append(_CallbackParam(key, values)) def _add_consistency(self, func, all_cons_opts): _Consistency(func, all_cons_opts) + # ____________________________________________________________ # information def impl_set_information(self, key, value):