Exemplo n.º 1
0
def preview_list(listid):
    """
    Fetch the list with given listid from our database,
    display with template
    """
    the_list = Catalist.objects.get(listid=listid)
    if cmp_permission(query_cur_perm(the_list), "view") < 0:
        abort(403)
    return render_template("preview.html", listtitle=the_list.title, entries=the_list.contents)
Exemplo n.º 2
0
def getlist(listid):
    """ Display a list with given listid from our database. """
    url = request.base_url
    try:
        the_list = Catalist.objects.get(listid=listid)
    except DoesNotExist:
        abort(404)
    if cmp_permission(query_cur_perm(the_list), "view") < 0:
        abort(403)
    msg = ("Access or share this list at:<br>" '<input type="url" id="listurl" value={0}>').format(url)

    return render_template("loadlist.html", listtitle=the_list.title, entries=the_list.contents, message=msg)