I am trying to get the most recent data item from the datastore.
I am trying to apply the method as explained here but I am getting the object <__main__.Rep object at 0x075F1730>
not the item. Can anyone explain what I am doing wrong?
The Model is:
class Rep(db.Model):
sent = db.StringProperty()
time = db.DateTimeProperty(auto_now_add=True)
This is the handler:
class Repeater(webapp.RequestHandler):
def get(self):
reps = Rep()
reps.sent = self.request.get('sentence')
reps.put()
s = self.request.get('sentence')
query = reps.all()
last = query.order('-time').get()
sentences = query
Thanks!