Exemplo n.º 1
0
def render_query(request, query, limit=10):
    feedback_list = []
    for feedback in query.fetch(limit):
        try:
            submitter = feedback.submitter  # Attempt to dereference.
            feedback_list.append(feedback)
        except datastore_errors.Error:
            pass  # Ignore feedback if the submitter doesn't exist.
    already_voted = get_already_voted(request)
    return render_to_string('feedback/messages.html', locals())
Exemplo n.º 2
0
def feedback_recently(request):
    page = request.META["PATH_INFO"]
    feedback_list = []
    for feedback in Feedback.all().filter("page", page).order("-points").order("-submitted"):
        try:
            submitter = feedback.submitter  # Attempt to dereference.
            feedback_list.append(feedback)
        except datastore_errors.Error:
            pass  # Ignore feedback if the submitter doesn't exist.
    feedback_list
    already_voted = get_already_voted(request)
    return render_to_string("feedback/messages.html", locals())