2
0

admin.py 1.0 KB

12345678910111213141516171819202122232425262728
  1. from django.contrib import admin
  2. from apps.loon_model_base_admin import LoonModelBaseAdmin
  3. from apps.ticket.models import TicketRecord, TicketFlowLog, TicketCustomField
  4. # Register your models here.
  5. class TicketRecordAdmin(LoonModelBaseAdmin):
  6. search_fields = ('sn', 'title')
  7. list_display = ('id', 'sn', 'title', 'workflow_id', 'state_id', 'parent_ticket_id', 'participant_type_id', 'participant') + LoonModelBaseAdmin.list_display
  8. class TicketFlowLogAdmin(LoonModelBaseAdmin):
  9. search_fields = ('ticket_id',)
  10. list_display = ('id', 'ticket_id', 'transition_id', 'suggestion', 'participant_type_id', 'participant', 'state_id') + LoonModelBaseAdmin.list_display
  11. class TicketCustomFieldAdmin(LoonModelBaseAdmin):
  12. search_fields = ('name',)
  13. list_display = ('id', 'ticket_id', 'name', 'field_key') + LoonModelBaseAdmin.list_display
  14. admin.site.register(TicketRecord, TicketRecordAdmin)
  15. admin.site.register(TicketFlowLog, TicketFlowLogAdmin)
  16. admin.site.register(TicketCustomField, TicketCustomFieldAdmin)