Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (27 sloc) 0.805 kb
from google.appengine.ext import db
from google.appengine.api import memcache
import logging
import helpers
class MP(db.Model):
aristotleid = db.IntegerProperty(required=True)
name = db.StringProperty(required=True)
constituency = db.StringProperty(required=True)
class KeyValue(db.Model):
k = db.StringProperty(required=True)
v = db.StringProperty(required=True)
@classmethod
def get(cls, key, default=None):
r = cls.all().filter('k =', key).get()
if r:
return r.v
return default
@classmethod
def set(cls, key, value=None):
r = cls.all().filter('k =', key).get()
if r:
r.v = value
r.save()
return r
obj = cls(k=key, v=value)
obj.save()
return obj
Jump to Line
Something went wrong with that request. Please try again.