Re: problems with url tag

2008-03-06 Thread msoulier

On Mar 5, 6:50 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> In the meantime, use the url(...) form for your url patterns and give
> each one that might cause confusion a unique name. That way you can
> refer to them uniquely in the {% url ... %} tag.

Ok, I'll do that when the next Django release is out, or I'll package
the trunk from SVN. The latter would make my coworkers nervous.

Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problems with url tag

2008-03-05 Thread Malcolm Tredinnick


On Tue, 2008-03-04 at 18:30 -0800, msoulier wrote:
> So, my urlconf is
> 
> urlpatterns = patterns('teleworker.clients.views',
> (r'create/$', 'create'),
> (r'modify/(?P\d+)/$', 'modify'),
> (r'delete/(?P\d+)/$', 'delete'),
> (r'page/(?P\d+)/(?P\w+)/(?P\w+)/$',
> 'list'),
> (r'page/(?P\d+)/$', 'list'),
> (r'^$', 'list'),
> )
> 
> The list function is
> 
> def list(request, page=1, orderby='clientid', direction='forward',
> filter=None):
> 
> When I try to use the url tag to get a url to this function, it only
> matches the last line of the urlconf.
> 
> {% url teleworker.clients.views.list
> page=1,orderby=clientid,direction=forward %}

It's a slight bug in the reverse resolving system when their are
non-unique matches. Ideally, it should have picked up the more specific
match and/or match nothing if you pass in too many parameters. However,
both of those are quite fiddly to introduce and keep the code simple.
I'm slowly working on fixing this on my local machine, but it's not
there yet.

In the meantime, use the url(...) form for your url patterns and give
each one that might cause confusion a unique name. That way you can
refer to them uniquely in the {% url ... %} tag.

Regards,
Malcolm

-- 
The hardness of butter is directly proportional to the softness of the
bread. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problems with url tag

2008-03-05 Thread Pete Crosier

More than one match for one {% url view args %} doesn't sound right,
you can name your patterns to clear up any ambiguity -
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns

On Mar 5, 2:30 am, msoulier <[EMAIL PROTECTED]> wrote:
> So, my urlconf is
>
> urlpatterns = patterns('teleworker.clients.views',
>     (r'create/$', 'create'),
>     (r'modify/(?P\d+)/$', 'modify'),
>     (r'delete/(?P\d+)/$', 'delete'),
>     (r'page/(?P\d+)/(?P\w+)/(?P\w+)/$',
> 'list'),
>     (r'page/(?P\d+)/$', 'list'),
>     (r'^$', 'list'),
> )
>
> The list function is
>
> def list(request, page=1, orderby='clientid', direction='forward',
> filter=None):
>
> When I try to use the url tag to get a url to this function, it only
> matches the last line of the urlconf.
>
> {% url teleworker.clients.views.list
> page=1,orderby=clientid,direction=forward %}
>
> What am I missing?
>
> Thanks,
> Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



problems with url tag

2008-03-04 Thread msoulier

So, my urlconf is

urlpatterns = patterns('teleworker.clients.views',
(r'create/$', 'create'),
(r'modify/(?P\d+)/$', 'modify'),
(r'delete/(?P\d+)/$', 'delete'),
(r'page/(?P\d+)/(?P\w+)/(?P\w+)/$',
'list'),
(r'page/(?P\d+)/$', 'list'),
(r'^$', 'list'),
)

The list function is

def list(request, page=1, orderby='clientid', direction='forward',
filter=None):

When I try to use the url tag to get a url to this function, it only
matches the last line of the urlconf.

{% url teleworker.clients.views.list
page=1,orderby=clientid,direction=forward %}

What am I missing?

Thanks,
Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---