Hello,
In my view I do some queries on a class called Style.  The end result
is I have a variable called styles that contains a list of Style
objects.  For example:

styles = [<Style: 42k>, <Style: 51c>, <Style: 561j>

///////////////////

Below are my Style and Collection classes:

class Style(models.Model):
    name = models.CharField(maxlength=200, core=True)
    collection = models.ForeignKey(Collection)

class Collection(models.Model):
    name = models.CharField(maxlength=200)
    value = models.IntegerField()

////////////////////

My problem is that I want to be able to order my styles list by the
'value' field from my Collection class.  In my code I try to do:

styles.order_by('collection.value')

However, I get the error: 'OperationalError: no such column:
collection.value'.

Does anybody know how I can order my styles variable by my 'value'
field in my Collection class?

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to