0

The error is this

"\t(r'ajax/lookup/^$','ajaxlookup',name='ajax_lookup'),\n"))

I have installed geonode and in that I have put ajax_select to do autocomplete. But my URLs.py is giving an error

My urls.py looks like this

from django.conf.urls.defaults import patterns, url

js_info_dict = {
    'packages': ('geonode.maps',),
}

    urlpatterns = patterns('geonode.maps.views',
        (r'^$', 'maps'),
        url(r'^new$', 'newmap', name="map_new"),
        (r'^(?P<mapid>\d+)$', 'map_controller'),
        (r'^(?P<mapid>\d+)/view$', 'view'),
        (r'^(?P<mapid>\d+)/download/$', 'map_download'),
        (r'^check/$', 'check_download'),
        (r'^embed/$', 'embed'),
        (r'^(?P<mapid>\d+)/embed$', 'embed'),
        (r'^(?P<mapid>\d+)/data$', 'mapJSON'),
        url(r'^search/?$', 'maps_search_page', name='maps_search'),
        url(r'^search/api/?$', 'maps_search', name='maps_search_api'),
        url(r'^(?P<mapid>\d+)/ajax-permissions$', 'ajax_map_permissions', name='ajax_map_permissions'),
        url(r'^change-poc/(?P<ids>\w+)$', 'change_poc', name="change_poc"),
        url(r'^search/$', 'maps_search', name='maps_search'),

    )

    urlpatterns += patterns('geonode.ajax_select.views',
        (r'ajax/lookup/^$','ajaxlookup',name='ajax_lookup'),
    )

My templates in the html file looks like this

    <script type="text/javascript">
        Ext.onReady(function(){
           {% autoescape off %}

            var searchTable = new GeoNode.MapSearchTable({
                renderTo: 'search_results',
                trackSelection: true,
                permalinkURL: '{% url ajax_lookup %}',
                searchURL: '{% url ajax_lookup %}',
                searchParams: {{init_search}}
            });
        {% endautoescape %}
    });

</script>

And my ajax_lookup looks like this

2 Answers 2

2

Tuples do not support keyword arguments. Convert the entry to a url() call.

Sign up to request clarification or add additional context in comments.

8 Comments

Can you give us the whole syntax
url(r'ajax/lookup/^$','ajaxlookup',name='ajax_lookup'),
After doing that I got an error saying this . Caught NoReverseMatch while rendering:
That doesn't mean my answer is wrong, that just means that you have another problem.
That might be because your regex makes little sense. Try r'^ajax/lookup$' instead?
|
0

it should be:

urlpatterns += patterns('geonode.ajax_select.views',
        (r'^ajax/lookup/$','ajaxlookup',name='ajax_lookup'),
    )

the "^" was at the end :)

7 Comments

While this is true, that will cause a logic error, not a syntax error.
combine the two answers -- like I said in my comment at Ignacio Vazquez-Abrams's answer below :)
How does the error look like? Is it "Caught NoReverseMatch while rendering" ?
No, the "^" was pointing at the '=' sign after the word 'name'. See Ignacio's answer.
it probable doesn't like the $ an the end. Maybe the url pattern name is beeing used wrong in the template? How does it look the template? More context :)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.