コード例 #1
0
ファイル: profile.py プロジェクト: lugkhast/forever-alone-gae
	def delete(self):
		user = users.get_current_user()
		if not user:
			self.error(400)
			return

		profile = UserProfile.get_or_insert(user.user_id())
		if profile:
			profile.delete()
コード例 #2
0
ファイル: profile.py プロジェクト: lugkhast/forever-alone-gae
	def post(self):
		user = users.get_current_user()
		if not user:
			self.error(400)
			return
		
		# Create the user's profile, with his ID as its key name
		profile = UserProfile.get_or_insert(user.user_id())
		profile.set_defaults()
		profile.bind_to_user()

		json = self.request.get('json')
		if json:
			profileDict = simplejson.loads(json)
			profile.update_from_dict(profileDict)


		profile.put()
		self.response.out.write(str(profile.key()))