ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm...@apache.org
Subject [1/2] incubator-ariatosca git commit: rearnged order
Date Thu, 26 Jan 2017 15:56:20 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-44-Merge-parser-and-storage-models 8a4a4500a -> 0072cd64d


rearnged order


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/8823f39a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/8823f39a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/8823f39a

Branch: refs/heads/ARIA-44-Merge-parser-and-storage-models
Commit: 8823f39a9a17180551ab45f8746244dfe6647a10
Parents: 8a4a450
Author: mxmrlv <mxmrlv@gmail.com>
Authored: Thu Jan 26 16:56:06 2017 +0200
Committer: mxmrlv <mxmrlv@gmail.com>
Committed: Thu Jan 26 16:56:06 2017 +0200

----------------------------------------------------------------------
 aria/orchestrator/workflows/executor/process.py |   4 +-
 aria/storage/__init__.py                        |  10 +-
 aria/storage/base_model.py                      | 743 -------------------
 aria/storage/model_BAK.py                       | 110 ---
 aria/storage/modeling/elements.py               |   7 +-
 aria/storage/modeling/instance_elements.py      |  10 +-
 aria/storage/modeling/model.py                  |   9 +-
 aria/storage/modeling/orchestrator_elements.py  |  13 +-
 aria/storage/modeling/structure.py              | 271 +++++++
 aria/storage/modeling/template_elements.py      |  14 +-
 aria/storage/modeling/type.py                   | 271 +++++++
 aria/storage/structure.py                       | 271 -------
 aria/storage/type.py                            | 271 -------
 tests/storage/test_instrumentation.py           |   3 +-
 tests/storage/test_model_storage.py             |   5 +-
 15 files changed, 583 insertions(+), 1429 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/orchestrator/workflows/executor/process.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/executor/process.py b/aria/orchestrator/workflows/executor/process.py
index 4924635..ea772c8 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -19,8 +19,8 @@ Subprocess based executor
 
 # pylint: disable=wrong-import-position
 
-import sys
 import os
+import sys
 
 # As part of the process executor implementation, subprocess are started with this module as their
 # entry point. We thus remove this module's directory from the python path if it happens to be
@@ -43,7 +43,7 @@ from aria.utils import imports
 from aria.orchestrator.workflows.executor import base
 from aria.orchestrator.context import serialization
 from aria.storage import instrumentation
-from aria.storage import type as storage_type
+from aria.storage.modeling import type as storage_type
 
 _IS_WIN = os.name == 'nt'
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/__init__.py
----------------------------------------------------------------------
diff --git a/aria/storage/__init__.py b/aria/storage/__init__.py
index 4e84cb4..82bdc7e 100644
--- a/aria/storage/__init__.py
+++ b/aria/storage/__init__.py
@@ -42,14 +42,17 @@ from .core import (
     ModelStorage,
     ResourceStorage,
 )
+from .modeling import (
+    structure,
+    model,
+    model_base
+)
 from . import (
     exceptions,
     api,
-    structure,
     core,
     filesystem_rapi,
     sql_mapi,
-    modeling,
 )
 
 __all__ = (
@@ -61,5 +64,6 @@ __all__ = (
     'filesystem_rapi',
     'sql_mapi',
     'api',
-    'modeling'
+    'model',
+    'model_base',
 )

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/base_model.py
----------------------------------------------------------------------
diff --git a/aria/storage/base_model.py b/aria/storage/base_model.py
deleted file mode 100644
index d041a38..0000000
--- a/aria/storage/base_model.py
+++ /dev/null
@@ -1,743 +0,0 @@
-# # Licensed to the Apache Software Foundation (ASF) under one or more
-# # contributor license agreements.  See the NOTICE file distributed with
-# # this work for additional information regarding copyright ownership.
-# # The ASF licenses this file to You under the Apache License, Version 2.0
-# # (the "License"); you may not use this file except in compliance with
-# # the License.  You may obtain a copy of the License at
-# #
-# #     http://www.apache.org/licenses/LICENSE-2.0
-# #
-# # Unless required by applicable law or agreed to in writing, software
-# # distributed under the License is distributed on an "AS IS" BASIS,
-# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# # See the License for the specific language governing permissions and
-# # limitations under the License.
-#
-# """
-# Aria's storage.models module
-# Path: aria.storage.models
-#
-# models module holds aria's models.
-#
-# classes:
-#     * Field - represents a single field.
-#     * IterField - represents an iterable field.
-#     * Model - abstract model implementation.
-#     * Snapshot - snapshots implementation model.
-#     * Deployment - deployment implementation model.
-#     * DeploymentUpdateStep - deployment update step implementation model.
-#     * DeploymentUpdate - deployment update implementation model.
-#     * DeploymentModification - deployment modification implementation model.
-#     * Execution - execution implementation model.
-#     * Node - node implementation model.
-#     * Relationship - relationship implementation model.
-#     * NodeInstance - node instance implementation model.
-#     * RelationshipInstance - relationship instance implementation model.
-#     * Plugin - plugin implementation model.
-# """
-# from collections import namedtuple
-# from datetime import datetime
-#
-# from sqlalchemy.ext.associationproxy import association_proxy
-# from sqlalchemy.ext.declarative import declared_attr
-# from sqlalchemy import (
-#     Column,
-#     Integer,
-#     Text,
-#     DateTime,
-#     Boolean,
-#     Enum,
-#     String,
-#     Float,
-#     orm,
-# )
-# from sqlalchemy.ext.orderinglist import ordering_list
-#
-# from ..orchestrator.exceptions import TaskAbortException, TaskRetryException
-# from .structure import ModelMixin
-# from .type import (
-#     List,
-#     Dict
-# )
-#
-# __all__ = (
-#     'BlueprintBase',
-#     'DeploymentBase',
-#     'DeploymentUpdateStepBase',
-#     'DeploymentUpdateBase',
-#     'DeploymentModificationBase',
-#     'ExecutionBase',
-#     'NodeBase',
-#     'RelationshipBase',
-#     'NodeInstanceBase',
-#     'RelationshipInstanceBase',
-#     'PluginBase',
-#     'TaskBase'
-# )
-#
-# #pylint: disable=no-self-argument, abstract-method
-#
-#
-# class BlueprintBase(ModelMixin):
-#     """
-#     Blueprint model representation.
-#     """
-#     __tablename__ = 'blueprints'
-#
-#     created_at = Column(DateTime, nullable=False, index=True)
-#     main_file_name = Column(Text, nullable=False)
-#     plan = Column(Dict, nullable=False)
-#     updated_at = Column(DateTime)
-#     description = Column(Text)
-#
-#
-# class DeploymentBase(ModelMixin):
-#     """
-#     Deployment model representation.
-#     """
-#     __tablename__ = 'deployments'
-#
-#     _private_fields = ['blueprint_fk']
-#
-#     created_at = Column(DateTime, nullable=False, index=True)
-#     description = Column(Text)
-#     inputs = Column(Dict)
-#     groups = Column(Dict)
-#     permalink = Column(Text)
-#     policy_triggers = Column(Dict)
-#     policy_types = Column(Dict)
-#     outputs = Column(Dict)
-#     scaling_groups = Column(Dict)
-#     updated_at = Column(DateTime)
-#     workflows = Column(Dict)
-#
-#     @declared_attr
-#     def blueprint_fk(cls):
-#         return cls.foreign_key(BlueprintBase, nullable=False)
-#
-#     @declared_attr
-#     def blueprint(cls):
-#         return cls.many_to_one_relationship('blueprint_fk')
-#
-#     @declared_attr
-#     def blueprint_name(cls):
-#         return association_proxy('blueprint', cls.name_column_name())
-#
-#
-# class ExecutionBase(ModelMixin):
-#     """
-#     Execution model representation.
-#     """
-#     # Needed only for pylint. the id will be populated by sqlalcehmy and the proper column.
-#     __tablename__ = 'executions'
-#     _private_fields = ['deployment_fk']
-#
-#     TERMINATED = 'terminated'
-#     FAILED = 'failed'
-#     CANCELLED = 'cancelled'
-#     PENDING = 'pending'
-#     STARTED = 'started'
-#     CANCELLING = 'cancelling'
-#     FORCE_CANCELLING = 'force_cancelling'
-#
-#     STATES = [TERMINATED, FAILED, CANCELLED, PENDING, STARTED, CANCELLING, FORCE_CANCELLING]
-#     END_STATES = [TERMINATED, FAILED, CANCELLED]
-#     ACTIVE_STATES = [state for state in STATES if state not in END_STATES]
-#
-#     VALID_TRANSITIONS = {
-#         PENDING: [STARTED, CANCELLED],
-#         STARTED: END_STATES + [CANCELLING],
-#         CANCELLING: END_STATES + [FORCE_CANCELLING]
-#     }
-#
-#     @orm.validates('status')
-#     def validate_status(self, key, value):
-#         """Validation function that verifies execution status transitions are OK"""
-#         try:
-#             current_status = getattr(self, key)
-#         except AttributeError:
-#             return
-#         valid_transitions = self.VALID_TRANSITIONS.get(current_status, [])
-#         if all([current_status is not None,
-#                 current_status != value,
-#                 value not in valid_transitions]):
-#             raise ValueError('Cannot change execution status from {current} to {new}'.format(
-#                 current=current_status,
-#                 new=value))
-#         return value
-#
-#     created_at = Column(DateTime, index=True)
-#     started_at = Column(DateTime, nullable=True, index=True)
-#     ended_at = Column(DateTime, nullable=True, index=True)
-#     error = Column(Text, nullable=True)
-#     is_system_workflow = Column(Boolean, nullable=False, default=False)
-#     parameters = Column(Dict)
-#     status = Column(Enum(*STATES, name='execution_status'), default=PENDING)
-#     workflow_name = Column(Text)
-#
-#     @declared_attr
-#     def blueprint(cls):
-#         return association_proxy('deployment', 'blueprint')
-#
-#     @declared_attr
-#     def deployment_fk(cls):
-#         return cls.foreign_key(DeploymentBase, nullable=True)
-#
-#     @declared_attr
-#     def deployment(cls):
-#         return cls.many_to_one_relationship('deployment_fk')
-#
-#     @declared_attr
-#     def deployment_name(cls):
-#         return association_proxy('deployment', cls.name_column_name())
-#
-#     @declared_attr
-#     def blueprint_name(cls):
-#         return association_proxy('deployment', 'blueprint_name')
-#
-#     def __str__(self):
-#         return '<{0} id=`{1}` (status={2})>'.format(
-#             self.__class__.__name__,
-#             getattr(self, self.name_column_name()),
-#             self.status
-#         )
-#
-#
-# class DeploymentUpdateBase(ModelMixin):
-#     """
-#     Deployment update model representation.
-#     """
-#     # Needed only for pylint. the id will be populated by sqlalcehmy and the proper column.
-#     steps = None
-#
-#     __tablename__ = 'deployment_updates'
-#
-#     _private_fields = ['execution_fk', 'deployment_fk']
-#
-#     created_at = Column(DateTime, nullable=False, index=True)
-#     deployment_plan = Column(Dict, nullable=False)
-#     deployment_update_node_instances = Column(Dict)
-#     deployment_update_deployment = Column(Dict)
-#     deployment_update_nodes = Column(List)
-#     modified_entity_ids = Column(Dict)
-#     state = Column(Text)
-#
-#     @declared_attr
-#     def execution_fk(cls):
-#         return cls.foreign_key(ExecutionBase, nullable=True)
-#
-#     @declared_attr
-#     def execution(cls):
-#         return cls.many_to_one_relationship('execution_fk')
-#
-#     @declared_attr
-#     def execution_name(cls):
-#         return association_proxy('execution', cls.name_column_name())
-#
-#     @declared_attr
-#     def deployment_fk(cls):
-#         return cls.foreign_key(DeploymentBase)
-#
-#     @declared_attr
-#     def deployment(cls):
-#         return cls.many_to_one_relationship('deployment_fk')
-#
-#     @declared_attr
-#     def deployment_name(cls):
-#         return association_proxy('deployment', cls.name_column_name())
-#
-#     def to_dict(self, suppress_error=False, **kwargs):
-#         dep_update_dict = super(DeploymentUpdateBase, self).to_dict(suppress_error)     #pylint: disable=no-member
-#         # Taking care of the fact the DeploymentSteps are _BaseModels
-#         dep_update_dict['steps'] = [step.to_dict() for step in self.steps]
-#         return dep_update_dict
-#
-#
-# class DeploymentUpdateStepBase(ModelMixin):
-#     """
-#     Deployment update step model representation.
-#     """
-#     # Needed only for pylint. the id will be populated by sqlalcehmy and the proper column.
-#     __tablename__ = 'deployment_update_steps'
-#     _private_fields = ['deployment_update_fk']
-#
-#     _action_types = namedtuple('ACTION_TYPES', 'ADD, REMOVE, MODIFY')
-#     ACTION_TYPES = _action_types(ADD='add', REMOVE='remove', MODIFY='modify')
-#     _entity_types = namedtuple(
-#         'ENTITY_TYPES',
-#         'NODE, RELATIONSHIP, PROPERTY, OPERATION, WORKFLOW, OUTPUT, DESCRIPTION, GROUP, '
-#         'POLICY_TYPE, POLICY_TRIGGER, PLUGIN')
-#     ENTITY_TYPES = _entity_types(
-#         NODE='node',
-#         RELATIONSHIP='relationship',
-#         PROPERTY='property',
-#         OPERATION='operation',
-#         WORKFLOW='workflow',
-#         OUTPUT='output',
-#         DESCRIPTION='description',
-#         GROUP='group',
-#         POLICY_TYPE='policy_type',
-#         POLICY_TRIGGER='policy_trigger',
-#         PLUGIN='plugin'
-#     )
-#
-#     action = Column(Enum(*ACTION_TYPES, name='action_type'), nullable=False)
-#     entity_id = Column(Text, nullable=False)
-#     entity_type = Column(Enum(*ENTITY_TYPES, name='entity_type'), nullable=False)
-#
-#     @declared_attr
-#     def deployment_update_fk(cls):
-#         return cls.foreign_key(DeploymentUpdateBase)
-#
-#     @declared_attr
-#     def deployment_update(cls):
-#         return cls.many_to_one_relationship('deployment_update_fk', backreference='steps')
-#
-#     @declared_attr
-#     def deployment_update_name(cls):
-#         return association_proxy('deployment_update', cls.name_column_name())
-#
-#     def __hash__(self):
-#         return hash((getattr(self, self.id_column_name()), self.entity_id))
-#
-#     def __lt__(self, other):
-#         """
-#         the order is 'remove' < 'modify' < 'add'
-#         :param other:
-#         :return:
-#         """
-#         if not isinstance(other, self.__class__):
-#             return not self >= other
-#
-#         if self.action != other.action:
-#             if self.action == 'remove':
-#                 return_value = True
-#             elif self.action == 'add':
-#                 return_value = False
-#             else:
-#                 return_value = other.action == 'add'
-#             return return_value
-#
-#         if self.action == 'add':
-#             return self.entity_type == 'node' and other.entity_type == 'relationship'
-#         if self.action == 'remove':
-#             return self.entity_type == 'relationship' and other.entity_type == 'node'
-#         return False
-#
-#
-# class DeploymentModificationBase(ModelMixin):
-#     """
-#     Deployment modification model representation.
-#     """
-#     __tablename__ = 'deployment_modifications'
-#     _private_fields = ['deployment_fk']
-#
-#     STARTED = 'started'
-#     FINISHED = 'finished'
-#     ROLLEDBACK = 'rolledback'
-#
-#     STATES = [STARTED, FINISHED, ROLLEDBACK]
-#     END_STATES = [FINISHED, ROLLEDBACK]
-#
-#     context = Column(Dict)
-#     created_at = Column(DateTime, nullable=False, index=True)
-#     ended_at = Column(DateTime, index=True)
-#     modified_nodes = Column(Dict)
-#     node_instances = Column(Dict)
-#     status = Column(Enum(*STATES, name='deployment_modification_status'))
-#
-#     @declared_attr
-#     def deployment_fk(cls):
-#         return cls.foreign_key(DeploymentBase)
-#
-#     @declared_attr
-#     def deployment(cls):
-#         return cls.many_to_one_relationship('deployment_fk', backreference='modifications')
-#
-#     @declared_attr
-#     def deployment_name(cls):
-#         return association_proxy('deployment', cls.name_column_name())
-#
-#
-# class NodeBase(ModelMixin):
-#     """
-#     Node model representation.
-#     """
-#     __tablename__ = 'nodes'
-#
-#     # See base class for an explanation on these properties
-#     is_id_unique = False
-#
-#     _private_fields = ['blueprint_fk', 'host_fk']
-#
-#     @declared_attr
-#     def host_fk(cls):
-#         return cls.foreign_key(NodeBase, nullable=True)
-#
-#     @declared_attr
-#     def host(cls):
-#         return cls.relationship_to_self('host_fk')
-#
-#     @declared_attr
-#     def host_name(cls):
-#         return association_proxy('host', cls.name_column_name())
-#
-#     @declared_attr
-#     def deployment_fk(cls):
-#         return cls.foreign_key(DeploymentBase)
-#
-#     @declared_attr
-#     def deployment(cls):
-#         return cls.many_to_one_relationship('deployment_fk')
-#
-#     @declared_attr
-#     def deployment_name(cls):
-#         return association_proxy('deployment', cls.name_column_name())
-#
-#     @declared_attr
-#     def blueprint_name(cls):
-#         return association_proxy('deployment', 'blueprint_{0}'.format(cls.name_column_name()))
-#
-#     deploy_number_of_instances = Column(Integer, nullable=False)
-#     max_number_of_instances = Column(Integer, nullable=False)
-#     min_number_of_instances = Column(Integer, nullable=False)
-#     number_of_instances = Column(Integer, nullable=False)
-#     planned_number_of_instances = Column(Integer, nullable=False)
-#     plugins = Column(List)
-#     properties = Column(Dict)
-#     operations = Column(Dict)
-#     type = Column(Text, nullable=False, index=True)
-#     type_hierarchy = Column(List)
-#
-#
-# class RelationshipBase(ModelMixin):
-#     """
-#     Relationship model representation.
-#     """
-#     __tablename__ = 'relationships'
-#
-#     _private_fields = ['source_node_fk', 'target_node_fk', 'source_position', 'target_position']
-#
-#     source_position = Column(Integer)
-#     target_position = Column(Integer)
-#
-#     @declared_attr
-#     def deployment_id(self):
-#         return association_proxy('source_node', 'deployment_id')
-#
-#     @declared_attr
-#     def source_node_fk(cls):
-#         return cls.foreign_key(NodeBase)
-#
-#     @declared_attr
-#     def source_node(cls):
-#         return cls.many_to_one_relationship(
-#             'source_node_fk',
-#             backreference='outbound_relationships',
-#             backref_kwargs=dict(
-#                 order_by=cls.source_position,
-#                 collection_class=ordering_list('source_position', count_from=0)
-#             )
-#         )
-#
-#     @declared_attr
-#     def source_name(cls):
-#         return association_proxy('source_node', cls.name_column_name())
-#
-#     @declared_attr
-#     def target_node_fk(cls):
-#         return cls.foreign_key(NodeBase, nullable=True)
-#
-#     @declared_attr
-#     def target_node(cls):
-#         return cls.many_to_one_relationship(
-#             'target_node_fk',
-#             backreference='inbound_relationships',
-#             backref_kwargs=dict(
-#                 order_by=cls.target_position,
-#                 collection_class=ordering_list('target_position', count_from=0)
-#             )
-#         )
-#
-#     @declared_attr
-#     def target_name(cls):
-#         return association_proxy('target_node', cls.name_column_name())
-#
-#     source_interfaces = Column(Dict)
-#     source_operations = Column(Dict, nullable=False)
-#     target_interfaces = Column(Dict)
-#     target_operations = Column(Dict, nullable=False)
-#     type = Column(String, nullable=False)
-#     type_hierarchy = Column(List)
-#     properties = Column(Dict)
-#
-#
-# class NodeInstanceBase(ModelMixin):
-#     """
-#     Node instance model representation.
-#     """
-#     __tablename__ = 'node_instances'
-#     _private_fields = ['node_fk', 'host_fk']
-#
-#     runtime_properties = Column(Dict)
-#     scaling_groups = Column(List)
-#     state = Column(Text, nullable=False)
-#     version = Column(Integer, default=1)
-#
-#     @declared_attr
-#     def host_fk(cls):
-#         return cls.foreign_key(NodeInstanceBase, nullable=True)
-#
-#     @declared_attr
-#     def host(cls):
-#         return cls.relationship_to_self('host_fk')
-#
-#     @declared_attr
-#     def host_name(cls):
-#         return association_proxy('host', cls.name_column_name())
-#
-#     @declared_attr
-#     def deployment(cls):
-#         return association_proxy('node', 'deployment')
-#
-#     @declared_attr
-#     def deployment_name(cls):
-#         return association_proxy('node', 'deployment_name')
-#
-#     @declared_attr
-#     def node_fk(cls):
-#         return cls.foreign_key(NodeBase, nullable=True)
-#
-#     @declared_attr
-#     def node(cls):
-#         return cls.many_to_one_relationship('node_fk')
-#
-#     @declared_attr
-#     def node_name(cls):
-#         return association_proxy('node', cls.name_column_name())
-#
-#     @property
-#     def ip(self):
-#         if not self.host_fk:
-#             return None
-#         host_node_instance = self.host
-#         if 'ip' in host_node_instance.runtime_properties:  # pylint: disable=no-member
-#             return host_node_instance.runtime_properties['ip']  # pylint: disable=no-member
-#         host_node = host_node_instance.node  # pylint: disable=no-member
-#         if 'ip' in host_node.properties:
-#             return host_node.properties['ip']
-#         return None
-#
-#
-# class RelationshipInstanceBase(ModelMixin):
-#     """
-#     Relationship instance model representation.
-#     """
-#     __tablename__ = 'relationship_instances'
-#     _private_fields = ['relationship_storage_fk',
-#                        'source_node_instance_fk',
-#                        'target_node_instance_fk',
-#                        'source_position',
-#                        'target_position']
-#
-#     source_position = Column(Integer)
-#     target_position = Column(Integer)
-#
-#     @declared_attr
-#     def source_node_instance_fk(cls):
-#         return cls.foreign_key(NodeInstanceBase, nullable=True)
-#
-#     @declared_attr
-#     def source_node_instance(cls):
-#         return cls.many_to_one_relationship(
-#             'source_node_instance_fk',
-#             backreference='outbound_relationship_instances',
-#             backref_kwargs=dict(
-#                 order_by=cls.source_position,
-#                 collection_class=ordering_list('source_position', count_from=0)
-#             )
-#         )
-#
-#     @declared_attr
-#     def source_node_instance_name(cls):
-#         return association_proxy('source_node_instance', 'node_{0}'.format(cls.name_column_name()))
-#
-#     @declared_attr
-#     def source_node_name(cls):
-#         return association_proxy('source_node_instance', cls.name_column_name())
-#
-#     @declared_attr
-#     def target_node_instance_fk(cls):
-#         return cls.foreign_key(NodeInstanceBase, nullable=True)
-#
-#     @declared_attr
-#     def target_node_instance(cls):
-#         return cls.many_to_one_relationship(
-#             'target_node_instance_fk',
-#             backreference='inbound_relationship_instances',
-#             backref_kwargs=dict(
-#                 order_by=cls.target_position,
-#                 collection_class=ordering_list('target_position', count_from=0)
-#             )
-#         )
-#
-#     @declared_attr
-#     def target_node_instance_name(cls):
-#         return association_proxy('target_node_instance', cls.name_column_name())
-#
-#     @declared_attr
-#     def target_node_name(cls):
-#         return association_proxy('target_node_instance', 'node_{0}'.format(cls.name_column_name()))
-#
-#     @declared_attr
-#     def relationship_fk(cls):
-#         return cls.foreign_key(RelationshipBase)
-#
-#     @declared_attr
-#     def relationship(cls):
-#         return cls.many_to_one_relationship('relationship_fk')
-#
-#     @declared_attr
-#     def relationship_name(cls):
-#         return association_proxy('relationship', cls.name_column_name())
-#
-#
-# class PluginBase(ModelMixin):
-#     """
-#     Plugin model representation.
-#     """
-#     __tablename__ = 'plugins'
-#
-#     archive_name = Column(Text, nullable=False, index=True)
-#     distribution = Column(Text)
-#     distribution_release = Column(Text)
-#     distribution_version = Column(Text)
-#     package_name = Column(Text, nullable=False, index=True)
-#     package_source = Column(Text)
-#     package_version = Column(Text)
-#     supported_platform = Column(Text)
-#     supported_py_versions = Column(List)
-#     uploaded_at = Column(DateTime, nullable=False, index=True)
-#     wheels = Column(List, nullable=False)
-#
-#
-# class TaskBase(ModelMixin):
-#     """
-#     A Model which represents an task
-#     """
-#     __tablename__ = 'tasks'
-#     _private_fields = ['node_instance_fk', 'relationship_instance_fk', 'execution_fk']
-#
-#     @declared_attr
-#     def node_instance_fk(cls):
-#         return cls.foreign_key(NodeInstanceBase, nullable=True)
-#
-#     @declared_attr
-#     def node_instance_name(cls):
-#         return association_proxy('node_instance', cls.name_column_name())
-#
-#     @declared_attr
-#     def node_instance(cls):
-#         return cls.many_to_one_relationship('node_instance_fk')
-#
-#     @declared_attr
-#     def relationship_instance_fk(cls):
-#         return cls.foreign_key(RelationshipInstanceBase, nullable=True)
-#
-#     @declared_attr
-#     def relationship_instance_name(cls):
-#         return association_proxy('relationship_instance', cls.name_column_name())
-#
-#     @declared_attr
-#     def relationship_instance(cls):
-#         return cls.many_to_one_relationship('relationship_instance_fk')
-#
-#     @declared_attr
-#     def plugin_fk(cls):
-#         return cls.foreign_key(PluginBase, nullable=True)
-#
-#     @declared_attr
-#     def plugin(cls):
-#         return cls.many_to_one_relationship('plugin_fk')
-#
-#     @declared_attr
-#     def plugin_name(cls):
-#         return association_proxy('plugin', 'name')
-#
-#     @declared_attr
-#     def execution_fk(cls):
-#         return cls.foreign_key(ExecutionBase, nullable=True)
-#
-#     @declared_attr
-#     def execution(cls):
-#         return cls.many_to_one_relationship('execution_fk')
-#
-#     @declared_attr
-#     def execution_name(cls):
-#         return association_proxy('execution', cls.name_column_name())
-#
-#     PENDING = 'pending'
-#     RETRYING = 'retrying'
-#     SENT = 'sent'
-#     STARTED = 'started'
-#     SUCCESS = 'success'
-#     FAILED = 'failed'
-#     STATES = (
-#         PENDING,
-#         RETRYING,
-#         SENT,
-#         STARTED,
-#         SUCCESS,
-#         FAILED,
-#     )
-#
-#     WAIT_STATES = [PENDING, RETRYING]
-#     END_STATES = [SUCCESS, FAILED]
-#
-#     @orm.validates('max_attempts')
-#     def validate_max_attempts(self, _, value):                                  # pylint: disable=no-self-use
-#         """Validates that max attempts is either -1 or a positive number"""
-#         if value < 1 and value != TaskBase.INFINITE_RETRIES:
-#             raise ValueError('Max attempts can be either -1 (infinite) or any positive number. '
-#                              'Got {value}'.format(value=value))
-#         return value
-#
-#     INFINITE_RETRIES = -1
-#
-#     status = Column(Enum(*STATES, name='status'), default=PENDING)
-#
-#     due_at = Column(DateTime, default=datetime.utcnow)
-#     started_at = Column(DateTime, default=None)
-#     ended_at = Column(DateTime, default=None)
-#     max_attempts = Column(Integer, default=1)
-#     retry_count = Column(Integer, default=0)
-#     retry_interval = Column(Float, default=0)
-#     ignore_failure = Column(Boolean, default=False)
-#
-#     # Operation specific fields
-#     operation_mapping = Column(String)
-#     inputs = Column(Dict)
-#
-#     @property
-#     def actor(self):
-#         """
-#         Return the actor of the task
-#         :return:
-#         """
-#         return self.node_instance or self.relationship_instance
-#
-#     @classmethod
-#     def as_node_instance(cls, instance, **kwargs):
-#         return cls(node_instance=instance, **kwargs)
-#
-#     @classmethod
-#     def as_relationship_instance(cls, instance, **kwargs):
-#         return cls(relationship_instance=instance, **kwargs)
-#
-#     @staticmethod
-#     def abort(message=None):
-#         raise TaskAbortException(message)
-#
-#     @staticmethod
-#     def retry(message=None, retry_interval=None):
-#         raise TaskRetryException(message, retry_interval=retry_interval)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/model_BAK.py
----------------------------------------------------------------------
diff --git a/aria/storage/model_BAK.py b/aria/storage/model_BAK.py
deleted file mode 100644
index 6533b7f..0000000
--- a/aria/storage/model_BAK.py
+++ /dev/null
@@ -1,110 +0,0 @@
-# # Licensed to the Apache Software Foundation (ASF) under one or more
-# # contributor license agreements.  See the NOTICE file distributed with
-# # this work for additional information regarding copyright ownership.
-# # The ASF licenses this file to You under the Apache License, Version 2.0
-# # (the "License"); you may not use this file except in compliance with
-# # the License.  You may obtain a copy of the License at
-# #
-# #     http://www.apache.org/licenses/LICENSE-2.0
-# #
-# # Unless required by applicable law or agreed to in writing, software
-# # distributed under the License is distributed on an "AS IS" BASIS,
-# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# # See the License for the specific language governing permissions and
-# # limitations under the License.
-#
-# """
-# Aria's storage.models module
-# Path: aria.storage.models
-#
-# models module holds aria's models.
-#
-# classes:
-#     * Field - represents a single field.
-#     * IterField - represents an iterable field.
-#     * Model - abstract model implementation.
-#     * Snapshot - snapshots implementation model.
-#     * Deployment - deployment implementation model.
-#     * DeploymentUpdateStep - deployment update step implementation model.
-#     * DeploymentUpdate - deployment update implementation model.
-#     * DeploymentModification - deployment modification implementation model.
-#     * Execution - execution implementation model.
-#     * Node - node implementation model.
-#     * Relationship - relationship implementation model.
-#     * NodeInstance - node instance implementation model.
-#     * RelationshipInstance - relationship instance implementation model.
-#     * ProviderContext - provider context implementation model.
-#     * Plugin - plugin implementation model.
-# """
-# from sqlalchemy.ext.declarative import declarative_base
-#
-# from . import structure
-# from . import base_model as base
-#
-# __all__ = (
-#     'Blueprint',
-#     'Deployment',
-#     'DeploymentUpdateStep',
-#     'DeploymentUpdate',
-#     'DeploymentModification',
-#     'Execution',
-#     'Node',
-#     'Relationship',
-#     'NodeInstance',
-#     'RelationshipInstance',
-#     'Plugin',
-# )
-#
-#
-# #pylint: disable=abstract-method
-# # The required abstract method implementation are implemented in the ModelIDMixin, which is used as
-# # a base to the DeclerativeBase.
-# DeclarativeBase = declarative_base(cls=structure.ModelIDMixin)
-#
-#
-# class Blueprint(DeclarativeBase, base.BlueprintBase):
-#     pass
-#
-#
-# class Deployment(DeclarativeBase, base.DeploymentBase):
-#     pass
-#
-#
-# class Execution(DeclarativeBase, base.ExecutionBase):
-#     pass
-#
-#
-# class DeploymentUpdate(DeclarativeBase, base.DeploymentUpdateBase):
-#     pass
-#
-#
-# class DeploymentUpdateStep(DeclarativeBase, base.DeploymentUpdateStepBase):
-#     pass
-#
-#
-# class DeploymentModification(DeclarativeBase, base.DeploymentModificationBase):
-#     pass
-#
-#
-# class Node(DeclarativeBase, base.NodeBase):
-#     pass
-#
-#
-# class Relationship(DeclarativeBase, base.RelationshipBase):
-#     pass
-#
-#
-# class NodeInstance(DeclarativeBase, base.NodeInstanceBase):
-#     pass
-#
-#
-# class RelationshipInstance(DeclarativeBase, base.RelationshipInstanceBase):
-#     pass
-#
-#
-# class Plugin(DeclarativeBase, base.PluginBase):
-#     pass
-#
-#
-# class Task(DeclarativeBase, base.TaskBase):
-#     pass

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/modeling/elements.py
----------------------------------------------------------------------
diff --git a/aria/storage/modeling/elements.py b/aria/storage/modeling/elements.py
index 44d9e63..3724d4c 100644
--- a/aria/storage/modeling/elements.py
+++ b/aria/storage/modeling/elements.py
@@ -20,9 +20,12 @@ from sqlalchemy import (
 
 from aria.utils.collections import OrderedDict
 from aria.utils.console import puts
-from .utils import coerce_value
 
-from aria.storage import structure, type
+from .utils import coerce_value
+from . import (
+    structure,
+    type,
+)
 
 
 class Function(object):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/modeling/instance_elements.py
----------------------------------------------------------------------
diff --git a/aria/storage/modeling/instance_elements.py b/aria/storage/modeling/instance_elements.py
index 9a4b5df..fde9f0f 100644
--- a/aria/storage/modeling/instance_elements.py
+++ b/aria/storage/modeling/instance_elements.py
@@ -1,3 +1,4 @@
+
 from sqlalchemy import (
     Column,
     Text,
@@ -10,12 +11,13 @@ from sqlalchemy.ext.declarative import declared_attr
 from sqlalchemy.ext.orderinglist import ordering_list
 
 from aria.parser import validation
-from aria.storage import (
+from aria.utils import collections, formatting, console
+
+from . import (
+    utils,
     structure,
-    type as aria_types,
+    type as aria_types
 )
-from aria.utils import collections, formatting, console
-from . import utils
 
 
 # region Element instances

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/modeling/model.py
----------------------------------------------------------------------
diff --git a/aria/storage/modeling/model.py b/aria/storage/modeling/model.py
index 07fd46b..04403e0 100644
--- a/aria/storage/modeling/model.py
+++ b/aria/storage/modeling/model.py
@@ -1,7 +1,12 @@
 from sqlalchemy.ext.declarative import declarative_base
 
-from aria.storage import structure
-from . import elements, template_elements, instance_elements, orchestrator_elements
+from . import (
+    elements,
+    template_elements,
+    instance_elements,
+    orchestrator_elements,
+    structure,
+)
 
 DB = declarative_base(cls=structure.ModelIDMixin)
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/modeling/orchestrator_elements.py
----------------------------------------------------------------------
diff --git a/aria/storage/modeling/orchestrator_elements.py b/aria/storage/modeling/orchestrator_elements.py
index c27a021..a7fc39c 100644
--- a/aria/storage/modeling/orchestrator_elements.py
+++ b/aria/storage/modeling/orchestrator_elements.py
@@ -38,8 +38,6 @@ classes:
 from collections import namedtuple
 from datetime import datetime
 
-from sqlalchemy.ext.associationproxy import association_proxy
-from sqlalchemy.ext.declarative import declared_attr
 from sqlalchemy import (
     Column,
     Integer,
@@ -51,14 +49,13 @@ from sqlalchemy import (
     Float,
     orm,
 )
+from sqlalchemy.ext.associationproxy import association_proxy
+from sqlalchemy.ext.declarative import declared_attr
 
 from aria.orchestrator.exceptions import TaskAbortException, TaskRetryException
-from aria.storage.structure import ModelMixin
-from aria.storage.type import (
-    List,
-    Dict
-)
-from . import elements
+
+from .type import List, Dict
+from .structure import ModelMixin
 
 __all__ = (
     'BlueprintBase',

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/modeling/structure.py
----------------------------------------------------------------------
diff --git a/aria/storage/modeling/structure.py b/aria/storage/modeling/structure.py
new file mode 100644
index 0000000..ba11042
--- /dev/null
+++ b/aria/storage/modeling/structure.py
@@ -0,0 +1,271 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Aria's storage.structures module
+Path: aria.storage.structures
+
+models module holds aria's models.
+
+classes:
+    * Field - represents a single field.
+    * IterField - represents an iterable field.
+    * PointerField - represents a single pointer field.
+    * IterPointerField - represents an iterable pointers field.
+    * Model - abstract model implementation.
+"""
+
+from sqlalchemy.orm import relationship, backref
+from sqlalchemy.ext import associationproxy
+from sqlalchemy import (
+    Column,
+    ForeignKey,
+    Integer,
+    Text,
+    Table
+)
+
+from aria.storage.api import generate_lower_name
+from aria.parser.modeling.elements import Element
+
+
+# TODO: models should inherit for model_element
+class ModelMixin(Element):
+
+    @classmethod
+    def id_column_name(cls):
+        raise NotImplementedError
+
+    @classmethod
+    def name_column_name(cls):
+        raise NotImplementedError
+
+    @classmethod
+    def _get_cls_by_tablename(cls, tablename):
+        """Return class reference mapped to table.
+
+         :param tablename: String with name of table.
+         :return: Class reference or None.
+         """
+        if tablename in (cls.__name__, cls.__tablename__):
+            return cls
+
+        for table_cls in cls._decl_class_registry.values():
+            if tablename == getattr(table_cls, '__tablename__', None):
+                return table_cls
+
+    @classmethod
+    def foreign_key(cls, table_name, nullable=False):
+        """Return a ForeignKey object with the relevant
+
+        :param table: Unique id column in the parent table
+        :param nullable: Should the column be allowed to remain empty
+        """
+        return Column(Integer,
+                      ForeignKey('{tablename}.id'.format(tablename=table_name), ondelete='CASCADE'),
+                      nullable=nullable)
+
+    @classmethod
+    def one_to_one_relationship(cls, table_name, backreference=None):
+        return relationship(lambda: cls._get_cls_by_tablename(table_name),
+                            backref=backref(backreference or cls.__tablename__, uselist=False))
+
+    @classmethod
+    def many_to_one_relationship(cls,
+                                 parent_table_name,
+                                 foreign_key_column=None,
+                                 backreference=None,
+                                 backref_kwargs=None,
+                                 **kwargs):
+        """Return a one-to-many SQL relationship object
+        Meant to be used from inside the *child* object
+
+        :param parent_class: Class of the parent table
+        :param cls: Class of the child table
+        :param foreign_key_column: The column of the foreign key (from the child table)
+        :param backreference: The name to give to the reference to the child (on the parent table)
+        """
+        relationship_kwargs = kwargs
+        if foreign_key_column:
+            relationship_kwargs.setdefault('foreign_keys',  getattr(cls, foreign_key_column))
+
+        backref_kwargs = backref_kwargs or {}
+        backref_kwargs.setdefault('lazy', 'dynamic')
+        # The following line make sure that when the *parent* is
+        #  deleted, all its connected children are deleted as well
+        backref_kwargs.setdefault('cascade', 'all')
+
+        return relationship(lambda: cls._get_cls_by_tablename(parent_table_name),
+                            backref=backref(backreference or cls.__tablename__,
+                                            **backref_kwargs or {}),
+                            **relationship_kwargs)
+
+    @classmethod
+    def one_to_many_relationship(cls, child_table_name, backrefernce=None):
+        return relationship(lambda: cls._get_cls_by_tablename(child_table_name),
+                            backref=backrefernce or '{0}s'.format(cls.__tablename__),
+                            lazy='dynamic')
+
+    @classmethod
+    def relationship_to_self(cls, local_column):
+
+        remote_side_str = '{cls.__name__}.{remote_column}'.format(
+            cls=cls,
+            remote_column=cls.id_column_name()
+        )
+        primaryjoin_str = '{remote_side_str} == {cls.__name__}.{local_column}'.format(
+            remote_side_str=remote_side_str,
+            cls=cls,
+            local_column=local_column)
+        return relationship(cls._get_cls_by_tablename(cls.__tablename__).__name__,
+                            primaryjoin=primaryjoin_str,
+                            remote_side=remote_side_str,
+                            post_update=True)
+
+    @classmethod
+    def many_to_many_relationship(cls, other_table_name, table_prefix, relationship_kwargs=None):
+        """Return a many-to-many SQL relationship object
+
+        Notes:
+        1. The backreference name is the current table's table name
+        2. This method creates a new helper table in the DB
+
+        :param cls: The class of the table we're connecting from
+        :param other_table_name: The class of the table we're connecting to
+        :param table_prefix: Custom prefix for the helper table name and the
+        backreference name
+        """
+        current_table_name = cls.__tablename__
+        current_column_name = '{0}_id'.format(current_table_name)
+        current_foreign_key = '{0}.id'.format(current_table_name)
+
+        other_column_name = '{0}_id'.format(other_table_name)
+        other_foreign_key = '{0}.id'.format(other_table_name)
+
+        helper_table_name = '{0}_{1}'.format(current_table_name, other_table_name)
+
+        backref_name = current_table_name
+        if table_prefix:
+            helper_table_name = '{0}_{1}'.format(table_prefix, helper_table_name)
+            backref_name = '{0}_{1}'.format(table_prefix, backref_name)
+
+        secondary_table = cls.get_secondary_table(
+            cls.metadata,
+            helper_table_name,
+            current_column_name,
+            other_column_name,
+            current_foreign_key,
+            other_foreign_key
+        )
+
+        return relationship(
+            lambda: cls._get_cls_by_tablename(other_table_name),
+            secondary=secondary_table,
+            backref=backref(backref_name),
+            **(relationship_kwargs or {})
+        )
+
+    @staticmethod
+    def get_secondary_table(metadata,
+                            helper_table_name,
+                            first_column_name,
+                            second_column_name,
+                            first_foreign_key,
+                            second_foreign_key):
+        """Create a helper table for a many-to-many relationship
+
+        :param helper_table_name: The name of the table
+        :param first_column_name: The name of the first column in the table
+        :param second_column_name: The name of the second column in the table
+        :param first_foreign_key: The string representing the first foreign key,
+        for example `blueprint.storage_id`, or `tenants.id`
+        :param second_foreign_key: The string representing the second foreign key
+        :return: A Table object
+        """
+        return Table(
+            helper_table_name,
+            metadata,
+            Column(
+                first_column_name,
+                Integer,
+                ForeignKey(first_foreign_key)
+            ),
+            Column(
+                second_column_name,
+                Integer,
+                ForeignKey(second_foreign_key)
+            )
+        )
+
+    def to_dict(self, fields=None, suppress_error=False):
+        """Return a dict representation of the model
+
+        :param suppress_error: If set to True, sets `None` to attributes that
+        it's unable to retrieve (e.g., if a relationship wasn't established
+        yet, and so it's impossible to access a property through it)
+        """
+        res = dict()
+        fields = fields or self.fields()
+        for field in fields:
+            try:
+                field_value = getattr(self, field)
+            except AttributeError:
+                if suppress_error:
+                    field_value = None
+                else:
+                    raise
+            if isinstance(field_value, list):
+                field_value = list(field_value)
+            elif isinstance(field_value, dict):
+                field_value = dict(field_value)
+            elif isinstance(field_value, ModelMixin):
+                field_value = field_value.to_dict()
+            res[field] = field_value
+
+        return res
+
+    @classmethod
+    def _association_proxies(cls):
+        for col, value in vars(cls).items():
+            if isinstance(value, associationproxy.AssociationProxy):
+                yield col
+
+    @classmethod
+    def fields(cls):
+        """Return the list of field names for this table
+
+        Mostly for backwards compatibility in the code (that uses `fields`)
+        """
+        fields = set(cls._association_proxies())
+        fields.update(cls.__table__.columns.keys())
+        return fields - set(getattr(cls, '_private_fields', []))
+
+    def __repr__(self):
+        return '<{__class__.__name__} id=`{id}`>'.format(
+            __class__=self.__class__,
+            id=getattr(self, self.name_column_name()))
+
+
+class ModelIDMixin(object):
+    id = Column(Integer, primary_key=True, autoincrement=True)
+    name = Column(Text, nullable=True, index=True)
+
+    @classmethod
+    def id_column_name(cls):
+        return 'id'
+
+    @classmethod
+    def name_column_name(cls):
+        return 'name'

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/modeling/template_elements.py
----------------------------------------------------------------------
diff --git a/aria/storage/modeling/template_elements.py b/aria/storage/modeling/template_elements.py
index 768e9ff..761d49b 100644
--- a/aria/storage/modeling/template_elements.py
+++ b/aria/storage/modeling/template_elements.py
@@ -26,19 +26,17 @@ from sqlalchemy.ext.associationproxy import association_proxy
 from sqlalchemy.ext.declarative import declared_attr
 
 from aria.parser import validation
-from aria.storage import (
-    structure,
-    type as aria_type,
-)
 from aria.utils import collections, formatting, console
-from . import utils, instance_elements
 
+from . import (
+    utils,
+    instance_elements,
+    structure,
+    type as aria_type
+)
 
 # region Element templates
 
-# Note: parameters as many-to-many would not work, since it could be that the parameters table has
-# note: has multiple values with the same key? maybe could be fixed via unique id?
-
 
 class ServiceTemplateBase(structure.ModelMixin):
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/modeling/type.py
----------------------------------------------------------------------
diff --git a/aria/storage/modeling/type.py b/aria/storage/modeling/type.py
new file mode 100644
index 0000000..d7aad0a
--- /dev/null
+++ b/aria/storage/modeling/type.py
@@ -0,0 +1,271 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import json
+from collections import namedtuple
+from types import NoneType
+
+from sqlalchemy import (
+    TypeDecorator,
+    VARCHAR,
+    event
+)
+
+from sqlalchemy.ext import mutable
+
+from aria.storage import exceptions
+
+
+class _MutableType(TypeDecorator):
+    """
+    Dict representation of type.
+    """
+    @property
+    def python_type(self):
+        raise NotImplementedError
+
+    def process_literal_param(self, value, dialect):
+        pass
+
+    impl = VARCHAR
+
+    def process_bind_param(self, value, dialect):
+        if value is not None:
+            value = json.dumps(value)
+        return value
+
+    def process_result_value(self, value, dialect):
+        if value is not None:
+            value = json.loads(value)
+        return value
+
+
+class Dict(_MutableType):
+    @property
+    def python_type(self):
+        return dict
+
+
+class List(_MutableType):
+    @property
+    def python_type(self):
+        return list
+
+
+class _StrictDictMixin(object):
+    ANY_TYPE = 'any_type'
+
+    _key_cls = ANY_TYPE
+    _value_cls = ANY_TYPE
+
+    @classmethod
+    def coerce(cls, key, value):
+        "Convert plain dictionaries to MutableDict."
+        try:
+            if not isinstance(value, cls):
+                if isinstance(value, dict):
+                    for k, v in value.items():
+                        cls._assert_strict_key(k)
+                        cls._assert_strict_value(v)
+                    return cls(value)
+                return mutable.MutableDict.coerce(key, value)
+            else:
+                return value
+        except ValueError as e:
+            raise exceptions.StorageError('SQL Storage error: {0}'.format(str(e)))
+
+    def __setitem__(self, key, value):
+        self._assert_strict_key(key)
+        self._assert_strict_value(value)
+        super(_StrictDictMixin, self).__setitem__(key, value)
+
+    def setdefault(self, key, value):
+        self._assert_strict_key(key)
+        self._assert_strict_value(value)
+        super(_StrictDictMixin, self).setdefault(key, value)
+
+    def update(self, *a, **kw):
+        if isinstance(a, dict):
+            for k, v in a.items():
+                self._assert_strict_key(k)
+                self._assert_strict_value(v)
+        for k, v in kw.items():
+            self._assert_strict_key(k)
+            self._assert_strict_value(v)
+        super(_StrictDictMixin, self).update(*a, **kw)
+
+    @classmethod
+    def _assert_strict_key(cls, key):
+        if not isinstance(key, (cls._key_cls, NoneType)):
+            raise exceptions.StorageError("Key type was set strictly to {0}, but was {1}".format(
+                cls._key_cls, type(key)
+            ))
+
+    @classmethod
+    def _assert_strict_value(cls, value):
+        if not isinstance(value, (cls._value_cls, NoneType)):
+            raise exceptions.StorageError("Value type was set strictly to {0}, but was {1}".format(
+                cls._value_cls, type(value)
+            ))
+
+
+class _MutableDict(mutable.MutableDict):
+    """
+    Enables tracking for dict values.
+    """
+
+    @classmethod
+    def coerce(cls, key, value):
+        "Convert plain dictionaries to MutableDict."
+        try:
+            return mutable.MutableDict.coerce(key, value)
+        except ValueError as e:
+            raise exceptions.StorageError('SQL Storage error: {0}'.format(str(e)))
+
+
+class _StrictListMixin(object):
+    ANY_TYPE = 'any_type'
+
+    _item_cls = ANY_TYPE
+
+    @classmethod
+    def coerce(cls, key, value):
+        "Convert plain dictionaries to MutableDict."
+        try:
+            if not isinstance(value, cls):
+                if isinstance(value, list):
+                    for item in value:
+                        cls._assert_item(item)
+                    return cls(value)
+                return mutable.MutableList.coerce(key, value)
+            else:
+                return value
+        except ValueError as e:
+            raise exceptions.StorageError('SQL Storage error: {0}'.format(str(e)))
+
+    def __setitem__(self, index, value):
+        """Detect list set events and emit change events."""
+        self._assert_item(value)
+        super(_StrictListMixin, self).__setitem__(index, value)
+
+    def append(self, x):
+        self._assert_item(x)
+        super(_StrictListMixin, self).append(x)
+
+    def extend(self, x):
+        self._assert_item(x)
+        super(_StrictListMixin, self).extend(x)
+
+    def insert(self, i, x):
+        self._assert_item(x)
+        super(_StrictListMixin, self).insert(i, x)
+
+    @classmethod
+    def _assert_item(cls, item):
+        if not isinstance(item, (cls._item_cls, NoneType)):
+            raise exceptions.StorageError("Key type was set strictly to {0}, but was {1}".format(
+                cls._item_cls, type(item)
+            ))
+
+
+class _MutableList(mutable.MutableList):
+
+    @classmethod
+    def coerce(cls, key, value):
+        "Convert plain dictionaries to MutableDict."
+
+        try:
+            if not isinstance(value, cls):
+                if isinstance(value, list):
+                    return cls(value)
+
+                return mutable.Mutable.coerce(key, value)
+            else:
+                return value
+
+        except ValueError as e:
+            raise exceptions.StorageError('SQL Storage error: {0}'.format(str(e)))
+
+_strict_dict_id = namedtuple('strict_dict_id', 'key_cls, value_cls')
+_strict_map = {}
+
+
+def StrictDict(key_cls=NoneType, value_cls=NoneType):
+    strict_dict_map_key = _strict_dict_id(key_cls=key_cls, value_cls=value_cls)
+    if strict_dict_map_key not in _strict_map:
+        strict_dict_cls = type(
+            'StrictDict_{0}_{1}'.format(key_cls.__name__, value_cls.__name__),
+            (Dict, ),
+            {}
+        )
+        type(
+            'StrictMutableDict_{0}_{1}'.format(key_cls.__name__, value_cls.__name__),
+            (_StrictDictMixin, _MutableDict),
+            {'_key_cls': key_cls, '_value_cls': value_cls}
+        ).associate_with(strict_dict_cls)
+        _strict_map[strict_dict_map_key] = strict_dict_cls
+
+    return _strict_map[strict_dict_map_key]
+
+
+def StrictList(item_cls):
+    if item_cls not in _strict_map:
+        strict_list_cls = type(
+            'StrictList_{0}'.format(item_cls.__name__),
+            (List, ),
+            {}
+        )
+        type(
+            'StrictMutableList_{0}'.format(item_cls.__name__),
+            (_StrictListMixin, _MutableList),
+            {'_item_cls': item_cls}
+        ).associate_with(strict_list_cls)
+        _strict_map[item_cls] = strict_list_cls
+
+    return _strict_map[item_cls]
+
+
+def _mutable_association_listener(mapper, cls):
+    for prop in mapper.column_attrs:
+        column_type = prop.columns[0].type
+        if isinstance(column_type, Dict):
+            _MutableDict.associate_with_attribute(getattr(cls, prop.key))
+        if isinstance(column_type, List):
+            _MutableList.associate_with_attribute(getattr(cls, prop.key))
+_LISTENER_ARGS = (mutable.mapper, 'mapper_configured', _mutable_association_listener)
+
+
+def _register_mutable_association_listener():
+    event.listen(*_LISTENER_ARGS)
+
+
+def remove_mutable_association_listener():
+    """
+    Remove the event listener that associates ``Dict`` and ``List`` column types with
+    ``MutableDict`` and ``MutableList``, respectively.
+
+    This call must happen before any model instance is instantiated.
+    This is because once it does, that would trigger the listener we are trying to remove.
+    Once it is triggered, many other listeners will then be registered.
+    At that point, it is too late.
+
+    The reason this function exists is that the association listener, interferes with ARIA change
+    tracking instrumentation, so a way to disable it is required.
+
+    Note that the event listener this call removes is registered by default.
+    """
+    if event.contains(*_LISTENER_ARGS):
+        event.remove(*_LISTENER_ARGS)
+
+_register_mutable_association_listener()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/structure.py
----------------------------------------------------------------------
diff --git a/aria/storage/structure.py b/aria/storage/structure.py
deleted file mode 100644
index bf058f5..0000000
--- a/aria/storage/structure.py
+++ /dev/null
@@ -1,271 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""
-Aria's storage.structures module
-Path: aria.storage.structures
-
-models module holds aria's models.
-
-classes:
-    * Field - represents a single field.
-    * IterField - represents an iterable field.
-    * PointerField - represents a single pointer field.
-    * IterPointerField - represents an iterable pointers field.
-    * Model - abstract model implementation.
-"""
-
-from sqlalchemy.orm import relationship, backref
-from sqlalchemy.ext import associationproxy
-from sqlalchemy import (
-    Column,
-    ForeignKey,
-    Integer,
-    Text,
-    Table
-)
-
-from aria.storage.api import generate_lower_name
-from ..parser.modeling.elements import Element
-
-
-# TODO: models should inherit for model_element
-class ModelMixin(Element):
-
-    @classmethod
-    def id_column_name(cls):
-        raise NotImplementedError
-
-    @classmethod
-    def name_column_name(cls):
-        raise NotImplementedError
-
-    @classmethod
-    def _get_cls_by_tablename(cls, tablename):
-        """Return class reference mapped to table.
-
-         :param tablename: String with name of table.
-         :return: Class reference or None.
-         """
-        if tablename in (cls.__name__, cls.__tablename__):
-            return cls
-
-        for table_cls in cls._decl_class_registry.values():
-            if tablename == getattr(table_cls, '__tablename__', None):
-                return table_cls
-
-    @classmethod
-    def foreign_key(cls, table_name, nullable=False):
-        """Return a ForeignKey object with the relevant
-
-        :param table: Unique id column in the parent table
-        :param nullable: Should the column be allowed to remain empty
-        """
-        return Column(Integer,
-                      ForeignKey('{tablename}.id'.format(tablename=table_name), ondelete='CASCADE'),
-                      nullable=nullable)
-
-    @classmethod
-    def one_to_one_relationship(cls, table_name, backreference=None):
-        return relationship(lambda: cls._get_cls_by_tablename(table_name),
-                            backref=backref(backreference or cls.__tablename__, uselist=False))
-
-    @classmethod
-    def many_to_one_relationship(cls,
-                                 parent_table_name,
-                                 foreign_key_column=None,
-                                 backreference=None,
-                                 backref_kwargs=None,
-                                 **kwargs):
-        """Return a one-to-many SQL relationship object
-        Meant to be used from inside the *child* object
-
-        :param parent_class: Class of the parent table
-        :param cls: Class of the child table
-        :param foreign_key_column: The column of the foreign key (from the child table)
-        :param backreference: The name to give to the reference to the child (on the parent table)
-        """
-        relationship_kwargs = kwargs
-        if foreign_key_column:
-            relationship_kwargs.setdefault('foreign_keys',  getattr(cls, foreign_key_column))
-
-        backref_kwargs = backref_kwargs or {}
-        backref_kwargs.setdefault('lazy', 'dynamic')
-        # The following line make sure that when the *parent* is
-        #  deleted, all its connected children are deleted as well
-        backref_kwargs.setdefault('cascade', 'all')
-
-        return relationship(lambda: cls._get_cls_by_tablename(parent_table_name),
-                            backref=backref(backreference or cls.__tablename__,
-                                            **backref_kwargs or {}),
-                            **relationship_kwargs)
-
-    @classmethod
-    def one_to_many_relationship(cls, child_table_name, backrefernce=None):
-        return relationship(lambda: cls._get_cls_by_tablename(child_table_name),
-                            backref=backrefernce or '{0}s'.format(cls.__tablename__),
-                            lazy='dynamic')
-
-    @classmethod
-    def relationship_to_self(cls, local_column):
-
-        remote_side_str = '{cls.__name__}.{remote_column}'.format(
-            cls=cls,
-            remote_column=cls.id_column_name()
-        )
-        primaryjoin_str = '{remote_side_str} == {cls.__name__}.{local_column}'.format(
-            remote_side_str=remote_side_str,
-            cls=cls,
-            local_column=local_column)
-        return relationship(cls._get_cls_by_tablename(cls.__tablename__).__name__,
-                            primaryjoin=primaryjoin_str,
-                            remote_side=remote_side_str,
-                            post_update=True)
-
-    @classmethod
-    def many_to_many_relationship(cls, other_table_name, table_prefix, relationship_kwargs=None):
-        """Return a many-to-many SQL relationship object
-
-        Notes:
-        1. The backreference name is the current table's table name
-        2. This method creates a new helper table in the DB
-
-        :param cls: The class of the table we're connecting from
-        :param other_table_name: The class of the table we're connecting to
-        :param table_prefix: Custom prefix for the helper table name and the
-        backreference name
-        """
-        current_table_name = cls.__tablename__
-        current_column_name = '{0}_id'.format(current_table_name)
-        current_foreign_key = '{0}.id'.format(current_table_name)
-
-        other_column_name = '{0}_id'.format(other_table_name)
-        other_foreign_key = '{0}.id'.format(other_table_name)
-
-        helper_table_name = '{0}_{1}'.format(current_table_name, other_table_name)
-
-        backref_name = current_table_name
-        if table_prefix:
-            helper_table_name = '{0}_{1}'.format(table_prefix, helper_table_name)
-            backref_name = '{0}_{1}'.format(table_prefix, backref_name)
-
-        secondary_table = cls.get_secondary_table(
-            cls.metadata,
-            helper_table_name,
-            current_column_name,
-            other_column_name,
-            current_foreign_key,
-            other_foreign_key
-        )
-
-        return relationship(
-            lambda: cls._get_cls_by_tablename(other_table_name),
-            secondary=secondary_table,
-            backref=backref(backref_name),
-            **(relationship_kwargs or {})
-        )
-
-    @staticmethod
-    def get_secondary_table(metadata,
-                            helper_table_name,
-                            first_column_name,
-                            second_column_name,
-                            first_foreign_key,
-                            second_foreign_key):
-        """Create a helper table for a many-to-many relationship
-
-        :param helper_table_name: The name of the table
-        :param first_column_name: The name of the first column in the table
-        :param second_column_name: The name of the second column in the table
-        :param first_foreign_key: The string representing the first foreign key,
-        for example `blueprint.storage_id`, or `tenants.id`
-        :param second_foreign_key: The string representing the second foreign key
-        :return: A Table object
-        """
-        return Table(
-            helper_table_name,
-            metadata,
-            Column(
-                first_column_name,
-                Integer,
-                ForeignKey(first_foreign_key)
-            ),
-            Column(
-                second_column_name,
-                Integer,
-                ForeignKey(second_foreign_key)
-            )
-        )
-
-    def to_dict(self, fields=None, suppress_error=False):
-        """Return a dict representation of the model
-
-        :param suppress_error: If set to True, sets `None` to attributes that
-        it's unable to retrieve (e.g., if a relationship wasn't established
-        yet, and so it's impossible to access a property through it)
-        """
-        res = dict()
-        fields = fields or self.fields()
-        for field in fields:
-            try:
-                field_value = getattr(self, field)
-            except AttributeError:
-                if suppress_error:
-                    field_value = None
-                else:
-                    raise
-            if isinstance(field_value, list):
-                field_value = list(field_value)
-            elif isinstance(field_value, dict):
-                field_value = dict(field_value)
-            elif isinstance(field_value, ModelMixin):
-                field_value = field_value.to_dict()
-            res[field] = field_value
-
-        return res
-
-    @classmethod
-    def _association_proxies(cls):
-        for col, value in vars(cls).items():
-            if isinstance(value, associationproxy.AssociationProxy):
-                yield col
-
-    @classmethod
-    def fields(cls):
-        """Return the list of field names for this table
-
-        Mostly for backwards compatibility in the code (that uses `fields`)
-        """
-        fields = set(cls._association_proxies())
-        fields.update(cls.__table__.columns.keys())
-        return fields - set(getattr(cls, '_private_fields', []))
-
-    def __repr__(self):
-        return '<{__class__.__name__} id=`{id}`>'.format(
-            __class__=self.__class__,
-            id=getattr(self, self.name_column_name()))
-
-
-class ModelIDMixin(object):
-    id = Column(Integer, primary_key=True, autoincrement=True)
-    name = Column(Text, nullable=True, index=True)
-
-    @classmethod
-    def id_column_name(cls):
-        return 'id'
-
-    @classmethod
-    def name_column_name(cls):
-        return 'name'

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/aria/storage/type.py
----------------------------------------------------------------------
diff --git a/aria/storage/type.py b/aria/storage/type.py
deleted file mode 100644
index 728f8b1..0000000
--- a/aria/storage/type.py
+++ /dev/null
@@ -1,271 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import json
-from collections import namedtuple
-from types import NoneType
-
-from sqlalchemy import (
-    TypeDecorator,
-    VARCHAR,
-    event
-)
-
-from sqlalchemy.ext import mutable
-
-from . import exceptions
-
-
-class _MutableType(TypeDecorator):
-    """
-    Dict representation of type.
-    """
-    @property
-    def python_type(self):
-        raise NotImplementedError
-
-    def process_literal_param(self, value, dialect):
-        pass
-
-    impl = VARCHAR
-
-    def process_bind_param(self, value, dialect):
-        if value is not None:
-            value = json.dumps(value)
-        return value
-
-    def process_result_value(self, value, dialect):
-        if value is not None:
-            value = json.loads(value)
-        return value
-
-
-class Dict(_MutableType):
-    @property
-    def python_type(self):
-        return dict
-
-
-class List(_MutableType):
-    @property
-    def python_type(self):
-        return list
-
-
-class _StrictDictMixin(object):
-    ANY_TYPE = 'any_type'
-
-    _key_cls = ANY_TYPE
-    _value_cls = ANY_TYPE
-
-    @classmethod
-    def coerce(cls, key, value):
-        "Convert plain dictionaries to MutableDict."
-        try:
-            if not isinstance(value, cls):
-                if isinstance(value, dict):
-                    for k, v in value.items():
-                        cls._assert_strict_key(k)
-                        cls._assert_strict_value(v)
-                    return cls(value)
-                return mutable.MutableDict.coerce(key, value)
-            else:
-                return value
-        except ValueError as e:
-            raise exceptions.StorageError('SQL Storage error: {0}'.format(str(e)))
-
-    def __setitem__(self, key, value):
-        self._assert_strict_key(key)
-        self._assert_strict_value(value)
-        super(_StrictDictMixin, self).__setitem__(key, value)
-
-    def setdefault(self, key, value):
-        self._assert_strict_key(key)
-        self._assert_strict_value(value)
-        super(_StrictDictMixin, self).setdefault(key, value)
-
-    def update(self, *a, **kw):
-        if isinstance(a, dict):
-            for k, v in a.items():
-                self._assert_strict_key(k)
-                self._assert_strict_value(v)
-        for k, v in kw.items():
-            self._assert_strict_key(k)
-            self._assert_strict_value(v)
-        super(_StrictDictMixin, self).update(*a, **kw)
-
-    @classmethod
-    def _assert_strict_key(cls, key):
-        if not isinstance(key, (cls._key_cls, NoneType)):
-            raise exceptions.StorageError("Key type was set strictly to {0}, but was {1}".format(
-                cls._key_cls, type(key)
-            ))
-
-    @classmethod
-    def _assert_strict_value(cls, value):
-        if not isinstance(value, (cls._value_cls, NoneType)):
-            raise exceptions.StorageError("Value type was set strictly to {0}, but was {1}".format(
-                cls._value_cls, type(value)
-            ))
-
-
-class _MutableDict(mutable.MutableDict):
-    """
-    Enables tracking for dict values.
-    """
-
-    @classmethod
-    def coerce(cls, key, value):
-        "Convert plain dictionaries to MutableDict."
-        try:
-            return mutable.MutableDict.coerce(key, value)
-        except ValueError as e:
-            raise exceptions.StorageError('SQL Storage error: {0}'.format(str(e)))
-
-
-class _StrictListMixin(object):
-    ANY_TYPE = 'any_type'
-
-    _item_cls = ANY_TYPE
-
-    @classmethod
-    def coerce(cls, key, value):
-        "Convert plain dictionaries to MutableDict."
-        try:
-            if not isinstance(value, cls):
-                if isinstance(value, list):
-                    for item in value:
-                        cls._assert_item(item)
-                    return cls(value)
-                return mutable.MutableList.coerce(key, value)
-            else:
-                return value
-        except ValueError as e:
-            raise exceptions.StorageError('SQL Storage error: {0}'.format(str(e)))
-
-    def __setitem__(self, index, value):
-        """Detect list set events and emit change events."""
-        self._assert_item(value)
-        super(_StrictListMixin, self).__setitem__(index, value)
-
-    def append(self, x):
-        self._assert_item(x)
-        super(_StrictListMixin, self).append(x)
-
-    def extend(self, x):
-        self._assert_item(x)
-        super(_StrictListMixin, self).extend(x)
-
-    def insert(self, i, x):
-        self._assert_item(x)
-        super(_StrictListMixin, self).insert(i, x)
-
-    @classmethod
-    def _assert_item(cls, item):
-        if not isinstance(item, (cls._item_cls, NoneType)):
-            raise exceptions.StorageError("Key type was set strictly to {0}, but was {1}".format(
-                cls._item_cls, type(item)
-            ))
-
-
-class _MutableList(mutable.MutableList):
-
-    @classmethod
-    def coerce(cls, key, value):
-        "Convert plain dictionaries to MutableDict."
-
-        try:
-            if not isinstance(value, cls):
-                if isinstance(value, list):
-                    return cls(value)
-
-                return mutable.Mutable.coerce(key, value)
-            else:
-                return value
-
-        except ValueError as e:
-            raise exceptions.StorageError('SQL Storage error: {0}'.format(str(e)))
-
-_strict_dict_id = namedtuple('strict_dict_id', 'key_cls, value_cls')
-_strict_map = {}
-
-
-def StrictDict(key_cls=NoneType, value_cls=NoneType):
-    strict_dict_map_key = _strict_dict_id(key_cls=key_cls, value_cls=value_cls)
-    if strict_dict_map_key not in _strict_map:
-        strict_dict_cls = type(
-            'StrictDict_{0}_{1}'.format(key_cls.__name__, value_cls.__name__),
-            (Dict, ),
-            {}
-        )
-        type(
-            'StrictMutableDict_{0}_{1}'.format(key_cls.__name__, value_cls.__name__),
-            (_StrictDictMixin, _MutableDict),
-            {'_key_cls': key_cls, '_value_cls': value_cls}
-        ).associate_with(strict_dict_cls)
-        _strict_map[strict_dict_map_key] = strict_dict_cls
-
-    return _strict_map[strict_dict_map_key]
-
-
-def StrictList(item_cls):
-    if item_cls not in _strict_map:
-        strict_list_cls = type(
-            'StrictList_{0}'.format(item_cls.__name__),
-            (List, ),
-            {}
-        )
-        type(
-            'StrictMutableList_{0}'.format(item_cls.__name__),
-            (_StrictListMixin, _MutableList),
-            {'_item_cls': item_cls}
-        ).associate_with(strict_list_cls)
-        _strict_map[item_cls] = strict_list_cls
-
-    return _strict_map[item_cls]
-
-
-def _mutable_association_listener(mapper, cls):
-    for prop in mapper.column_attrs:
-        column_type = prop.columns[0].type
-        if isinstance(column_type, Dict):
-            _MutableDict.associate_with_attribute(getattr(cls, prop.key))
-        if isinstance(column_type, List):
-            _MutableList.associate_with_attribute(getattr(cls, prop.key))
-_LISTENER_ARGS = (mutable.mapper, 'mapper_configured', _mutable_association_listener)
-
-
-def _register_mutable_association_listener():
-    event.listen(*_LISTENER_ARGS)
-
-
-def remove_mutable_association_listener():
-    """
-    Remove the event listener that associates ``Dict`` and ``List`` column types with
-    ``MutableDict`` and ``MutableList``, respectively.
-
-    This call must happen before any model instance is instantiated.
-    This is because once it does, that would trigger the listener we are trying to remove.
-    Once it is triggered, many other listeners will then be registered.
-    At that point, it is too late.
-
-    The reason this function exists is that the association listener, interferes with ARIA change
-    tracking instrumentation, so a way to disable it is required.
-
-    Note that the event listener this call removes is registered by default.
-    """
-    if event.contains(*_LISTENER_ARGS):
-        event.remove(*_LISTENER_ARGS)
-
-_register_mutable_association_listener()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/tests/storage/test_instrumentation.py
----------------------------------------------------------------------
diff --git a/tests/storage/test_instrumentation.py b/tests/storage/test_instrumentation.py
index 0c7872a..ad4f66c 100644
--- a/tests/storage/test_instrumentation.py
+++ b/tests/storage/test_instrumentation.py
@@ -19,14 +19,13 @@ from sqlalchemy import Column, Text, Integer, event
 from aria.storage import (
     modeling,
     structure,
-    type as aria_type,
     ModelStorage,
     sql_mapi,
     instrumentation
 )
+from aria.storage.modeling import type as aria_type
 from ..storage import get_sqlite_api_kwargs, release_sqlite_storage
 
-
 STUB = instrumentation._STUB
 Value = instrumentation._Value
 instruments_holder = []

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8823f39a/tests/storage/test_model_storage.py
----------------------------------------------------------------------
diff --git a/tests/storage/test_model_storage.py b/tests/storage/test_model_storage.py
index e703102..1b91269 100644
--- a/tests/storage/test_model_storage.py
+++ b/tests/storage/test_model_storage.py
@@ -22,13 +22,12 @@ from aria.storage import (
     exceptions,
     sql_mapi,
     structure,
-    type as aria_type,
     modeling,
 )
+from aria.storage.modeling import type as aria_type
 from ..mock import (
     context as mock_context,
-    models,
-    operations
+    models
 )
 from ..storage import get_sqlite_api_kwargs, release_sqlite_storage
 


Mime
View raw message