Commit dbcce451 authored by plb's avatar plb
Browse files

ajout de la relation entre bank et catégorie

parent 877478fd
......@@ -16,6 +16,10 @@ class Bank(Base):
fk_account = Column('fk_account', Integer, ForeignKey('llx_bank_account.rowid'))
account = relationship("BankAccount", backref="entries", lazy="subquery")
bankclass = relationship(
"BankClass", backref="bank", uselist=False,
lazy="subquery"
)
url_company = relationship(
"BankUrl", uselist=False, backref="bank_company", innerjoin=True,
......@@ -51,11 +55,11 @@ class BankCateg(Base):
class BankClass(Base):
__tablename__ = "llx_bank_class"
id = Column('lineid', Integer, primary_key=True)
id = Column('lineid', Integer, ForeignKey('llx_bank.rowid'), primary_key=True)
UniqueConstraint('lineid', 'fk_categ')
categ_id = Column('fk_categ', Integer, ForeignKey('llx_bank_categ.rowid'))
categs = relationship(
categ = relationship(
"BankCateg", backref="classes",
lazy="subquery",
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment