RP
qs = qs.annotate(
total_install=Coalesce(
Count(
Case(
When(rewards__content_type=install_ctype,
rewards__visit_id=OuterRef('pk'),
then=1),
output_field=models.IntegerField())), Value(0)),
Size: a a a
RP
qs = qs.annotate(
total_install=Coalesce(
Count(
Case(
When(rewards__content_type=install_ctype,
rewards__visit_id=OuterRef('pk'),
then=1),
output_field=models.IntegerField())), Value(0)),
DT
RP
DT
RP
DT
RP
DT
DT
RP
DT
DT
DT
RP
RP
RP
qs = qs.annotate(
total_install=Count('object_id', filter=Q(content_type=install_ctype))
)
DT
DT
qs = qs.annotate(
total_install=Count('object_id', filter=Q(content_type=install_ctype))
)
RP