Stephen,
Thank you very much for the feedback. For the most part, I don't need/
want to be able to query within the data, but i do need to query by
date to get entries. For instance, assume I am showing a google
visualization for "Fights Won" plotted over the last 30 days.
Therefore, all I would need to be able to do is to query all mwProfile
objects for the past 30 days and return ALL the data (after I shape it
using the python visualization api of course). The other advantage to
this approach that I can see is that the data isn't that huge, so
manipulating on the client-side is very easy. For instance, after
plotting all my "Fights Won", let's say I also wanted to plot "Fights
Lost" on the same graph, I already have the data client-side, along
with any other data I may need.
It is somewhat risky though, this type of development. Success hinges
upon being able to see the end result very clearly before laying down
the app foundation, or one could find oneself having to recode almost
everything...anyway, thanks for the input :)
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)
page=db.TextProperty();
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"])
logging.info('made it past the first 5 static properties')
self.page = simplejson.dumps(obj["page"])
self.put()
retcode=1
except:
logging.error('problem in mwProfile.sync():'+ str
(sys.exc_info()[0]))
finally:
return retcode
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),"page":simplejson.loads
(self.page)
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---