Skip to content

Commit

Permalink
feat: add models to admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Akay7 committed Jun 6, 2024
1 parent 0ae75e6 commit 6e8a0cd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
18 changes: 17 additions & 1 deletion backend/friend_request/admin.py
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# Register your models here.
from django.contrib import admin
from .models import FriendRequest


@admin.register(FriendRequest)
class FriendRequestAdmin(admin.ModelAdmin):
list_display = [
"id",
"from_user",
"to_user",
"created_at",
"accepted_at",
"rejected_at",
]
search_fields = ["from_user__email", "to_user__email"]
list_filter = ["accepted_at", "rejected_at"]
ordering = ["id"]
11 changes: 10 additions & 1 deletion backend/user/admin.py
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
# Register your models here.
from django.contrib import admin
from .models import User


@admin.register(User)
class UserAdmin(admin.ModelAdmin):
list_display = ["id", "email", "first_name", "last_name"]
search_fields = ["email", "first_name", "last_name"]
list_filter = ["is_active", "is_staff", "is_superuser"]
ordering = ["id"]

0 comments on commit 6e8a0cd

Please sign in to comment.