> 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. Does > anybody know what I need to change to get it so that Django > compares prices instead of strings in my price field?
Your guess is correct...CharFields sort character-by-character. Sounds like your price field should be a DecimalField (or a FloatField, depending on whether your version of Django has the newly-added DecimalField) rather than a CharField -tim --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---