Skip to content

Commit

Permalink
models: add relationship & backref
Browse files Browse the repository at this point in the history
  • Loading branch information
bouttier committed Jun 3, 2021
1 parent 0880bd2 commit 303fbdb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pypnnomenclature/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class TNomenclatures(DB.Model):
DB.Integer,
ForeignKey('ref_nomenclatures.bib_nomenclatures_types.id_type')
)
nomenclature_type = relationship('BibNomenclaturesTypes', backref="nomenclatures")
cd_nomenclature = DB.Column(DB.Unicode)
mnemonique = DB.Column(DB.Unicode)
label_default = DB.Column(DB.Unicode)
Expand Down Expand Up @@ -122,7 +123,7 @@ class BibNomenclaturesTypeTaxo(BibNomenclaturesTypes):
'''
Hérite de BibNomenclaturesTypes, rajoute simplement une relation vers 'nomenclature' avec la jointure vers la taxonomie
'''
nomenclatures = relationship(
taxonomic_nomenclatures = relationship(
'TNomenclatureTaxonomy',
primaryjoin='and_(TNomenclatureTaxonomy.id_type == BibNomenclaturesTypes.id_type, TNomenclatureTaxonomy.active == True)',
lazy='joined',
Expand Down

0 comments on commit 303fbdb

Please sign in to comment.