[openstack-dev] horizon url namespace question
Gabriel Hurley
Gabriel.Hurley at nebula.com
Thu Oct 25 19:16:52 UTC 2012
It's much easier to review these sorts of changes and help debug them if the branch/patch is posted to either github or gerrit. That way we can look at it in context, see the whole change, and even pull it down and try it out locally to see what's amiss.
So, if you're able to post the code (even if it's not completely finished) that'd help a lot.
- Gabriel
> -----Original Message-----
> From: Bhandaru, Malini K [mailto:malini.k.bhandaru at intel.com]
> Sent: Monday, October 22, 2012 4:32 PM
> To: OpenStack Development Mailing List [openstack-
> dev at lists.openstack.org]
> Subject: [openstack-dev] horizon url namespace question
>
> Hello All!
>
> I am trying to introduce a namespace to keep url patterns clean ..
>
>
> __________________________________________________________
> _____
> ../admin/flavors/urls.py
>
> __________________________________________________________
> _____
>
> from django.conf.urls.defaults import patterns, url, include from .views
> import IndexView, CreateView, EditView from .extras import urls as
> extras_urls
>
>
> urlpatterns =
> patterns('openstack_dashboard.dashboards.admin.flavors.views',
> url(r'^$', IndexView.as_view(), name='index'),
> url(r'^create/$', CreateView.as_view(), name='create'),
> url(r'^(?P<id>[^/]+)/edit/$', EditView.as_view(), name='edit'),
> url(r'^(?P<id>[^/]+)/extras/', include(extras_urls, namespace='extras'))
>
> __________________________________________________________
> _____
>
> ../admin/flavors/extras/urls.py
> __________________________________________________________
> _____
>
> from django.conf.urls.defaults import patterns, url from .views import
> IndexView, CreateView, EditView
>
> urlpatterns = patterns('',
> url(r'^$', IndexView.as_view(), name='extras'),
> url(r'^create/$', CreateView.as_view(), name='create'),
> url(r'(?P<key>[^/]+)/edit/$', EditView.as_view(), name='edit')
> )
> __________________________________________________________
> ________
> However in the flavors table page the edit url comes out OK, but not the
> view extra specs link, it shows up as horizon:admin:flavors:extras.
>
> Not sure what I am missing .. it is as if the extras namespace is not being
> recognized.
>
>
> <div class="btn-group"><a href='/admin/flavors/1/edit/<view-
> source:http://localhost:8000/admin/flavors/1/edit/>'
> id="flavors__row_1__action_edit" class="btn btn-small ajax-modal btn-
> edit">Edit Flavor</a><a class="btn dropdown-toggle ajax-modal btn-edit"
> data-toggle="dropdown" href="#<view-
> source:http://localhost:8000/admin/flavors/#>"><span
> class="caret"></span></a><ul class="dropdown-menu row_actions
> clearfix"><li class="clearfix"> <a href='horizon:admin:flavors:extras'
> id="flavors__row_1__action_extras" class="btn btn-small b t n - e d i
> t">View Extra Specs</a></li><li class="clearfix"> <button
> id="flavors__row_1__action_delete" class="btn btn-small btn-danger btn-
> delete" name="action" value="flavors__delete__1" type="submit">Delete
> Flavor</button></li></ul></div> </td> </tr>
>
>
>
> Thanks
> Malini
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
More information about the OpenStack-dev
mailing list