def post(request): #today=datetime.date.today() topic = None nick = None channel = None date = None retval = {} if request.method == "POST": logging.debug('raw_post_data %s' % (request.raw_post_data)) try: data = simplejson.loads(request.raw_post_data) logging.debug('data %s' % (data)) topic = data.get('topic') channel = data.get('channel') nick = data.get('nick') date = datetime.datetime.strptime(data.get('date'), '%Y%m%d%H%M') logging.debug('date: %s, nick: %s, channel, %s, topic: %s' % (date, nick, channel, topic)) except Exception, e: logging.warning('TOPIC/POST: Somewhere near %s' % (e)) retval = {'id': 0, 'topic': e} else: try: t = Topic(channel=channel, nick=nick, topic=topic, date=date) t.put() except Exception, e: logging.warning('TOPIC/POST/NEW: Somewhere near %s' % (e)) retval = {'id': 0, 'topic': e} else: