kopia lustrzana https://github.com/HackerspaceKRK/spejstore
Fix parent autocompletes
rodzic
e1a22100c4
commit
d942c99cb9
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
Ładowanie…
Reference in New Issue