You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mxmrlv <gi...@git.apache.org> on 2017/03/27 09:56:42 UTC

[GitHub] incubator-ariatosca pull request #84: Aria 132 models cascading deletion rai...

GitHub user mxmrlv opened a pull request:

    https://github.com/apache/incubator-ariatosca/pull/84

    Aria 132 models cascading deletion raises constraint errors

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-ariatosca ARIA-132-Models-cascading-deletion-raises-constraint-errors

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-ariatosca/pull/84.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #84
    
----
commit 2ac65e7846d9e15e18a75042e9fde19a6675ad47
Author: max-orlov <ma...@gigaspaces.com>
Date:   2017-03-26T11:13:47Z

    fixed service_instances

commit f48e63284032e3990db28500e122829e3418f8a4
Author: max-orlov <ma...@gigaspaces.com>
Date:   2017-03-26T11:24:26Z

    added service_template

commit 6737b62b7c9ac1cf8b396bdd51d30b40565f507e
Author: max-orlov <ma...@gigaspaces.com>
Date:   2017-03-26T16:31:17Z

    fixing relationship - in progrss

commit ec65383d71b2f5922883ba99e5673dfc3ce8c7d2
Author: max-orlov <ma...@gigaspaces.com>
Date:   2017-03-27T09:56:05Z

    relationship fixes

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #84: ARIA-132 models cascading deletion rai...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/84#discussion_r108393478
  
    --- Diff: aria/modeling/relationship.py ---
    @@ -114,28 +105,24 @@ def one_to_many_self(model_class,
         :param dict_key: If set the value will be a dict with this key as the dict key; otherwise will
                          be a list
         :type dict_key: basestring
    -    :param relationship_kwargs: Extra kwargs for SQLAlchemy ``relationship``
    -    :type relationship_kwargs: {}
         """
    -
    -    relationship_kwargs = relationship_kwargs or {}
    -
    -    relationship_kwargs.setdefault('remote_side', '{model_class}.{remote_column}'.format(
    -        model_class=model_class.__name__,
    -        remote_column=fk
    -    ))
    -
    -    return _relationship(model_class, model_class.__tablename__, None, relationship_kwargs,
    -                         other_property=False, dict_key=dict_key)
    +    return _relationship(
    +        model_class,
    +        model_class.__tablename__,
    +        relationship_kwargs={
    +            'remote_side': '{model_class}.{remote_column}'.format(
    +                model_class=model_class.__name__, remote_column=fk)
    +        },
    +        back_populates=False,
    +        dict_key=dict_key
    +    )
     
     
     def one_to_one(model_class,
                    other_table,
                    fk=None,
                    other_fk=None,
    -               other_property=None,
    -               relationship_kwargs=None,
    -               backref_kwargs=None):
    +               back_populates=None):
    --- End diff --
    
    add NO_BACK_POP const (instead of False)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #84: ARIA-132 models cascading deletion rai...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/84#discussion_r108395116
  
    --- Diff: aria/modeling/service_template.py ---
    @@ -1644,6 +1935,52 @@ def node_template_fk(cls):
     
         # endregion
     
    +    # region association proxies
    +
    +    # endregion
    +
    +    # region one_to_one relationships
    +
    +    # endregion
    +
    +    # region one_to_many relationships
    +
    +    @declared_attr
    +    def artifacts(cls):
    +        return relationship.one_to_many(cls, 'artifact')
    +
    +    # endregion
    +
    +    # region many_to_one relationships
    +
    +    @declared_attr
    +    def node_template(cls):
    +        return relationship.many_to_one(cls, 'node_template')
    +
    +    @declared_attr
    +    def type(cls):
    +        return relationship.many_to_one(cls, 'type', back_populates=False)
    +
    +    # endregion
    +
    +    # region many_to_many relationships
    +
    +    @declared_attr
    +    def properties(cls):
    +        return relationship.many_to_many(cls, 'parameter', prefix='properties', dict_key='name')
    +
    +    # endregion
    +
    +    description = Column(Text)
    +    source_path = Column(Text)
    +    target_path = Column(Text)
    +    repository_url = Column(Text)
    +    repository_credential = Column(modeling_types.StrictDict(basestring, basestring))
    +
    +
    --- End diff --
    
    remove


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #84: ARIA-132 models cascading deletion rai...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/84#discussion_r108392826
  
    --- Diff: aria/.pylintrc ---
    @@ -375,7 +375,7 @@ max-attributes=20
     min-public-methods=0
    --- End diff --
    
    add documentation


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #84: ARIA-132 models cascading deletion rai...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-ariatosca/pull/84


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---