| 621 | | self.primaryjoin_clauses = \ |
| 622 | | _get_join_clauses(self.entity.table, |
| 623 | | self.colname, None, |
| 624 | | self.target.table)[0] |
| 625 | | if not self.primaryjoin_clauses: |
| 626 | | raise Exception( |
| 627 | | "Couldn't find a foreign key constraint in table " |
| 628 | | "'%s' using the following columns: %s." |
| 629 | | % (self.entity.table.name, ', '.join(self.colname))) |
| | 622 | if 'primaryjoin' not in self.kwargs: |
| | 623 | self.primaryjoin_clauses = \ |
| | 624 | _get_join_clauses(self.entity.table, |
| | 625 | self.colname, None, |
| | 626 | self.target.table)[0] |
| | 627 | if not self.primaryjoin_clauses: |
| | 628 | colnames = ', '.join(self.colname) |
| | 629 | raise Exception( |
| | 630 | "Couldn't find a foreign key constraint in table " |
| | 631 | "'%s' using the following columns: %s." |
| | 632 | % (self.entity.table.name, colnames)) |