Hi, Code : ***************Model******************
class Company(models.Model): name = models.CharField( max_length=100) created_on = models.DateTimeField(auto_now_add=True) updated_on = models.DateTimeField( auto_now = True) class CallReport(models.Model): company = models.ForeignKey(Company, related_name = "callreports", null =True) meetingdate = models.DateField() met_by = models.CharField(null=True, max_length=200) transaction_oppurtunity = models.TextField(null=True, max_length = 2000) created_on = models.DateTimeField(auto_now_add=True) updated_on = models.DateTimeField( auto_now = True) So my problem I need to sort the companies listing by meeting date in callreports. ************************view************** sortby = callreports.meetingdate company_list = Company.objects.order_by(sortby) Gives me error. Exception Type: OperationalError Exception Value: (1054, "Unknown column 'callreports.meetingdate' So how can I fix it. 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 -~----------~----~----~----~------~----~------~--~---