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
> 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
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.
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:
4 matches
Mail list logo