Skip to content

Commit

Permalink
refactor: integrate apis_entities.apis_urls into [apis_entities.]urls
Browse files Browse the repository at this point in the history
There where three routes in a separate file included under the `/api2`
path - the `savenetworkfiles` endpoint was removed, the
`getorcreateentity` endpoint was moved to `apis_entities.urls` and the
`/entity/<int:pk>` endpoint was moved to the main apis `urls.py`

Closes: #266
Closes: #379
  • Loading branch information
b1rger committed Nov 21, 2023
1 parent fe8f46b commit 2937dc2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
22 changes: 0 additions & 22 deletions apis_core/apis_entities/api_urls.py

This file was deleted.

6 changes: 6 additions & 0 deletions apis_core/apis_entities/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

# from .views import ReversionCompareView TODO: add again when import is fixed
from .edit_generic import GenericEntitiesCreateStanbolView
from .api_views import GetOrCreateEntity

app_name = "apis_entities"

Expand Down Expand Up @@ -103,4 +104,9 @@
# r'^compare/(?P<app>[a-z_]+)/(?P<kind>[a-z]+)/(?P<pk>\d+)$', ReversionCompareView.as_view()
# ),
path("merge-objects/", merge_views.merge_objects, name="merge_objects"),
path(
"getorcreateentity/",
GetOrCreateEntity.as_view(),
name="GetOrCreateEntity",
),
]
9 changes: 8 additions & 1 deletion apis_core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def build_apis_mock_request(method, path, view, original_request, **kwargs):
return request


from apis_core.apis_entities.api_views import GetEntityGeneric


urlpatterns = [
path("", TemplateView.as_view(template_name="base.html"), name="apis_index"),
path("admin/", admin.site.urls),
Expand Down Expand Up @@ -149,7 +152,6 @@ def build_apis_mock_request(method, path, view, original_request, **kwargs):
# description="APIS API schema definition",
# urlconf='apis_core.apis_entities.api_urls',
# ), name='openapi-schema-api'),
path("api2/", include("apis_core.apis_entities.api_urls", namespace="apis_api2")),
path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
# url(r'^api-schema/', schema_view),
re_path(
Expand All @@ -160,6 +162,11 @@ def build_apis_mock_request(method, path, view, original_request, **kwargs):
),
# url(r'^docs/', include('sphinxdoc.urls')),
# url(r'^accounts/', include('registration.backends.simple.urls')),
path(
"entity/<int:pk>/",
GetEntityGeneric.as_view(),
name="GetEntityGeneric",
),
]

if "apis_fulltext_download" in settings.INSTALLED_APPS:
Expand Down

0 comments on commit 2937dc2

Please sign in to comment.