Fix parent autocompletes

Fix_link_to_HSWAW
Dariusz Niemczyk 2023-08-04 18:02:08 +02:00
rodzic e1a22100c4
commit d942c99cb9
Nie znaleziono w bazie danych klucza dla tego podpisu
2 zmienionych plików z 10 dodań i 5 usunięć

Wyświetl plik

@ -38,8 +38,15 @@ class ItemAdmin(ModelAdminMixin, admin.ModelAdmin):
form = ItemForm
inlines = [ItemImageInline]
save_on_top = True
autocomplete_fields = ["parent", "owner", "taken_by", "categories"]
search_fields = ["name", "owner__name", "taken_by__name"]
autocomplete_fields = [
"parent",
"owner",
"taken_by",
"categories",
]
search_fields = [
"name",
]
def formfield_for_foreignkey(self, db_field, request, **kwargs):
formfield = super().formfield_for_foreignkey(db_field, request, **kwargs)

Wyświetl plik

@ -51,9 +51,7 @@ class Category(models.Model):
class StaffManager(UserManager):
def get_queryset(self):
qs = super().get_queryset()
return qs
pass
class StaffProxyModel(User):