[openstack-dev] horizon url namespace question

Bhandaru, Malini K malini.k.bhandaru at intel.com
Thu Nov 1 01:33:10 UTC 2012


Would you please take a look at this patch and help with making the "extras" namespace work 
The link to view a flavors extra specs comes across as "horizon:admin:flavors:extras" as opposed to "admin/flavors/<flavor-id>/extras/"

I did go through Django's url name space doc but still stuck.
Much thanks
Malini

________________________________________
From: Gabriel Hurley [Gabriel.Hurley at nebula.com]
Sent: Thursday, October 25, 2012 3:16 PM
To: OpenStack Development Mailing List
Subject: Re: [openstack-dev] horizon url namespace question

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



_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extras_namespace.patch
Type: text/x-patch
Size: 25106 bytes
Desc: extras_namespace.patch
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121101/83a2da8d/attachment-0001.bin>


More information about the OpenStack-dev mailing list