Remove ajax_select from counters

This commit is contained in:
2024-10-20 20:55:05 +02:00
parent 125157fdf4
commit 7f8a2c1eaf
10 changed files with 409 additions and 235 deletions

View File

@ -49,7 +49,15 @@ class AutoCompleteSelectMixin:
context["selected"] = [
self.schema.from_orm(obj).json()
for obj in self.model.objects.filter(
**{f"{self.pk}__in": context["widget"]["value"]}
**{
f"{self.pk}__in": [
pk
for pk in context["widget"]["value"]
if str(
pk
).isdigit() # We filter empty values for create views
]
}
).all()
]
return context