On Mar 11, 2010, at 11:56 AM, pyt...@roalddevries.nl wrote:
I have the following model:
1 class MyOrderItem(models.Model):
2 orderitem = models.ForeignKey(OrderItem, null=True,
blank=True)
3 # other fields
4
5 def save(self, *args, **kwargs):
6
> def writer_stories(request, writer):
># Look up the writer (and raise a 404 if it can't be found).
>written=get_object_or_404(Writer, slug__iexact=writer)
>return list_detail.object_list(
>request,
>queryset=Entry.live.filter(writer=written),
>template_name='ne
I think I may have a similar problem. Once I've imported my models
into the shell the following does exactly what I want it to:
In [10]: from django.shortcuts import get_object_or_404
In [11]: written=get_object_or_404(Writer, slug__iexact='joe-bloggs')
In [12]: queryset=Entry.live.filter(writer
> Does anybody have any clue what the problem might be? Thanks for your help!
There should be no difference really between the two. What might help us if you
show us the code that the runs from the shell and the code in the view.
--
Andy McKay, @clearwind
--
You received this message because
Dear all,
I have the following model:
1 class MyOrderItem(models.Model):
2 orderitem = models.ForeignKey(OrderItem, null=True, blank=True)
3 # other fields
4
5 def save(self, *args, **kwargs):
6 if self.orderitem and self.orderitem.order:
5 matches
Mail list logo