Re: URL & DB question

2009-08-02 Thread Rob B
Well it works a treat so big thanks. 2009/8/2 Chris Withers > > Rob B wrote: > > Great I didn't know about that one. I'm curious to what are the > > benefits of doing it that are? > > Less code for you to write and maintain :-) > > Chris > > -- > Simplistix - Content

Re: URL & DB question

2009-08-02 Thread Chris Withers
Rob B wrote: > Great I didn't know about that one. I'm curious to what are the > benefits of doing it that are? Less code for you to write and maintain :-) Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk

Re: URL & DB question

2009-08-02 Thread Rob B
Great I didn't know about that one. I'm curious to what are the benefits of doing it that are? Thanks 2009/8/2 Chris Withers > > Rob B (uk) wrote: > > Solved it by doing this: > > > > def profile_detail(request, name): > > p = get_object_or_404(Profile, name=name)

Re: URL & DB question

2009-08-02 Thread Chris Withers
Rob B (uk) wrote: > Solved it by doing this: > > def profile_detail(request, name): > p = get_object_or_404(Profile, name=name) > return render_to_response('profile_detail.html', {'name': p}) How about using the detail generic view: from django.views.generic.list_detail import

Re: URL & DB question

2009-08-01 Thread Rob B (uk)
Solved it by doing this: def profile_detail(request, name): p = get_object_or_404(Profile, name=name) return render_to_response('profile_detail.html', {'name': p}) On 1 Aug, 12:22, "Rob B (uk)" wrote: > Using the url to look up a user profile just not sure

URL & DB question

2009-08-01 Thread Rob B (uk)
Using the url to look up a user profile just not sure what to put in the view. Any suggestions welcome. Model: class Profile(models.Model): title = models.ForeignKey(User, unique=True) name = models.CharField(max_length=50, null=False, blank=False) def __unicode__(self):