I
Size: a a a
I
M
AA
first_name | last_name | age |Айдос идет первым потому что у него есть имя и фамилия,
1. Vasya | | |
2. Aidos | Aidosov | |
3. Zhandos | | 5 |
Output:
```Aidos, Zhandos, Vasay
AA
queryset.annotate(
x_1=Case(When(field_1__is_null=True, then=0), else=1, output_field=IntegerField()),
x_2=Case(When(field_2__is_null=True, then=0), else=1, output_field=IntegerField()),
total=F('x_1') + F('x_2')
).order_by('-total')
AA
AA
i
i
queryset.annotate(
x_1=Case(When(field_1__is_null=True, then=0), else=1, output_field=IntegerField()),
x_2=Case(When(field_2__is_null=True, then=0), else=1, output_field=IntegerField()),
total=F('x_1') + F('x_2')
).order_by('-total')
i
MB
first_name | last_name | age |Айдос идет первым потому что у него есть имя и фамилия,
1. Vasya | | |
2. Aidos | Aidosov | |
3. Zhandos | | 5 |
Output:
```Aidos, Zhandos, Vasay
AA
AA
Z
DB
Z
Z
AS