From bed547808deee985d8827674e91db3c492b44c7e Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Mon, 10 Mar 2014 17:19:10 -0500 Subject: [PATCH] [SQLSeen] Create relationships after creation of class --- SQLSeen/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SQLSeen/plugin.py b/SQLSeen/plugin.py index 195fd29..7fed034 100644 --- a/SQLSeen/plugin.py +++ b/SQLSeen/plugin.py @@ -38,9 +38,6 @@ class Entry(Base): nick = sqlalchemy.Column(sqlalchemy.String, nullable=False) message = sqlalchemy.Column(sqlalchemy.String) - network = sqlalchemy.orm.relationship("Network") - channel = sqlalchemy.orm.relationship("Channel") - def update(self, networkid, channelid, nick, message): self.networkid = networkid self.channelid = channelid @@ -51,6 +48,9 @@ class Entry(Base): def __init__(self, networkid, channelid, nick, message): return self.update(networkid, channelid, nick, message) +Entry.network = sqlalchemy.orm.relationship("Network") +Entry.channel = sqlalchemy.orm.relationship("Channel") + class SQLSeen(callbacks.Plugin): """