[ckan-discuss] Extension example running error

Toby Dacre toby.okfn at gmail.com
Mon Jan 7 04:02:32 GMT 2013


On 6 January 2013 20:27, Yanning(Yu) Chen <cheny18 at rpi.edu> wrote:

> Hi,
>
> I just tried to add the example extension to ckan and give a test. However
> I run into this error after I installed and opened up the ckan service
> homepage:
>
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> File:
> /home/xxxxx/pyenv/src/ckan/ckanext/ckanext-example/ckanext/example/theme/templates/layout.html',
> line 12 in <Expression u"h.nav_link(c, _('Home'), controller='home',
> action='index')">
>   ${h.nav_link(c, _('Home'), controller='home', action='index')}
> TypeError: nav_link() got multiple values for keyword argument 'controller'
>

Hi,

The h.nav_link() function has been changed so that it no longer accepts the
c parameter.  If you change all occurences like

${h.nav_link(*c, *_('Home'), controller='home', action='index')}

to

${h.nav_link(_('Home'), controller='home', action='index')}

this will then work as expected we should update the example extension to
reflect this.

Toby


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> And when I look into the layout.html file, the code is:
>
>
> -------------------------------------------------------------------------------------------
> <html xmlns="http://www.w3.org/1999/xhtml"
>   xmlns:py="http://genshi.edgewall.org/"
>   xmlns:xi="http://www.w3.org/2001/XInclude"
>   xmlns:doap="http://usefulinc.com/ns/doap"
>   xmlns:foaf="http://xmlns.com/foaf/0.1/"
>   py:strip=""
>   >
>
> <!-- ! a custom primary nav -->
>   <py:match path="//div[@class='menu']">
>     <div class="menu">
>         ${h.nav_link(c, _('Home'), controller='home', action='index')}
>         ${h.nav_link(c, _('Data'), controller='package', action='search')}
>         ${h.nav_link(c, _('New dataset'), controller='package',
> action='new')}
>         ${h.nav_link(c, _('New group'), controller='group', action='new')}
>     </div>
>   </py:match>
>
> <!-- make a really big search box in the top bar -->
>   <py:match path="//div[@id='top-bar']/div[@class='search-form']">
>     <div class="search-form">
>         <form action="${url(controller='package', action='search')}"
> method="GET">
>           <input type="search" class="search" name="q" value=""
> autocomplete="off" results="5" placeholder="What are you looking for?"
>  id="bigsearch"  />
>           <input type="submit" class="searchbutton" value="search" />
>         </form>
>     </div>
>   </py:match>
>
>   <xi:include href="layout_base.html" />
> </html>
>
> ------------------------------------------------------------------------------------------
>
> I am a rookie in ckan and django framework...Any suggestions? Thanks!
>
> Regards
> Yu
>
>
> _______________________________________________
> ckan-discuss mailing list
> ckan-discuss at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-discuss
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-discuss/attachments/20130107/b5e98bc9/attachment.htm>


More information about the ckan-discuss mailing list