Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CMSApp discards extra options passed in through urls.py #1678

Closed
jrief opened this Issue · 7 comments

3 participants

@jrief

I want to attach the same app on two different menu items, using the same view with different extra options in different namespaces. But doing so, the extra options are discarded.

How to reproduce:

The CMSApp cms_app.py:

class MenuItemInst1(CMSApp):
    name = 'Instance 1'
    urls = ['myapp.urls.inst1']
apphook_pool.register(MenuItemInst1)

loads the file myapp.urls.inst1.py:

urlpatterns = patterns('',
    url(r'^', include('myapp.urls.the_app', namespace='inst1'),
        {'opts': 'someopts'}),
)

which itself includes myapp.urls.the_app.py:

urlpatterns = patterns('',
    url(r'^$', TheAppView.as_view(), name='the_list'),
)

Now, one would assume that the TheAppView.get()-method would receive the extra options in its kwargargument, which however are missing there.

On the other side, if I include the above patterns to my main urls.py:

urlpatterns = patterns('',
    ...
    url(r'^foo/', include('myapp.urls.inst1')),
    ...
)

and crosscheck calling URL /foo/, the kwarg-argument in method TheAppView.get() receives an entry opts, just as expected.

@stefanfoulis

related to #1502 #1669

@digi604
Collaborator

ist this 2.3.x or 2.4?

@jrief

django-cms 2.3.4

@digi604
Collaborator

@jrief could you test if this breaks with current develop as well?

@jrief

In commit 54e9023 where is file cms/settings.py ?

@jrief

@digi604 I can't setup my env to work with the current devel branch. Can you please point me onto to commits which aim to fix this, so that I can cherry-pick them.

@digi604
Collaborator

well this was quite a refactoring... we removed the MultilingualMiddleware and replaced it with standard django i18n urls.

have a look here:

4b968ce

@digi604 digi604 referenced this issue from a commit in digi604/django-cms
@digi604 digi604 fixes #1678 ed21c1b
@digi604 digi604 referenced this issue
Merged

Apphook fixes #1928

4 of 4 tasks complete
@digi604 digi604 closed this in #1928
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.