d
———————————
select text, (count - show_count) as c
from ad
where is_active=True
order by c
Size: a a a
d
mc
RS
MyObject.filter(is_active=True).annotate(c=Count('pk')-F('show_count')).order_by('c').values('text', 'c')
Из головы придумал, но читай доку про annotate и вот это все, чтоб разобраться и сделать как надоd
MyObject.filter(is_active=True).annotate(c=Count('pk')-F('show_count')).order_by('c').values('text', 'c')
Из головы придумал, но читай доку про annotate и вот это все, чтоб разобраться и сделать как надоe
admin_slug.js:24 Uncaught TypeError: django.jQuery is not a function
at admin_slug.js:24
class Media:
js = (
'',
'/static/admin/js/custom/admin_slug.js',
)
RS
admin_slug.js:24 Uncaught TypeError: django.jQuery is not a function
at admin_slug.js:24
class Media:
js = (
'',
'/static/admin/js/custom/admin_slug.js',
)
S
AF
e
RS
RS
CF
S
e
RS
RS
RS
CF
d
MyObject.filter(is_active=True).annotate(c=Count('pk')-F('show_count')).order_by('c').values('text', 'c')
Из головы придумал, но читай доку про annotate и вот это все, чтоб разобраться и сделать как надоRS