24 lines
675 B
Python
24 lines
675 B
Python
# frontend/admin.py
|
|
from django.contrib import admin
|
|
from .models import UserProfile, FAQ
|
|
|
|
@admin.register(UserProfile)
|
|
class UserProfileAdmin(admin.ModelAdmin):
|
|
list_display = ('user', 'ldap_uid', 'user_group')
|
|
search_fields = ('user__username', 'ldap_uid')
|
|
list_filter = ('user__groups',)
|
|
|
|
|
|
@admin.register(FAQ)
|
|
class FAQAdmin(admin.ModelAdmin):
|
|
list_display = ('title', 'order', 'created_at', 'updated_at')
|
|
list_filter = ('created_at',)
|
|
search_fields = ('title', 'content')
|
|
list_editable = ('order',)
|
|
ordering = ('order', 'title')
|
|
|
|
fieldsets = (
|
|
(None, {
|
|
'fields': ('title', 'content', 'order')
|
|
}),
|
|
) |