Hello I have this on my GAE application:
try:
last = RegistroDescargas.gql("order by date DESC LIMIT 4")
except:
last = None
With that I can get the last four rows of the database ("RegistroDescagas") that is defined as follows:
class RegistroDescargas(db.Model):
'''Model para guardar el registro de vídeos descargados en la web'''
date = db.DateTimeProperty(auto_now_add=True)
urlOrig = db.StringProperty(required=True)
urlImg = db.StringProperty(required=True)
vidTit = db.StringProperty(required=True)
vidDesc = db.TextProperty()
But of course, if one or the last four results are repeated, just shows me and what I want is to get the last not repeated four rows, and I do not know how I can do that...
Any suggestions? (I think, if at the end this is possible, could be with a totally different sentence, but I don't mind ;))
Any help much appreciated.. Sorry for my english..