我有一个模型,我已经尝试使用
order_by('cell_name')
排序,但不是我想要的。我想根据 字母+数字
字段排序。您能否提供建议?任何帮助都将不胜感激。#my model
class BuildingCell(models.Model):
....
cell_name = models.CharField(max_length=100, blank=True, null=True)
#my queryset
q1 = BuildingCell.objects.all().order_by('cell_name')
my result:
cell_name
10a
10b
10c
11a
11b
1a
1b
2a
2b
我想要的结果:
1a
1b
2a
2b
10a
10b
11a
11b