|
@@ -46,6 +46,8 @@ def export_ip():
|
|
|
models.Q(resource=models.OuterRef('pk')) & get_active_filter(),
|
|
|
).values('pk')[:1],
|
|
|
),
|
|
|
+ )
|
|
|
+ ip_set = ip_set.annotate(
|
|
|
service=models.Subquery(
|
|
|
Service.objects.filter(
|
|
|
models.Q(allocation__resource=models.OuterRef('pk')) & get_active_filter('allocation'),
|
|
@@ -54,6 +56,7 @@ def export_ip():
|
|
|
models.When(adhesion__user__isnull=False, then=Concat('adhesion__user__first_name', models.Value(' '), 'adhesion__user__last_name')),
|
|
|
models.When(adhesion__corporation__isnull=False, then='adhesion__corporation__social_reason'),
|
|
|
),
|
|
|
+ ).annotate(
|
|
|
fullname=Concat(
|
|
|
models.Value('ADT'),
|
|
|
'adhesion_id',
|
|
@@ -70,6 +73,8 @@ def export_ip():
|
|
|
).values('fullname')[:1],
|
|
|
output_field=models.CharField(),
|
|
|
),
|
|
|
+ )
|
|
|
+ ip_set = ip_set.annotate(
|
|
|
status=models.Case(
|
|
|
models.When(reserved=True, then=models.Value('réservé')),
|
|
|
models.When(allocation__isnull=True, then=models.Value('disponible')),
|