From 3426fc37d2cac97104a08b97cf1777f70a822bc8 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Sun, 14 Sep 2014 00:00:28 +0200 Subject: [PATCH] Fix author->songs relation Fixes: https://launchpad.net/bugs/1369139 --- openlp/plugins/songs/lib/db.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index a9206a397..895dba4b5 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -31,8 +31,6 @@ The :mod:`db` module provides the database and schema that is the backend for the Songs plugin """ -import re - from sqlalchemy import Column, ForeignKey, Table, types from sqlalchemy.orm import mapper, relation, reconstructor from sqlalchemy.sql.expression import func, text @@ -329,7 +327,9 @@ def init_schema(url): Column('topic_id', types.Integer(), ForeignKey('topics.id'), primary_key=True) ) - mapper(Author, authors_table) + mapper(Author, authors_table, properties={ + 'songs': relation(Song, secondary=authors_songs_table, viewonly=True) + }) mapper(AuthorSong, authors_songs_table, properties={ 'author': relation(Author) })