Re: Trying to use order_by on a list object

2007-09-19 Thread Greg
Tim, Here is my Price class class Price(models.Model): name = models.DecimalField(max_digits=6, decimal_places=2) price_cat = models.ForeignKey(PriceCategory) def __str__(self,): return str(self.name) class Admin: pass // I guess my 'return str(self

Re: Trying to use order_by on a list object

2007-09-19 Thread Tim Chase
> I guess the order_by('price') is working. However, it's not > working how I want it to. When I do the order_by on price > django think that a price of 59.99 is greater than a price of > 129.99. I guess it's looking at the first character and since > a 1 is less than a 5 it puts the 129.99 pri

Re: Trying to use order_by on a list object

2007-09-19 Thread Greg
I guess the order_by('price') is working. However, it's not working how I want it to. When I do the order_by on price django think that a price of 59.99 is greater than a price of 129.99. I guess it's looking at the first character and since a 1 is less than a 5 it puts the 129.99 price first.

Trying to use order_by on a list object

2007-09-18 Thread Greg
Hello, I have the following code 's2 = s.sandp.all()' When I do a 'assert False, s2' I get the following: [, )>, , )>, , )>, , )>] I want to be able to sort the list by the Price. /// I tried the following code s2 = s.sandp.order_by('price') assert False, s2 And this is what I get: