Skip to content

Commit

Permalink
Merge pull request #296 from maykinmedia/add-uuids-to-admin
Browse files Browse the repository at this point in the history
Add UUID to admin search fields and fieldsets
  • Loading branch information
stevenbal authored Jan 16, 2025
2 parents 0274775 + 80e226d commit e6a3ea4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/openklant/components/klantinteracties/admin/actoren.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,24 @@ class ActorAdmin(admin.ModelAdmin):
"soort_actor",
"indicatie_actief",
)
search_fields = ("naam",)
search_fields = (
"naam",
"uuid",
)
inlines = (
ActorKlantcontactInlineAdmin,
GeautomatiseerdeActorInlineAdmin,
MedewerkerInlineAdmin,
OrganisatorischeEenheidInlineAdmin,
InterneTaakInlineAdmin,
)
readonly_fields = ("uuid",)
fieldsets = (
(
None,
{
"fields": [
"uuid",
"naam",
"soort_actor",
"indicatie_actief",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def clean_adres(self):
@admin.register(DigitaalAdres)
class DigitaalAdresAdmin(admin.ModelAdmin):
readonly_fields = ("uuid",)
search_fields = ("adres",)
search_fields = (
"adres",
"uuid",
)
autocomplete_fields = ("partij",)
form = DigitaalAdresAdminForm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ class InterneTaakAdmin(admin.ModelAdmin):
"toegewezen_op",
"afgehandeld_op",
)
search_fields = ("nummer",)
search_fields = (
"nummer",
"uuid",
)
list_filter = (
"actoren",
"status",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ class BetrokkeneInlineAdmin(admin.StackedInline):
"contactnaam_achternaam",
)
autocomplete_fields = ("partij",)
readonly_fields = ("uuid",)
fieldsets = [
(
None,
{
"fields": [
"uuid",
"partij",
"klantcontact",
"rol",
Expand Down Expand Up @@ -70,16 +72,19 @@ class BetrokkeneInlineAdmin(admin.StackedInline):
@admin.register(Betrokkene)
class BetrokkeneAdmin(admin.ModelAdmin):
search_fields = (
"uuid",
"contactnaam_voorletters",
"contactnaam_voorvoegsel_achternaam",
"contactnaam_achternaam",
)
autocomplete_fields = ("partij",)
readonly_fields = ("uuid",)
fieldsets = [
(
None,
{
"fields": [
"uuid",
"partij",
"klantcontact",
"rol",
Expand Down Expand Up @@ -159,8 +164,12 @@ class KlantcontactAdmin(admin.ModelAdmin):
BijlageInlineAdmin,
InterneTaakInlineAdmin,
]
search_fields = ("nummer",)
search_fields = (
"nummer",
"uuid",
)
date_hierarchy = "plaatsgevonden_op"
readonly_fields = ("uuid",)

@admin.display(empty_value="---")
def betrokkene_namen(self, obj):
Expand Down

0 comments on commit e6a3ea4

Please sign in to comment.