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
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
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)
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
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
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):
6 matches
Mail list logo