On Apr 23, 9:00 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> Complex Q-object combinations on trunk do have a few problems (bugs). It
> turns out to be quite hard to get all the combinations working
> correctly. This is one of the areas that development of the
> queryset-refactor branch has devoted a lot of time to fixing, so things
> will improve in trunk very soon (or you can try out your code on the
> branch).
Thanks, Malcolm. I want some features from queryset_refactor and some
from newforms_admin, but none of them urgently (yet), so I think I'll
work around the bug and wait.
Looks like this is working in *most* cases (see below), and maybe
simpler anyway:
part1 = InventoryItem.objects.filter(product=self,
onhand__gt=0)
part2 = InventoryItem.objects.filter(product=self,
inventory_date__range=(weekstart, thisdate),
planned__gt=0, onhand__exact=0, received__exact=0)
return itertools.chain(part1, part2)
The itertools.chain works fine in situations where I just iterate thru
the items. But in one case, I really need to return a queryset.
(Tried turning the chain into a plain list, that did not work.)
I'm experimenting (so far without success) with a bunch of ways to try
to turn a chain into a queryset. If anybody has any tips, I will be
grateful.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---