Show More
@@ -589,11 +589,21 b' class Repository(Base, BaseModel):' | |||||
589 | users_group_to_perm = relationship('UsersGroupRepoToPerm', cascade='all') |
|
589 | users_group_to_perm = relationship('UsersGroupRepoToPerm', cascade='all') | |
590 | stats = relationship('Statistics', cascade='all', uselist=False) |
|
590 | stats = relationship('Statistics', cascade='all', uselist=False) | |
591 |
|
591 | |||
592 | followers = relationship('UserFollowing', primaryjoin='UserFollowing.follows_repo_id==Repository.repo_id', cascade='all') |
|
592 | followers = relationship('UserFollowing', | |
|
593 | primaryjoin='UserFollowing.follows_repo_id==Repository.repo_id', | |||
|
594 | cascade='all') | |||
593 |
|
595 | |||
594 | logs = relationship('UserLog') |
|
596 | logs = relationship('UserLog') | |
595 | comments = relationship('ChangesetComment', cascade="all, delete, delete-orphan") |
|
597 | comments = relationship('ChangesetComment', cascade="all, delete, delete-orphan") | |
596 |
|
598 | |||
|
599 | pull_requests_org = relationship('PullRequest', | |||
|
600 | primaryjoin='PullRequest.org_repo_id==Repository.repo_id', | |||
|
601 | cascade="all, delete, delete-orphan") | |||
|
602 | ||||
|
603 | pull_requests_other = relationship('PullRequest', | |||
|
604 | primaryjoin='PullRequest.other_repo_id==Repository.repo_id', | |||
|
605 | cascade="all, delete, delete-orphan") | |||
|
606 | ||||
597 | def __unicode__(self): |
|
607 | def __unicode__(self): | |
598 | return u"<%s('%s:%s')>" % (self.__class__.__name__, self.repo_id, |
|
608 | return u"<%s('%s:%s')>" % (self.__class__.__name__, self.repo_id, | |
599 | self.repo_name) |
|
609 | self.repo_name) | |
@@ -1528,8 +1538,6 b' class PullRequest(Base, BaseModel):' | |||||
1528 | other_repo_id = Column('other_repo_id', Integer(), ForeignKey('repositories.repo_id'), nullable=False) |
|
1538 | other_repo_id = Column('other_repo_id', Integer(), ForeignKey('repositories.repo_id'), nullable=False) | |
1529 | other_ref = Column('other_ref', Unicode(256), nullable=False) |
|
1539 | other_ref = Column('other_ref', Unicode(256), nullable=False) | |
1530 |
|
1540 | |||
1531 | statuses = relationship('ChangesetStatus') |
|
|||
1532 |
|
||||
1533 | @hybrid_property |
|
1541 | @hybrid_property | |
1534 | def revisions(self): |
|
1542 | def revisions(self): | |
1535 | return self._revisions.split(':') |
|
1543 | return self._revisions.split(':') | |
@@ -1539,9 +1547,13 b' class PullRequest(Base, BaseModel):' | |||||
1539 | self._revisions = ':'.join(val) |
|
1547 | self._revisions = ':'.join(val) | |
1540 |
|
1548 | |||
1541 | author = relationship('User', lazy='joined') |
|
1549 | author = relationship('User', lazy='joined') | |
1542 |
reviewers = relationship('PullRequestReviewers' |
|
1550 | reviewers = relationship('PullRequestReviewers', | |
|
1551 | cascade="all, delete, delete-orphan") | |||
1543 | org_repo = relationship('Repository', primaryjoin='PullRequest.org_repo_id==Repository.repo_id') |
|
1552 | org_repo = relationship('Repository', primaryjoin='PullRequest.org_repo_id==Repository.repo_id') | |
1544 | other_repo = relationship('Repository', primaryjoin='PullRequest.other_repo_id==Repository.repo_id') |
|
1553 | other_repo = relationship('Repository', primaryjoin='PullRequest.other_repo_id==Repository.repo_id') | |
|
1554 | statuses = relationship('ChangesetStatus') | |||
|
1555 | comments = relationship('ChangesetComment', | |||
|
1556 | cascade="all, delete, delete-orphan") | |||
1545 |
|
1557 | |||
1546 | def is_closed(self): |
|
1558 | def is_closed(self): | |
1547 | return self.status == self.STATUS_CLOSED |
|
1559 | return self.status == self.STATUS_CLOSED |
General Comments 0
You need to be logged in to leave comments.
Login now