Implement more information displays
This commit is contained in:
@@ -657,14 +657,21 @@ class OSINTSearch(LoginRequiredMixin, View):
|
||||
) -> list[dict[str, str]]:
|
||||
options = []
|
||||
for field in model_cls._meta.get_fields():
|
||||
if field.auto_created and not field.concrete and not field.many_to_many:
|
||||
# Skip reverse/accessor relations (e.g. ManyToManyRel) that are not
|
||||
# directly searchable as user-facing fields in this selector.
|
||||
if field.auto_created and not field.concrete:
|
||||
continue
|
||||
if field.name == "user":
|
||||
continue
|
||||
label = getattr(
|
||||
field,
|
||||
"verbose_name",
|
||||
str(field.name).replace("_", " "),
|
||||
)
|
||||
options.append(
|
||||
{
|
||||
"value": field.name,
|
||||
"label": field.verbose_name.title(),
|
||||
"label": str(label).title(),
|
||||
}
|
||||
)
|
||||
options.sort(key=lambda item: item["label"])
|
||||
|
||||
Reference in New Issue
Block a user