hi, I am trying to sort my tables depending upon the header. Its working fine if my models does have any ForeignKey or ManyToManyField. but if its does sorting is not working.
class Meeting(models.Model): created_by = models.ForeignKey(User, blank=True, null=True) meeting_desc = models.CharField(maxlength = 2000) meeting_date = models.DateField('meeting date') def meetings( request , page=None, orderby=None, orderas=None, type=None ): activemaintab = "meetings" orderbyowner = "owner" orderbydate = "date" defaultsortby = "meeting_date" defaultorderas = "desc" if orderbydate == "date": orderby = "meeting_date" if orderby =="owner": orderby ="created_by" meeting_list = Meeting.objects.order_by(sortby) It working fine for all the header but not for owner... What am I doing wrong here??? Thanks --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---