On Saturday 16 Feb 2008, Nils L wrote:
> Hi Tim,
> Contest.objects.filter(pk=pSerial) yields a list (in this case of
> length 1), not a Contest object. If you want to fetch a single object
> based on it's primary key you can use: Contest.objects.get(pk=pSerial)
> See http://www.djangoproject.com/d
Hi Tim,
Contest.objects.filter(pk=pSerial) yields a list (in this case of
length 1), not a Contest object. If you want to fetch a single object
based on it's primary key you can use: Contest.objects.get(pk=pSerial)
See http://www.djangoproject.com/documentation/tutorial01/
- Nils
--~--~-~
Hi Folks,
I'm sure I'm missing something here, can anyone enlighten me?
In my urls.py I have:
(r'^(\d+)/$', 'rtb2.contests.views.single_contest'),
and in my views.py I have
def single_contest(request, pSerial):
lContest = Contest.objects.filter(pk=pSerial)
return render_to_respons
3 matches
Mail list logo