Download ecommerce_app/admin.py from anil988/ecommerce: direct link, hf CLI and curl.
- Browser
- Download file 811 Bytes
-
https://huggingface.co/spaces/anil988/ecommerce/resolve/main/ecommerce_app/admin.py
- Command line
-
hf download hf://spaces/anil988/ecommerce/ecommerce_app/admin.py
-
curl -L -o admin.py https://huggingface.co/spaces/anil988/ecommerce/resolve/main/ecommerce_app/admin.py
811 Bytes
| from django.contrib import admin | |
| from .models import CarouselImage | |
| # Register your models here. | |
| class CarouselImageAdmin(admin.ModelAdmin): | |
| list_display = ['title', 'order', 'is_active', 'created_at'] | |
| list_filter = ['is_active', 'created_at'] | |
| search_fields = ['title', 'subtitle'] | |
| list_editable = ['order', 'is_active'] | |
| prepopulated_fields = {} | |
| fieldsets = ( | |
| ('Content', { | |
| 'fields': ('title', 'subtitle', 'button_text') | |
| }), | |
| ('Image & Link', { | |
| 'fields': ('image', 'link_url') | |
| }), | |
| ('Display Settings', { | |
| 'fields': ('order', 'is_active') | |
| }), | |
| ) | |
| def get_queryset(self, request): | |
| return super().get_queryset(request).order_by('order', '-created_at') | |