-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vote): add sortable to partners app
- Loading branch information
1 parent
42521c9
commit efb23df
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from django.contrib import admin | ||
from adminsortable2.admin import SortableAdminMixin | ||
|
||
from .models import Partner | ||
|
||
|
||
@admin.register(Partner) | ||
class PartnerAdmin(admin.ModelAdmin): | ||
class PartnerAdmin(SortableAdminMixin, admin.ModelAdmin): | ||
list_display = ("name", "link") |
22 changes: 22 additions & 0 deletions
22
app/contrib/partners/migrations/0002_alter_partner_options_partner_position.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 4.2 on 2024-09-02 21:46 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('partners', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='partner', | ||
options={'ordering': ['position'], 'verbose_name': 'Parceiro'}, | ||
), | ||
migrations.AddField( | ||
model_name='partner', | ||
name='position', | ||
field=models.PositiveIntegerField(default=0), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters