In the appengine python application, I have counters that count the number of favs for a photo and the number of views.
I have photos and counters. To order photos by popularity (# from favs), I must have # favs stored in my Photo objects (Photo.all (). Order ('num_favs')). Since I keep track of the number of favs in a closed counter, I wonder what is the most efficient way to update my Yahoo objects with the latest favs number from the Counter model?
Here is a thesis about how my models look:
class Photo(db.Model): photo = db.BlobProperty() favs = db.IntegerProperty()
I would appreciate it if I could answer: 1) The most efficient way to arrange objects based on their counters 2) If the logic that I follow to sort objects based on their counters is correct - what is the most efficient way to update Photo objects with their counters?
Thanks!
source share