Skip to content

Commit

Permalink
docs: ArrayWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Jun 6, 2024
1 parent 7607b00 commit 9fb951c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Did you decide to start using Unfold but you don't have time to make the switch
- **Dependencies:** completely based only on `django.contrib.admin`
- **Actions:** multiple ways how to define actions within different parts of admin
- **WYSIWYG:** built-in support for WYSIWYG (Trix)
- **Array widget:** built-in widget for `django.contrib.postgres.fields.ArrayField`
- **Filters:** custom dropdown, numeric, datetime, and text fields
- **Dashboard:** custom components for rapid dashboard development
- **Model tabs:** define custom tab navigations for models
Expand Down Expand Up @@ -297,9 +298,10 @@ def permission_callback(request):

from django import models
from django.contrib import admin
from django.contrib.postgres.fields import ArrayField
from django.db import models
from unfold.admin import ModelAdmin
from unfold.contrib.forms.widgets import WysiwygWidget
from unfold.contrib.forms.widgets import ArrayWidget, WysiwygWidget


@admin.register(MyModel)
Expand All @@ -322,6 +324,9 @@ class CustomAdminClass(ModelAdmin):
formfield_overrides = {
models.TextField: {
"widget": WysiwygWidget,
},
ArrayField: {
"widget": ArrayWidget,
}
}
```
Expand Down

0 comments on commit 9fb951c

Please sign in to comment.