1

I have a situation where I need to pass through an ordered table to my template, trouble is the table has some rows which are numeric, others which are text and others that are a combination of both. The first column on which the table is sorted has a foreign key relationship.

This is my query at the moment:

placing = ClubPlacing.objects.filter(event=event).order_by('division__code','placing')

Both division__code and placing have rows which are numeric and text. (in models as a charfield)

When the data is displayed I have 1, 10, 11, 2, 3, 4, 5... ...CT, O1 (that last one is the letter O)

The placing column displays 1, 10, 11, 2, 3... ...no comp

I am using Django 1.8 and Postgres on Linux.

Alex Stewart
  • 730
  • 3
  • 12
  • 30

0 Answers0