Changeset View
Changeset View
Standalone View
Standalone View
profiles/admin.py
| from django.contrib import admin | from django.contrib import admin | ||||
| from profiles.models import Profile, Notification | from profiles.models import Profile, Notification | ||||
| from blender_id_oauth_client.models import OAuthUserInfo, OAuthToken | from blender_id_oauth_client.models import OAuthUserInfo, OAuthToken | ||||
| @admin.register(Profile) | @admin.register(Profile) | ||||
| class ProfileAdmin(admin.ModelAdmin): | class ProfileAdmin(admin.ModelAdmin): | ||||
| """Configure Profile admin.""" | """Configure Profile admin.""" | ||||
| search_fields = ['full_name', 'user__username', 'user__email'] | search_fields = ['full_name', 'user__username', 'user__email'] | ||||
| list_display = ['__str__', 'user', 'full_name', 'image_url'] | list_display = ['__str__', 'user', 'full_name'] | ||||
| list_filter = ['is_subscribed_to_newsletter'] | list_filter = ['is_subscribed_to_newsletter'] | ||||
| raw_id_fields = ['user'] | raw_id_fields = ['user'] | ||||
| @admin.register(Notification) | @admin.register(Notification) | ||||
| class NotificationAdmin(admin.ModelAdmin): | class NotificationAdmin(admin.ModelAdmin): | ||||
| """Configure Notification admin.""" | """Configure Notification admin.""" | ||||
| Show All 24 Lines | |||||