Fix device issues and document current LAN deployment
This commit is contained in:
@@ -121,6 +121,18 @@ def device_queryset(params, archived: bool = False) -> QuerySet[Device]:
|
||||
qs = qs.filter(Q(laptop_specification__battery=value) | Q(computer_specification__battery=value))
|
||||
else:
|
||||
qs = qs.filter(computer_field_query(name, "exact", value) | Q(**{f"printer_specification__{name}": value}))
|
||||
for name in ("camera", "sound", "hdmi", "vga", "dvi", "displayport"):
|
||||
value = params.get(name)
|
||||
if value:
|
||||
if value not in Device.TriState.values:
|
||||
return qs.none()
|
||||
relations = ("laptop_specification", "aio_specification") if name in {"camera", "sound"} else ("monitor_specification",)
|
||||
query = Q()
|
||||
for relation in relations:
|
||||
query |= Q(**{f"{relation}__{name}": value})
|
||||
qs = qs.filter(query)
|
||||
if ratio := params.get("aspect_ratio", "").strip():
|
||||
qs = qs.filter(monitor_specification__aspect_ratio=ratio)
|
||||
vendor_query = Q()
|
||||
for value in params.getlist("cpu_vendor"):
|
||||
if value in CPU_VENDOR_QUERIES:
|
||||
|
||||
Reference in New Issue
Block a user