Re: Django Urls object_id/xxxxxx/object_id

2007-04-22 Thread Michael Trier
Great blog post. Michael On 4/20/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Fri, 2007-04-20 at 22:26 +0100, Oliver Charles wrote: > > Just write your own view that in turn calls a generic view? Create a new > > view, with a similiar signiture, but change the object_id for team_id >

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread Malcolm Tredinnick
On Fri, 2007-04-20 at 22:26 +0100, Oliver Charles wrote: > Just write your own view that in turn calls a generic view? Create a new > view, with a similiar signiture, but change the object_id for team_id > AND result_id. Then, do a bit of logic to find the query set you need a > view of, and pa

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread Karen Tracey
On 4/20/07, DuncanM <[EMAIL PROTECTED]> wrote: > > (r'^team/(?P[0-9]+)/results/(?P[0-9]+)/$', > 'django.views.generic.list_detail.object_detail', dict(results_dict, > template_name='teams/team_results_reports.html') > > doesn't work for me... Uh, yeah, it wouldn't would it? Sorry, about that.

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread Jeremy Dunck
On 4/20/07, DuncanM <[EMAIL PROTECTED]> wrote: > > Hi Karen, > > (r'^team/(?P[0-9]+)/results/(?P[0-9]+)/$', > 'django.views.generic.list_detail.object_detail', dict(results_dict, > template_name='teams/team_results_reports.html') FWIW, django views are pretty simple to do yourself, and you can st

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread DuncanM
Hi Karen, (r'^team/(?P[0-9]+)/results/(?P[0-9]+)/$', 'django.views.generic.list_detail.object_detail', dict(results_dict, template_name='teams/team_results_reports.html') doesn't work for me, but I've been thinking about your post, and you were right about me wanting to leave breadcrumbs (why co

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread Karen Tracey
Do you really need the team_id to specify the result you are looking for? I'm guessing you probably have a single results table (with results from all teams), and the 2nd number in the url is all you need to select the result in question. Then: (r'^team/(?P[0-9]+)/results/(?P[0-9]+)/$', 'django.v

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread Oliver Charles
Just write your own view that in turn calls a generic view? Create a new view, with a similiar signiture, but change the object_id for team_id AND result_id. Then, do a bit of logic to find the query set you need a view of, and pass this through to a generic view, and then return this. Hope th

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread DuncanM
Thanks for the help Tim, however I've tried that and it doesn't work : ( Is there any other way you could think of achieving it, even if it doesn't use generic views and urls? Thanks, Duncan --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread Tim Chase
> (r'^team/(?P[0-9]+)/results/(?P[0-9]+)/$', > 'django.views.generic.list_detail.object_detail', dict(results_dict, > template_name='teams/team_results_reports.html')), > > the bottom Url is totally wrong I just had a stab in the dark (a > rather poor one at that) but it was attempting to il

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread DuncanM
Firstly: there are many teams, each team can have many results. so obviously you'd need an id for the result id as well not just team/ 1/results/detail. Sorry it was a bad example in the previous post, it could be team/3/ results/5/ or team/10/results/522 (i.e. the team and results numbers aren

Re: Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread Jeremy Dunck
On 4/20/07, DuncanM <[EMAIL PROTECTED]> wrote: > I'm stuck when trying to do: > team//results/ > which I'd like to return a page that gives the detail of a result. Sorry, this isn't clear to me. You're saying something like team/1/results/1/? If so, why repeat the 1? Why not team/1/results/deta

Django Urls object_id/xxxxxx/object_id

2007-04-20 Thread DuncanM
Hi, I have looked at the django docs and couldn't find anything exactly related to what I want to do. I have my urls set up currently so: team/ returns a page for that team team//results returns a results page for that team I'm stuck when trying to do: team//results/ which I'd like to return