Korotkodul

django myAdmin перечОл

Jan 18th, 2022 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. from django.contrib import admin
  2. from .models import University
  3. from .models import olympiads
  4.  
  5. admin.site.register(University)
  6. admin.site.register(olympiads)
  7.  
  8. class UniversityAdmin(admin.ModelAdmin):
  9. list_display = ("id", "short_name", "country", "url")
  10. list_display_links = ("short_name",)
  11. list_filter = ("country",)
  12. search_fields = ("short_name", "country",)
  13.  
  14.  
  15. class olympiadsAdmin(admin.ModelAdmin):
  16. list_display = ("name","url")
  17. list_display_links = ("name")
  18. list_filter = ("name")
  19. search_fields = ("name")
  20.  
  21.  
Add Comment
Please, Sign In to add comment