Fix parent autocompletes
This commit is contained in:
parent
e1a22100c4
commit
d942c99cb9
|
@ -38,8 +38,15 @@ class ItemAdmin(ModelAdminMixin, admin.ModelAdmin):
|
||||||
form = ItemForm
|
form = ItemForm
|
||||||
inlines = [ItemImageInline]
|
inlines = [ItemImageInline]
|
||||||
save_on_top = True
|
save_on_top = True
|
||||||
autocomplete_fields = ["parent", "owner", "taken_by", "categories"]
|
autocomplete_fields = [
|
||||||
search_fields = ["name", "owner__name", "taken_by__name"]
|
"parent",
|
||||||
|
"owner",
|
||||||
|
"taken_by",
|
||||||
|
"categories",
|
||||||
|
]
|
||||||
|
search_fields = [
|
||||||
|
"name",
|
||||||
|
]
|
||||||
|
|
||||||
def formfield_for_foreignkey(self, db_field, request, **kwargs):
|
def formfield_for_foreignkey(self, db_field, request, **kwargs):
|
||||||
formfield = super().formfield_for_foreignkey(db_field, request, **kwargs)
|
formfield = super().formfield_for_foreignkey(db_field, request, **kwargs)
|
||||||
|
|
|
@ -51,9 +51,7 @@ class Category(models.Model):
|
||||||
|
|
||||||
|
|
||||||
class StaffManager(UserManager):
|
class StaffManager(UserManager):
|
||||||
def get_queryset(self):
|
pass
|
||||||
qs = super().get_queryset()
|
|
||||||
return qs
|
|
||||||
|
|
||||||
|
|
||||||
class StaffProxyModel(User):
|
class StaffProxyModel(User):
|
||||||
|
|
Loading…
Reference in New Issue