Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Reset Votes Leaderboard

  • Loading branch information...
commit a48e12d289f1a988ff32b3ebe19c30ecd869e245 1 parent 20063b5
@georgevreilly authored
View
15 gae_flask_app/AdYouLation/handlers.py
@@ -2,11 +2,26 @@
from flask import render_template, current_app, url_for, redirect
from flask.ext.wtf import Form, TextField, RadioField, Required, Email
from gaesessions import get_current_session
+from google.appengine.ext import db
import random
import logging
import uuid
+class Video(db.Model):
+ name = db.StringProperty(required = True)
+ up_votes = db.IntegerProperty(required = True)
+ down_votes = db.IntegerProperty(required = True)
+
+@AdYouLation.route('/_reset_votes')
+def reset_votes():
+ videos = current_app.videos["videos"]
+ results = []
+ for video in videos:
+ model = Video(name=video, up_votes=0, down_votes=0)
+ model.put()
+ return render_template("reset_votes.html")
+
def create_playlist():
videos = current_app.videos
keys = videos["videos"].keys()
View
4 gae_flask_app/templates/reset_votes.html
@@ -0,0 +1,4 @@
+{% extends "layout.html" %}
+{% block body %}
+ <h1>Reset Votes</h1>
+{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.