Esempio n. 1
0
def renderGroupId(sid, page=1):

	group, names, feeds, items_raw, series = get_group_id(sid, page)


	if group is None:
		flash(gettext('Group/Translator not found? This is probably a error!'))
		return redirect(url_for('renderGroupsTable'))

	try:
		feed_entries = feeds.paginate(page, app.config['SERIES_PER_PAGE'])
	except werkzeug.exceptions.NotFound:
		feed_entries = None
	try:
		items = items_raw.paginate(page, app.config['SERIES_PER_PAGE'])
	except werkzeug.exceptions.NotFound:
		items = None


	return render_template('group.html',
						   series                 = series,
						   releases_sequence_item = items,
						   feed_sequence_item     = feed_entries,
						   group                  = group,
						   wiki                   = wiki_views.render_wiki("Group", group.name)
						   )
Esempio n. 2
0
def renderGroupId(sid, page=1):

	group = Translators.query.filter(Translators.id==sid).scalar()

	if group is None:
		flash(gettext('Group/Translator not found? This is probably a error!'))
		return redirect(url_for('renderGroupsTable'))

	names = [tmp.name for tmp in group.alt_names]

	feeds = Feeds.query.options(joinedload('tags')) \
		.filter(Feeds.srcname.in_(names))            \
		.order_by(desc(Feeds.published))


	items = Releases.query.filter(Releases.tlgroup==group.id).order_by(desc(Releases.published)).all()
	feed_entries = feeds.paginate(page, app.config['SERIES_PER_PAGE'])

	ids = []
	for item in items:
		ids.append(item.series)

	series = Series.query.filter(Series.id.in_(ids)).order_by(Series.title).all()

	return render_template('group.html',
						   series        = series,
						   releases      = items,
						   sequence_item = feed_entries,
						   group         = group,
						   wiki          = wiki_views.render_wiki("Group", group.name)
						   )
Esempio n. 3
0
def renderPublisherId(sid, page=1):

	pub, series = get_publisher_id(sid)

	if pub is None:
		flash(gettext('Tag not found? This is probably a error!'))
		return redirect(url_for('renderTagTable'))

	series_entries = series.paginate(page, app.config['SERIES_PER_PAGE'], False)
	return render_template('search_results.html',
						   sequence_item   = series_entries,
						   page            = page,
						   name_key        = "title",
						   page_url_prefix = 'series-id',
						   searchTarget    = 'Publishers',
						   searchValue     = pub.name,
						   wiki            = wiki_views.render_wiki("Publisher", pub.name)
						   )
Esempio n. 4
0
def renderGenreId(sid, page=1):

    genre, series = get_genre_id(sid)

    if genre is None:
        flash(gettext('Genre not found? This is probably a error!'))
        return redirect(url_for('renderGenreTable'))

    series_entries = series.paginate(page, app.config['SERIES_PER_PAGE'],
                                     False)
    return render_template('search_results.html',
                           sequence_item=series_entries,
                           page=page,
                           name_key="title",
                           page_url_prefix='series-id',
                           searchTarget='Genres',
                           searchValue=genre.genre,
                           wiki=wiki_views.render_wiki("Genre", genre.genre))
Esempio n. 5
0
def renderPublisherId(sid, page=1):

    pub, series = get_publisher_id(sid)

    if pub is None:
        flash(gettext('Tag not found? This is probably a error!'))
        return redirect(url_for('renderTagTable'))

    series_entries = series.paginate(page, app.config['SERIES_PER_PAGE'],
                                     False)
    return render_template('search_results.html',
                           sequence_item=series_entries,
                           page=page,
                           name_key="title",
                           page_url_prefix='series-id',
                           searchTarget='Publishers',
                           searchValue=pub.name,
                           wiki=wiki_views.render_wiki("Publisher", pub.name))
Esempio n. 6
0
def renderGenreId(sid, page=1):

	genre, series = get_genre_id(sid)

	if genre is None:
		flash(gettext('Genre not found? This is probably a error!'))
		return redirect(url_for('renderGenreTable'))


	series_entries = series.paginate(page, app.config['SERIES_PER_PAGE'], False)
	return render_template('search_results.html',
						   sequence_item   = series_entries,
						   page            = page,
						   name_key        = "title",
						   page_url_prefix = 'series-id',
						   searchTarget    = 'Genres',
						   searchValue     = genre.genre,
						   wiki            = wiki_views.render_wiki("Genre", genre.genre)
						   )
Esempio n. 7
0
def renderAuthorId(sid, page=1):
	author, series = get_author(sid)
	# print("Author search result: ", author)

	if author is None:
		flash(gettext('Author not found? This is probably a error!'))
		return redirect(url_for('renderAuthorTable'))

	series_entries = series.paginate(page, app.config['SERIES_PER_PAGE'], False)

	return render_template('search_results.html',
						   sequence_item   = series_entries,
						   page            = page,
						   name_key        = "title",
						   page_url_prefix = 'series-id',
						   searchTarget    = 'Authors',
						   searchValue     = author.name,
						   wiki            = wiki_views.render_wiki("Author", author.name)
						   )
Esempio n. 8
0
def renderAuthorId(sid, page=1):
    author, series = get_author(sid)
    # print("Author search result: ", author)

    if author is None:
        flash(gettext('Author not found? This is probably a error!'))
        return redirect(url_for('renderAuthorTable'))

    series_entries = series.paginate(page, app.config['SERIES_PER_PAGE'],
                                     False)

    return render_template('search_results.html',
                           sequence_item=series_entries,
                           page=page,
                           name_key="title",
                           page_url_prefix='series-id',
                           searchTarget='Authors',
                           searchValue=author.name,
                           wiki=wiki_views.render_wiki("Author", author.name))
Esempio n. 9
0
def renderGroupId(sid, page=1):

    group = Translators.query.filter(Translators.id == sid).scalar()

    if group is None:
        flash(gettext('Group/Translator not found? This is probably a error!'))
        return redirect(url_for('renderGroupsTable'))

    names = [tmp.name for tmp in group.alt_names]

    feeds = Feeds.query.options(joinedload('tags')) \
     .filter(Feeds.srcname.in_(names))            \
     .order_by(desc(Feeds.published))

    items_raw = Releases.query.filter(Releases.tlgroup == group.id).order_by(
        desc(Releases.published))
    try:
        feed_entries = feeds.paginate(page, app.config['SERIES_PER_PAGE'])
    except werkzeug.exceptions.NotFound:
        feed_entries = None
    try:
        items = items_raw.paginate(page, app.config['SERIES_PER_PAGE'])
    except werkzeug.exceptions.NotFound:
        items = None

    subq = Releases.query.with_entities(
        Releases.series.distinct()).filter(Releases.tlgroup == group.id)
    print("Subquery: ", subq)
    seriesq = Series.query.filter(Series.id.in_(subq)).order_by(Series.title)
    print("Main q: ", seriesq)
    series = seriesq.all()

    return render_template('group.html',
                           series=series,
                           releases_sequence_item=items,
                           feed_sequence_item=feed_entries,
                           group=group,
                           wiki=wiki_views.render_wiki("Group", group.name))