feat: add is_featured/is_top_event fields and API endpoints
- Event model: added is_featured, is_top_event BooleanFields - Migration 0007 applied to DB - EventForm: checkboxes for both new fields - EventAdmin: list_display, list_editable, list_filter for both flags - FeaturedEventsAPI: POST /api/events/featured-events/ -> is_featured=True events - TopEventsAPI: POST /api/events/top-events/ -> is_top_event=True events
This commit is contained in:
@@ -3,10 +3,11 @@ from .models import Event, EventImages
|
||||
|
||||
@admin.register(Event)
|
||||
class EventAdmin(admin.ModelAdmin):
|
||||
list_display = ('id','name','start_date','end_date','event_type','event_status')
|
||||
list_filter = ('event_status','event_type')
|
||||
search_fields = ('name','place','district')
|
||||
list_display = ('id', 'name', 'start_date', 'end_date', 'event_type', 'event_status', 'is_featured', 'is_top_event')
|
||||
list_filter = ('event_status', 'event_type', 'is_featured', 'is_top_event')
|
||||
list_editable = ('is_featured', 'is_top_event')
|
||||
search_fields = ('name', 'place', 'district')
|
||||
|
||||
@admin.register(EventImages)
|
||||
class EventImagesAdmin(admin.ModelAdmin):
|
||||
list_display = ('id','event','is_primary')
|
||||
list_display = ('id', 'event', 'is_primary')
|
||||
|
||||
Reference in New Issue
Block a user