After running a query on the datastore, I copy the results to a new list as I interrogate, merge and prune the results. When I'm finished, I'd like to sort the new list, but I'm seeing the following error...
TypeError: 'LiveRouteStatus' object is unsubscriptable
LiveRouteStatus is a Model class that I query, and while the actual code is more complicated, here's a shortened version of what I'm doing...
class LiveRouteStatus(db.Model):
dateAdded = db.DateTimeProperty(autho_now_add=True)
stopID = db.StringProperty()
time = db.IntegerProperty()
q = db.GqlQuery("select * from LiveRouteStatus where stopID = :1 order by dataeAdded desc limit 24", stopID)
route_results = []
for r in routes:
if magic_test_works:
route_results.append(r)
sorted(route_results, key=itemgetter('time')
Is there some basic element of Python that I'm screwing up here? Or is this an indexing issue with the Model class?