On Nov 3, 9:06 pm, nolybab <[email protected]> wrote:
>  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.


A query can only return 1000 entities.

You could pre-calculate the fights won/lost data every time a new
profile is uploaded. i.e. save the profile, then retrieve a
WinLoss30Day entity, snip the 31st days data from the json (or
whatever) if the day has rolled over, append the new win/loss data to
the end, save it back. Return the json blob on query.

If there's likely to be >= 1 upload a second (everyone updates at 12
after a hard day's fragging) you may run into the limit on concurrent
updates to a single entity. You could try pushing the win/loss
calculation into a task queue with concurrency 1.


> 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();


7 propertires, 6 indexes (x2, ascending and descending). If you are
never going to query by eg. fb_sig_id, then you can add indexed=False
to the property. This will make saving the entity faster, it will use
less api_cpu time, and use less  db space.


>         try:
>             thisProfile=self
>             ...
>             retcode=1
>         except:
>             logging.error('...')


Don't use a bare 'except'. See here:

  http://code.google.com/p/googleappengine/issues/detail?id=1409#c8


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to