Permalink
Browse files

Reset Votes Leaderboard

  • Loading branch information...
georgevreilly committed Feb 3, 2013
1 parent 20063b5 commit a48e12d289f1a988ff32b3ebe19c30ecd869e245
Showing with 19 additions and 0 deletions.
  1. +15 −0 gae_flask_app/AdYouLation/handlers.py
  2. +4 −0 gae_flask_app/templates/reset_votes.html
@@ -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()
@@ -0,0 +1,4 @@
+{% extends "layout.html" %}
+{% block body %}
+ <h1>Reset Votes</h1>
+{% endblock %}

0 comments on commit a48e12d

Please sign in to comment.