Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F178B200CAD for ; Wed, 28 Jun 2017 10:53:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EEA96160BF7; Wed, 28 Jun 2017 08:53:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 40624160BE8 for ; Wed, 28 Jun 2017 10:53:55 +0200 (CEST) Received: (qmail 84598 invoked by uid 500); 28 Jun 2017 08:53:54 -0000 Mailing-List: contact commits-help@ariatosca.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ariatosca.incubator.apache.org Delivered-To: mailing list commits@ariatosca.incubator.apache.org Received: (qmail 84589 invoked by uid 99); 28 Jun 2017 08:53:54 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2017 08:53:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E35BCC0158 for ; Wed, 28 Jun 2017 08:53:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.22 X-Spam-Level: X-Spam-Status: No, score=-4.22 tagged_above=-999 required=6.31 tests=[HK_RANDOM_FROM=0.001, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id zHoOIFzUkVPu for ; Wed, 28 Jun 2017 08:53:49 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 591755F3FF for ; Wed, 28 Jun 2017 08:53:48 +0000 (UTC) Received: (qmail 84381 invoked by uid 99); 28 Jun 2017 08:53:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2017 08:53:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 95AE9DFA28; Wed, 28 Jun 2017 08:53:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mxmrlv@apache.org To: commits@ariatosca.incubator.apache.org Message-Id: <5e83409d1bbd49a3b4af79973f12c778@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-ariatosca git commit: removed other_table name Date: Wed, 28 Jun 2017 08:53:46 +0000 (UTC) archived-at: Wed, 28 Jun 2017 08:53:56 -0000 Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-294-Workflow-tasks-execution-is-not-in-order d7d5051d8 -> 9820e1b7f removed other_table name Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/9820e1b7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/9820e1b7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/9820e1b7 Branch: refs/heads/ARIA-294-Workflow-tasks-execution-is-not-in-order Commit: 9820e1b7f9cfda782cc0cfb9ba8c0fbb50b189b5 Parents: d7d5051 Author: max-orlov Authored: Wed Jun 28 11:53:42 2017 +0300 Committer: max-orlov Committed: Wed Jun 28 11:53:42 2017 +0300 ---------------------------------------------------------------------- aria/modeling/orchestration.py | 2 +- aria/modeling/relationship.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9820e1b7/aria/modeling/orchestration.py ---------------------------------------------------------------------- diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py index ab389d3..829c305 100644 --- a/aria/modeling/orchestration.py +++ b/aria/modeling/orchestration.py @@ -398,7 +398,7 @@ class TaskBase(mixins.ModelMixin): @declared_attr def dependencies(cls): - return relationship.many_to_many(cls, 'task', self=True) + return relationship.many_to_many(cls, self=True) def has_ended(self): return self.status in (self.SUCCESS, self.FAILED) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9820e1b7/aria/modeling/relationship.py ---------------------------------------------------------------------- diff --git a/aria/modeling/relationship.py b/aria/modeling/relationship.py index 30d174f..76ac316 100644 --- a/aria/modeling/relationship.py +++ b/aria/modeling/relationship.py @@ -226,7 +226,7 @@ def many_to_one(model_class, def many_to_many(model_class, - other_table, + other_table=None, prefix=None, dict_key=None, other_property=None, @@ -263,6 +263,9 @@ def many_to_many(model_class, this_column_name = '{0}_id'.format(this_table) this_foreign_key = '{0}.id'.format(this_table) + if self: + other_table = this_table + other_column_name = '{0}_{1}'.format(other_table, 'self_ref_id' if self else 'id') other_foreign_key = '{0}.{1}'.format(other_table, 'id')