parent
ae1e7c57d5
commit
af8d908bba
|
@ -153,7 +153,7 @@ class User(UserBase, Base):
|
||||||
role = Column(SmallInteger, default=ROLE_USER)
|
role = Column(SmallInteger, default=ROLE_USER)
|
||||||
password = Column(String)
|
password = Column(String)
|
||||||
kindle_mail = Column(String(120), default="")
|
kindle_mail = Column(String(120), default="")
|
||||||
shelf = relationship('Shelf', backref='user', lazy='dynamic')
|
shelf = relationship('Shelf', backref='user', lazy='dynamic', order_by='Shelf.name')
|
||||||
downloads = relationship('Downloads', backref='user', lazy='dynamic')
|
downloads = relationship('Downloads', backref='user', lazy='dynamic')
|
||||||
locale = Column(String(2), default="en")
|
locale = Column(String(2), default="en")
|
||||||
sidebar_view = Column(Integer, default=1)
|
sidebar_view = Column(Integer, default=1)
|
||||||
|
|
|
@ -623,7 +623,7 @@ def before_request():
|
||||||
g.user = current_user
|
g.user = current_user
|
||||||
g.allow_registration = config.config_public_reg
|
g.allow_registration = config.config_public_reg
|
||||||
g.allow_upload = config.config_uploading
|
g.allow_upload = config.config_uploading
|
||||||
g.public_shelfes = ub.session.query(ub.Shelf).filter(ub.Shelf.is_public == 1).all()
|
g.public_shelfes = ub.session.query(ub.Shelf).filter(ub.Shelf.is_public == 1).order_by(ub.Shelf.name).all()
|
||||||
if not config.db_configured and request.endpoint not in ('basic_configuration', 'login') and '/static/' not in request.path:
|
if not config.db_configured and request.endpoint not in ('basic_configuration', 'login') and '/static/' not in request.path:
|
||||||
return redirect(url_for('basic_configuration'))
|
return redirect(url_for('basic_configuration'))
|
||||||
|
|
||||||
|
@ -1250,7 +1250,7 @@ def language(name, page):
|
||||||
@login_required_if_no_ano
|
@login_required_if_no_ano
|
||||||
def category_list():
|
def category_list():
|
||||||
entries = db.session.query(db.Tags, func.count('books_tags_link.book').label('count'))\
|
entries = db.session.query(db.Tags, func.count('books_tags_link.book').label('count'))\
|
||||||
.join(db.books_tags_link).join(db.Books).filter(common_filters())\
|
.join(db.books_tags_link).join(db.Books).order_by(db.Tags.name).filter(common_filters())\
|
||||||
.group_by('books_tags_link.tag').all()
|
.group_by('books_tags_link.tag').all()
|
||||||
return render_title_template('list.html', entries=entries, folder='category', title=_(u"Category list"))
|
return render_title_template('list.html', entries=entries, folder='category', title=_(u"Category list"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user