On Jun 16, 3:34 am, Streamweaver <streamwea...@gmail.com> wrote: > sqlite3 > > I changed the method and it seems to be working now. > > The code I'm using is: > > def all_last_updated(self): > d = [self.last_updated, self.activity_set.latest > ().last_updated] > d.sort() > d.reverse() > return d[0] > > There seemed to be some problem when chaining sort().reverse() before. > > Not sure I understand it still and attributing it to me missing > something in general but it's working now.
The problem is that sort() doesn't return anything, it sorts in-place. So you can't chain it, as reverse() acts on the return value of the previous function, which is None. Although I can't understand why you got the error you did, I would expect the error 'NoneType' object has no attribute 'reverse'. -- DR. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---