Files
santeh-ray/favorites/admin.py
Azimkin 29d8302a4f
All checks were successful
Build and Push Docker Image / build (push) Successful in 51s
feat: add favorites feature for users
- Implemented `Favorite` model with unique user-item constraint and timestamped records
- Added `favorites:index` and `favorites:toggle` views with AJAX support for toggling favorites
- Built templates and front-end assets for the favorites page and integration with item grids
- Extended header with favorites link and dynamic counter
- Added tests covering models, views, and templates for the favorites functionality
- Updated admin to enable management of favorites via Django admin interface
2026-05-10 20:06:12 +02:00

12 lines
297 B
Python

from django.contrib import admin
from .models import Favorite
@admin.register(Favorite)
class FavoriteAdmin(admin.ModelAdmin):
list_display = ("user", "item", "created_at")
list_filter = ("created_at",)
search_fields = ("user__username", "user__email", "item__name", "item__slug")