Skip to content

Commit

Permalink
Add autocomplete for the predicates in work admin view
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmwangemi committed Nov 10, 2023
1 parent 0aee12f commit 480504c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions peachjam/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,16 @@ class RelationshipInline(admin.TabularInline):
fk_name = "subject_work"
fields = ("predicate", "object_work")

def get_formset(self, request, obj=None, **kwargs):
return super().get_formset(
request,
obj,
widgets={
"object_work": autocomplete.ModelSelect2(url="autocomplete-works")
},
**kwargs,
)


@admin.register(Work)
class WorkAdmin(admin.ModelAdmin):
Expand Down

0 comments on commit 480504c

Please sign in to comment.