|
@@ -1,3 +1,16 @@
|
|
|
from django.contrib import admin
|
|
from django.contrib import admin
|
|
|
-
|
|
|
|
|
|
|
+from models import Application, Review
|
|
|
# Register your models here.
|
|
# Register your models here.
|
|
|
|
|
+@admin.register(Application)
|
|
|
|
|
+class ApplicationAdmin(admin.ModelAdmin):
|
|
|
|
|
+ list_display = ("id", "user", "course_name", "payment_method", "status", "created_at", "date_start")
|
|
|
|
|
+ list_filter = ("payment_method", "status", "created_at")
|
|
|
|
|
+ search_fields = ("username", "user__full_name", "course_name")
|
|
|
|
|
+ list_per_page = 10
|
|
|
|
|
+ readonly_fields = ("created_at",)
|
|
|
|
|
+
|
|
|
|
|
+@admin.register(Review)
|
|
|
|
|
+class ReviewAdmin(admin.ModelAdmin):
|
|
|
|
|
+ list_display = ["id", "username", "text", "created_at"]
|
|
|
|
|
+ search_fields = ("user__username", "user__full_name", "text")
|
|
|
|
|
+ list_per_page = 10
|