I run a small video game. Each player has an account model with a variety
of properties.
I recently added a TextProperty to track player badges. These are just an
ASCII character that is appended to the account.badges property as they are
awarded.
Because the properly is new, most account models don't have this property.
In about 3 places throughout the site I have some code that looks like this
if not player.badges:
player.badges = ""
player.badges += "A"
player.put_memcache()
player.put()
For some reason, one of the players badges keeps getting reset to "" (empty
string). I can't for the life of me work out how or why.
I've not worked with TextProperties before. Is there some strange behavior
I don't understand?
Do TextProperties not play nice with the memcache?
The account is not getting reset to some old state because other properties
seem to be storing values correctly. Its just this one TextProperty.
Anyhow, I'm confused and would appreciated some fresh ideas that would help
me track down the issue.
*Question Answers*
The badges property is just defined like this
class Account(db.Model):
badges = db.TextProperty()
email = db.StringProperty()
alias = db.StringProperty()
avatar = db.IntegerProperty()
put_memchche is just a wrapper around memcache set.
def put_memchche(self):
memcache.set("account" + self.key().name(), self)
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.