Here it goes:

I wanted a clean url structure so i tried to abstract as much as i
could in one url pattern. it looks something like this:

url(r'^approved/((?P<country>[a-zA-Z ,-]+)?)(/?)((?P<page>[0-9]+)?)(/?)
$', get_approved_images, name='approved_images')

this in theory should allow the return of
1) all images - /approved/
2) pagination options for all images - /approved/2/
3) images from a specific country - /approved/china/
4) pagination for countries - /approved/china/3/

this works fine, but when trying to resolve the url with no page or
country there are problems i.e.

{% url approved_images %}

i thought as there can be 0 or 1 of both country and page as specified
in the url pattern there shouldn't be a problem, however it doesn't
seem that way. I haven't looked inside the code as i have higher
priority things to do at present, but if anyone could help with a
solution or a reason why it doesn't work that would be appreciated, if
not i suggest a patch as it makes sense that allowing url's to match a
particular pattern should also mean that any url that matches that
pattern should be resolvable :-)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to