documents.py 808 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. from django.contrib import admin
  2. from dbsynce.models import Documents, DocumentFile
  3. class DocumentFileInline(admin.TabularInline):
  4. model = DocumentFile
  5. extra = 1
  6. fields = ('file',)
  7. can_delete = True
  8. @admin.register(Documents)
  9. class DocumentsAdmin(admin.ModelAdmin):
  10. list_display = (
  11. 'id',
  12. 'check_date',
  13. 'check_level',
  14. 'expire_date',
  15. 'id_metaservice',
  16. 'requirements',
  17. 'status',
  18. 'ticket_status',
  19. 'doc_type',
  20. 'user_id',
  21. 'company_id',
  22. 'is_global',
  23. 'is_visible',
  24. 'checked_by',
  25. )
  26. list_filter = (
  27. 'check_date',
  28. 'expire_date',
  29. 'ticket_status',
  30. 'user_id',
  31. 'company_id',
  32. 'checked_by',
  33. )
  34. inlines = [DocumentFileInline]