temp checkin
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
from django.contrib import admin
|
||||
from .models import CustomUser, Announcement, Company, LLMModels, Conversation, Prompt, Feedback, PromptMetric
|
||||
|
||||
# Register your models here.
|
||||
|
||||
|
||||
class AnnouncmentAdmin(admin.ModelAdmin):
|
||||
model = Announcement
|
||||
|
||||
|
||||
class CompanyAdmin(admin.ModelAdmin):
|
||||
model = Company
|
||||
|
||||
|
||||
class CustomUserAdmin(admin.ModelAdmin):
|
||||
model = CustomUser
|
||||
list_display = (
|
||||
"email",
|
||||
"username",
|
||||
"is_company_manager",
|
||||
"first_name",
|
||||
"last_name",
|
||||
"is_active",
|
||||
"is_staff",
|
||||
"has_usable_password",
|
||||
"deleted",
|
||||
"has_signed_tos",
|
||||
"last_login",
|
||||
"slug",
|
||||
"get_set_password_url"
|
||||
)
|
||||
search_fields = ("fields", "username", "first_name", "last_name", "slug")
|
||||
|
||||
class FeedbackAdmin(admin.ModelAdmin):
|
||||
model = Feedback
|
||||
search_fields = ("status", "text", "get_user_email")
|
||||
list_display= (
|
||||
"status", "get_user_email", "title", "category"
|
||||
)
|
||||
|
||||
class LLMModelsAdmin(admin.ModelAdmin):
|
||||
model = LLMModels
|
||||
list_display = ("name", "port", "description")
|
||||
search_fields = ("name", "port", "description")
|
||||
|
||||
|
||||
class ConversationAdmin(admin.ModelAdmin):
|
||||
model = Conversation
|
||||
list_display = ("title", "get_user_email","deleted")
|
||||
search_fields = ("title",)
|
||||
|
||||
|
||||
class PromptAdmin(admin.ModelAdmin):
|
||||
model = Prompt
|
||||
list_display = ("message", "user_created", "get_conversation_title")
|
||||
search_fields = ("message",)
|
||||
|
||||
class PromptMetricAdmin(admin.ModelAdmin):
|
||||
model = PromptMetric
|
||||
list_display = ("event", "model_name", "prompt_length","reponse_length",'has_file','file_type', "get_duration")
|
||||
|
||||
|
||||
admin.site.register(Announcement, AnnouncmentAdmin)
|
||||
admin.site.register(Company, CompanyAdmin)
|
||||
admin.site.register(CustomUser, CustomUserAdmin)
|
||||
|
||||
admin.site.register(LLMModels, LLMModelsAdmin)
|
||||
admin.site.register(Conversation, ConversationAdmin)
|
||||
admin.site.register(Prompt, PromptAdmin)
|
||||
admin.site.register(PromptMetric, PromptMetricAdmin)
|
||||
admin.site.register(Feedback, FeedbackAdmin)
|
||||
Reference in New Issue
Block a user