diff --git a/cps/db.py b/cps/db.py
index f6ee790e..e4082a16 100755
--- a/cps/db.py
+++ b/cps/db.py
@@ -56,6 +56,10 @@ books_languages_link = Table('books_languages_link', Base.metadata,
Column('lang_code', Integer, ForeignKey('languages.id'), primary_key=True)
)
+books_publishers_link = Table('books_publishers_link', Base.metadata,
+ Column('book', Integer, ForeignKey('books.id'), primary_key=True),
+ Column('publisher', Integer, ForeignKey('publishers.id'), primary_key=True)
+ )
class Identifiers(Base):
__tablename__ = 'identifiers'
@@ -182,6 +186,21 @@ class Languages(Base):
def __repr__(self):
return u"".format(self.lang_code)
+class Publishers(Base):
+ __tablename__ = 'publishers'
+
+ id = Column(Integer, primary_key=True)
+ name = Column(String)
+ sort = Column(String)
+
+ def __init__(self, name,sort):
+ self.name = name
+ self.sort = sort
+
+ def __repr__(self):
+ return u"".format(self.name, self.sort)
+
+
class Data(Base):
__tablename__ = 'data'
@@ -224,6 +243,7 @@ class Books(Base):
series = relationship('Series', secondary=books_series_link, backref='books')
ratings = relationship('Ratings', secondary=books_ratings_link, backref='books')
languages = relationship('Languages', secondary=books_languages_link, backref='books')
+ publishers = relationship('Publishers', secondary=books_publishers_link, backref='books')
identifiers = relationship('Identifiers', backref='books')
def __init__(self, title, sort, author_sort, timestamp, pubdate, series_index, last_modified, path, has_cover,
diff --git a/cps/templates/detail.html b/cps/templates/detail.html
index 8775f079..0a5167b6 100644
--- a/cps/templates/detail.html
+++ b/cps/templates/detail.html
@@ -50,6 +50,7 @@
{% if entry.identifiers|length > 0 %}
{% endif %}
+ {% if entry.publishers|length > 0 %}
+
+
+ {{_('Publisher')}}:{% for publisher in entry.publishers %} {{publisher.name}}{% if not loop.last %},{% endif %}{% endfor %}
+
+
+ {% endif %}
{% if entry.pubdate[:10] != '0101-01-01' %}
{{_('Publishing date')}}: {{entry.pubdate|formatdate}}
{% endif %}
diff --git a/cps/templates/search_form.html b/cps/templates/search_form.html
index 2e9f4d3d..e61195ec 100644
--- a/cps/templates/search_form.html
+++ b/cps/templates/search_form.html
@@ -10,63 +10,67 @@
-
+
+
+
+
+
-
+
-
+
-
+
{% if languages %}
-
+
-
+