|
@@ -4,15 +4,15 @@ from djangotools.views.auto_path import AutoPathManager
|
|
|
from djangotools.views.router import Router
|
|
|
from django.contrib import admin
|
|
|
|
|
|
-class RouterIterator:
|
|
|
+class RouterIterator(list):
|
|
|
|
|
|
def __init__(self):
|
|
|
- self._cache = None
|
|
|
+ super().__init__()
|
|
|
|
|
|
def __iter__(self):
|
|
|
- if not self._cache:
|
|
|
- self._cache= [path('admin/', admin.site.urls)] + AutoPathManager.get_instance().get_pathes() + Router.get_pathes()
|
|
|
- return iter(self._cache)
|
|
|
+ if not len(self):
|
|
|
+ self.append([path('admin/', admin.site.urls)] + AutoPathManager.get_instance().get_pathes() + Router.get_pathes())
|
|
|
+ return super().__iter__()
|
|
|
|
|
|
|
|
|
urlpatterns = RouterIterator()
|