This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class VoteHandler(webapp.RequestHandler): | |
| def get(self): | |
| #See if logged in | |
| self.Session = Session() | |
| if not 'userkey' in self.Session: | |
| doRender( | |
| self, | |
| 'base/index.html', | |
| {'error' : 'Please login to vote'}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class VoteHandler(webapp.RequestHandler): | |
| def get(self): | |
| #See if logged in | |
| self.Session = Session() | |
| if not 'userkey' in self.Session: | |
| doRender( | |
| self, | |
| 'base/index.html', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class VoteHandler(webapp.RequestHandler): | |
| def get(self): | |
| #See if logged in | |
| self.Session = Session() | |
| if not 'userkey' in self.Session: | |
| doRender( | |
| self, | |
| 'base/index.html', | |
| {'error' : 'Please login to vote'}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class User(db.Model): | |
| account = db.StringProperty() | |
| password = db.StringProperty() | |
| name = db.StringProperty() | |
| created = db.DateTimeProperty(auto_now=True) | |
| class Image(db.Model): | |
| user = db.ReferenceProperty(User) | |
| photo_key = db.BlobProperty() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class VoteHandler(webapp.RequestHandler): | |
| def get(self): | |
| #See if logged in | |
| self.Session = Session() | |
| if not 'userkey' in self.Session: | |
| doRender( | |
| self, | |
| '/loginscreen.html', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import sys | |
| import binascii | |
| filename = "analytics.csv" | |
| analytics = csv.reader(open('../script/analytics.csv', 'r')) | |
| try: | |
| for row in analytics: | |
| if row[0].startswith('/?h='): | |
| # if len(row[0]) % 2 == 1: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def points_list(): | |
| people = User.objects.filter(is_superuser=0) | |
| return {'people': people} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Profile(models.Model): | |
| user = models.ForeignKey(User) | |
| points = models.IntegerField(default=0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ul> | |
| {% for person in people %} | |
| <li><a href="{% url user-profile person.username %}">{{ person.get_profile.points }}pt - {{ person.username }}</a></li> | |
| {% endfor %} | |
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% for person in people %} | |
| {% with profile as person.get_profile %} | |
| {{ person.username }} has - {{ profile.points }} - points. | |
| {% endwith %} | |
| {% endfor %} |