Example #1
0
		def txn():
			profile = stores.Profile.get(who)
			profile.word_count = utils.word_count(
				profile.apperence, profile.background, profile.extra_info
			)
			profile.put()                       
			return profile                      
Example #2
0
 def txn():
     profile = stores.Profile(
         key_name=key_name, created=now, updated=now, author=self.udata, name=name, unix_name=unix_name
     )
     profile.public = get("public", "True") == "True"
     profile.markup = get("markup", "Textile")
     profile.age = get("age", "")
     profile.gender = get("gender", "")
     profile.race = get("race", "")
     profile.height = get("height", "")
     profile.weight = get("weight", "")
     profile.apperence = get("apperence", "")
     profile.background = get("background", "")
     profile.extra_info = get("extra_info", "")
     profile.links = get("links", "")
     profile.common = get("common", "")
     profile.word_count = utils.word_count(profile.apperence, profile.background, profile.extra_info)
     profile.put()
     return profile
Example #3
0
		def txn():
			new_args = self.args_to_dict()
			new_args.update({
				'public':public,'markup':markup,
				'updated':datetime.datetime.now()
			})
			if 'name' in new_args:
				del new_args['name'] # Make it impossible to change the name.

			for arg in profile.properties():
				if arg not in new_args:
					continue
				new_arg = new_args.get(arg)
				if new_arg == getattr(profile, arg):
					continue
				changed.append(arg)
				setattr(profile, arg, new_arg)
			profile.word_count = utils.word_count(
				profile.apperence, profile.background, profile.extra_info
			)
			profile.put()