Jet fork des offiziellen jet-admin projekts. Geupdated für Django4.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

47 lignes
1.1KB

  1. import django
  2. from django.urls import re_path as url
  3. try:
  4. from django.views.i18n import JavaScriptCatalog
  5. javascript_catalog = JavaScriptCatalog.as_view()
  6. except ImportError: # Django < 2.0
  7. from django.views.i18n import javascript_catalog
  8. from jet.views import add_bookmark_view, remove_bookmark_view, toggle_application_pin_view, model_lookup_view
  9. app_name = 'jet'
  10. urlpatterns = [
  11. url(
  12. r'^add_bookmark/$',
  13. add_bookmark_view,
  14. name='add_bookmark'
  15. ),
  16. url(
  17. r'^remove_bookmark/$',
  18. remove_bookmark_view,
  19. name='remove_bookmark'
  20. ),
  21. url(
  22. r'^toggle_application_pin/$',
  23. toggle_application_pin_view,
  24. name='toggle_application_pin'
  25. ),
  26. url(
  27. r'^model_lookup/$',
  28. model_lookup_view,
  29. name='model_lookup'
  30. ),
  31. url(
  32. r'^jsi18n/$',
  33. javascript_catalog,
  34. {'packages': 'django.contrib.admin+jet'},
  35. name='jsi18n'
  36. ),
  37. ]
  38. if django.VERSION[:2] < (1, 8):
  39. from django.conf.urls import patterns
  40. urlpatterns = patterns('', *urlpatterns)