From e225bffc306251ebf55d656191090fa5ffb317de Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sun, 4 Oct 2020 12:47:50 +0200 Subject: [PATCH] add backref for some models --- app/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models.py b/app/models.py index 56ed883f..cfa1626b 100644 --- a/app/models.py +++ b/app/models.py @@ -1101,7 +1101,7 @@ class Contact(db.Model, ModelMixin): pgp_public_key = db.Column(db.Text, nullable=True) pgp_finger_print = db.Column(db.String(512), nullable=True) - alias = db.relationship(Alias) + alias = db.relationship(Alias, backref="contacts") user = db.relationship(User) # the latest reply sent to this contact @@ -1245,7 +1245,7 @@ class EmailLog(db.Model, ModelMixin): refused_email = db.relationship("RefusedEmail") forward = db.relationship(Contact) - contact = db.relationship(Contact) + contact = db.relationship(Contact, backref="email_logs") def bounced_mailbox(self) -> str: if self.bounced_mailbox_id: