Skip to content

Commit

Permalink
Merge pull request jrief#358 from cknoll/patch-1
Browse files Browse the repository at this point in the history
usage.rst: improve source example in "Setup Tabular Inlines ..."
  • Loading branch information
jrief authored Aug 1, 2023
2 parents 294a077 + 7df3c89 commit b7169c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ Setup the Tabular Inlines to enable Buttons to be sorted in Django Admin
.. code:: python
from django.contrib import admin
from adminsortable2.admin import SortableInlineAdminMixin
from adminsortable2.admin import SortableInlineAdminMixin, SortableAdminBase
from models import Panel
class ButtonTabularInline(SortableInlineAdminMixin, admin.TabularInline):
# We don't use the Button model but rather the juction model specified on Panel.
model = Panel.buttons.through
@admin.register(Panel)
class PanelAdmin(admin.ModelAdmin)
class PanelAdmin(SortableAdminBase, admin.ModelAdmin):
inlines = (ButtonTabularInline,)
Expand Down

0 comments on commit b7169c5

Please sign in to comment.