Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

start of simple model to hold intermediate data

  • Loading branch information...
commit 4ee0964e529e984fb3c3fd7c4b8aeb5770422834 1 parent 0ed12f3
@bradfitz authored
Showing with 23 additions and 1 deletion.
  1. +13 −1 addressbooker.py
  2. +10 −0 models.py
View
14 addressbooker.py
@@ -15,6 +15,7 @@
__author__ = 'brad@danga.com (Brad Fitzpatrick)'
+import models
import cgi
import wsgiref.handlers
@@ -293,7 +294,18 @@ def EraseStoredTokens(self):
gdata.alt.appengine.save_auth_tokens({})
def post(self):
- contacts = simplejson.loads(self.request.get('json'));
+ handle = self.request.get('handle')
+ json = self.request.get('json')
+ group = self.request.get('group')
+
+ if handle:
+ post_dump = models.PostDump(key_name="handle:" + handle,
+ json=json,
+ group=group,
+ handle=handle)
+ post_dump.put()
+
+ contacts = simplejson.loads(json)
#self.response.out.write("You posted: " + pprint.pformat(contacts));
for contact in contacts:
self.response.out.write("<br clear='both'><h2>%s</h2>" % contact["name"])
View
10 models.py
@@ -0,0 +1,10 @@
+from google.appengine.ext import db
+
+class PostDump(db.Model):
+ handle = db.StringProperty(required=True)
+ json = db.TextProperty()
+ group = db.StringProperty()
+ touch_time = db.DateTimeProperty(auto_now_add=True,
+ auto_now=True)
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.