コード例 #1
0
def index(request, page):
    """Show the index page or any an offset of it."""
    days = []
    days_found = set()
    query = Entry.query.order_by(Entry.pub_date.desc())
    pagination = Pagination(query, PER_PAGE, page, 'index')
    for entry in pagination.entries:
        day = date(*entry.pub_date.timetuple()[:3])
        if day not in days_found:
            days_found.add(day)
            days.append({'date': day, 'entries': []})
        days[-1]['entries'].append(entry)
    return render_template('index.html', days=days, pagination=pagination)
コード例 #2
0
ファイル: views.py プロジェクト: kellengreen/wedding
def index(request, page):
    """Show the index page or any an offset of it."""
    days = []
    days_found = set()
    query = Entry.query.order_by(Entry.pub_date.desc())
    pagination = Pagination(query, PER_PAGE, page, 'index')
    for entry in pagination.entries:
        day = date(*entry.pub_date.timetuple()[:3])
        if day not in days_found:
            days_found.add(day)
            days.append({'date': day, 'entries': []})
        days[-1]['entries'].append(entry)
    return render_template('index.html', days=days, pagination=pagination)
コード例 #3
0
def about(request):
    """Show the about page, so that we have another view func ;-)"""
    return render_template('about.html')
コード例 #4
0
ファイル: views.py プロジェクト: kellengreen/wedding
def about(request):
    """Show the about page, so that we have another view func ;-)"""
    return render_template('team.html')