There is a selection of objects. Each object has a field "title", which must be sorted. For clarity, below will depict a list of these titles
['30', '10', 'zxc', '7', 'abc', '4', '1', 'абв', 'раа'] In a meta model, view, or template, I can apply sorting by the title field. for example
{% for obj in queryset|dictsort:'title' %} {{ obj.title }} {% endfor %}</ul> As a result, we get this sorting
['1', '10', '30', '4', '7', 'abc', 'zxc', 'абв', 'раа'] In alphabetical order everything is OK, in figures it is necessary ascending, the result is necessary such
['1', '4', '7', '10', '30', 'abc', 'zxc', 'абв', 'раа'] How is it possible to get?
The methods I saw are based on the extra method and use numeric fields, not strings, for example, if someone tells you how to adapt, it will be great
Can it somehow be possible to set a sorting template in a meta model or view where you can directly specify a list of characters?
***UPDATE*** Here, the answer brought the solution, however, the sorting does not change, probably incorrectly built a SQL query to the database
queryset=Test.objects.extra(select={'field': 'SELECT title FROM core_page ORDER BY title ASC limit 1'})