Re: Strange difference between runserver and shell

2010-03-12 Thread Roald de Vries
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

Re: Strange difference between runserver and shell

2010-03-11 Thread Andy McKay
> 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

Re: Strange difference between runserver and shell

2010-03-11 Thread GJCGJC
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

Re: Strange difference between runserver and shell

2010-03-11 Thread Andy McKay
> 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

Strange difference between runserver and shell

2010-03-11 Thread python
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: