allow manual ordering of cloud provider
All checks were successful
Build and Deploy / build (push) Successful in 50s
Build and Deploy / deploy (push) Successful in 4s

This commit is contained in:
Tobias Brunner 2025-03-12 06:41:33 +01:00
parent 7bd09ec6aa
commit 3f6fc4a86e
No known key found for this signature in database
4 changed files with 37 additions and 3 deletions

View file

@ -68,11 +68,19 @@ class CategoryAdmin(admin.ModelAdmin):
@admin.register(CloudProvider)
class CloudProviderAdmin(admin.ModelAdmin):
list_display = ("name", "slug", "logo_preview", "disable_listing", "is_featured")
class CloudProviderAdmin(SortableAdminMixin, admin.ModelAdmin):
list_display = (
"name",
"slug",
"logo_preview",
"disable_listing",
"is_featured",
"order",
)
search_fields = ("name", "description")
prepopulated_fields = {"slug": ("name",)}
inlines = [OfferingInline]
ordering = ("order",)
def logo_preview(self, obj):
if obj.logo: