Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Kurek committed Dec 30, 2016
1 parent 878a49b commit be61fb7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/ralph/lib/custom_fields/tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class SomeModel(WithCustomFieldsMixin, models.Model):

def get_absolute_url(self):
return reverse(
'admin:{}_{}_change'.format(
'cf_admin:{}_{}_change'.format(
self._meta.app_label, self._meta.model_name
), args=(self.pk,)
)

@classmethod
def get_add_url(self):
return reverse('admin:{}_{}_add'.format(
return reverse('cf_admin:{}_{}_add'.format(
self._meta.app_label, self._meta.model_name
))
4 changes: 1 addition & 3 deletions src/ralph/lib/custom_fields/tests/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

from . import admin, api

cf_tests_urls, cf_tests_app_name, cf_tests_namespace = admin.site.urls
import ipdb; ipdb.set_trace()
urlpatterns = [
url(r'^cf_tests_admin/', include((cf_tests_urls, 'ralph', 'admin'))),
url(r'^cf_tests_admin/', include(admin.site.urls)),
url(r'^cf_test_api/', include(api.urlpatterns))
]
10 changes: 8 additions & 2 deletions src/ralph/urls/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
# api views are registered in router)
api_urls += [url(r'^', include(router.urls))]

ralph_urls, ralph_app_name, ralph_namespace = admin.urls
urlpatterns = [
# override app_name (admin) with ralph (mainly for sitetree)
url(r'^', include((ralph_urls, 'ralph', ralph_namespace))),
url(r'^', include(admin.urls)),
url(r'^api/', include(api_urls)),
url(r'^api-token-auth/', views.obtain_auth_token),
url(r'^', include('ralph.dc_view.urls.ui')),
Expand All @@ -48,3 +47,10 @@

if getattr(settings, 'ENABLE_HERMES_INTEGRATION', False):
urlpatterns += url(r'^hermes/', include('pyhermes.apps.django.urls')),


# monkey patch for sitetree until
# https://github.com/idlesign/django-sitetree/issues/226 will be discussed
# and resolved
from sitetree.sitetreeapp import SiteTree # noqa
SiteTree.current_app_is_admin = lambda self: False

0 comments on commit be61fb7

Please sign in to comment.