Friday, March 8, 2013

Urls on the fly

I am looking the way to create urls on the fly.
This is a simplified version of the code I am using:

def get_urls():
    url_list = []
    for code in external_code_list:
        url_list.append(
            url(r'^%s/$' % code,
            view
            )
        )
    urlpatterns = patterns('', url_list)
    return urlpatterns


urlpatterns = get_urls()

It throws "url() takes at least 2 arguments (2 given)"

Any idea?

Thanks

--
Serge G. Spaolonzi
Cobalys Systems

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate