I'm still plugging away on this, but haven't gotten it to work yet. I
think the problem that I am having is that I should not be trying to
store part of the object straight into the array, but maybe i need to
actually create a new array first? Anyway, here's the progress I have
so far:
class mwProfile(db.Model):
title=db.StringProperty()
name=db.StringProperty()
charclass=db.StringProperty()
level=db.IntegerProperty()
fb_sig_id=db.StringProperty()
date=db.DateTimeProperty(auto_now_add=True)
titles=db.BlobProperty()
stats=db.BlobProperty()
skills=db.BlobProperty()
weapons=db.BlobProperty()
armor=db.BlobProperty()
vehicles=db.BlobProperty()
boosts=db.BlobProperty()
lots=db.BlobProperty()
props=db.BlobProperty()
#titles=[],stats=[],skills=[]
#weapons=[],armor=[],vehicles=[]
#boosts=[],lots=[];properties=[]
def sync(self,obj):
retcode=0
try:
thisProfile=self
self.title = obj["title"]
self.name = obj["name"]
self.charclass = obj["charclass"]
self.level = int(obj["level"])
self.fb_sig_id=str(obj["fb_sig_id"])
self.titles=obj["titles"]
self.stats=obj["stats"]
self.skills=obj["skills"]
self.weapons=obj["weapons"]
self.armor=obj["armor"]
self.vehicles=obj["vehicles"]
self.boosts=obj["boosts"]
self.lots=obj["lots"]
self.props=obj["props"]
self.put()
retcode=1
except:
logging.error('problem in mwProfile.sync()')
finally:
return retcode
#mws=mwStats()
#rc_mws=mws.newEntry(object.stats,thisProfile)
def getDict(self):
return {
"fb_sig_id":self.fb_sig_id,
"id":str(self.key().id()),"key":str(self.key()),
"title":self.title,"name":self.name,
"charclass":self.charclass,"level":str(self.level),
"date":str(self.date)
}
def getRecord(self):
return {
"fb_sig_id":self.fb_sig_id,
"id":str(self.key().id()),"key":str(self.key()),
"title":self.title,"name":self.name,
"charclass":self.charclass,"level":str(self.level),
"date":str(self.date),
"titles":self.titles,"stats":self.stats,"skills":self.skills,
"weapons":self.weapons,"armor":self.armor,"vehicles":self.vehicles,
"boosts":self.boosts,"lots":self.lots,"props":self.props
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---