Ejemplo n.º 1
0
def comics(key=None, page_number=1):

    series = get_comic_series(key)

    if not series:
        return redirect(url_for('series'))

    comics = series.comics.order_by(Comic.published_date.desc()).paginate(int(page_number), ITEMS_PER_PAGE, False)
    
    return render_template('comics.html', key=key, title=series.title, 
                            series=series, comics=comics, 
                            page_number=page_number)
Ejemplo n.º 2
0
def comics(key=None, page_number=1):

    series = get_comic_series(key)

    if not series:
        return redirect(url_for('series'))

    comics = series.comics.order_by(Comic.published_date.desc()).paginate(
        int(page_number), ITEMS_PER_PAGE, False)

    return render_template('comics.html',
                           key=key,
                           title=series.title,
                           series=series,
                           comics=comics,
                           page_number=page_number)
Ejemplo n.º 3
0
            (key, original_date) = match_object.group(1,2)

            published_date = dirpath.split('/')[-1]

            vintage = (published_date != original_date)

            if vintage and not key.endswith('-vintage'):
                key = '%s-vintage' % key

            comic_exists = get_comic(key, published_date, original_date)

            if comic_exists:
                print "%s already exists in database." % (filename,)
                continue
                
            series = get_comic_series(key)

            try:
                o = Comic(series.id, original_date, published_date, filename)
                db.session.add(o)
                counter = counter + 1
                if not counter % increment:
                    db.session.commit()
                print "Added %s" % filename
            except:
                print "Error %s" % filename


db.session.commit()

# Remove missing comics from database