Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
yaghoubi committed Dec 28, 2024
1 parent b019ee6 commit adc4aaa
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,33 @@ DAISY_SETTINGS = {

---

### Using Tabbed Inline Admin

To create a tabbed inline admin interface in your Django project, follow these steps:

1. **Import the necessary modules**:
import NavTabMixin in your `admin.py` file:
```python
from django_daisy.mixins import NavTabMixin
```

2. **Extend `NavTabMixin` in your `InlineAdmin` class**:
Create your inline admin class by extending `NavTabMixin` along with `admin.TabularInline` or `admin.StackedInline` for a different layout:
```python
class ChoiceInline(admin.TabularInline, NavTabMixin): # or admin.StackedInline for a different layout
model = Choice
extra = 1
```

3. **Register your inline admin class**:
Use the inline admin class in your `ModelAdmin` class:
```python
@admin.register(Poll)
class PollAdmin(admin.ModelAdmin):
inlines = [ChoiceInline]
```



## 🤝 Contributing

Expand Down

0 comments on commit adc4aaa

Please sign in to comment.