Created
March 23, 2014 21:05
-
-
Save fadur/9729828 to your computer and use it in GitHub Desktop.
filter orders,.. i want any filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tryk(self): | |
"""Orders that need print""" | |
initial = {'cms_status': 1, 'status': 1} | |
query = self.filter(**initial) | |
items = query.select_related('item_set__product', 'item_set').filter( | |
item_set__product__varetype_id=9, | |
item_set__product__delivery_id__in=(1,6) | |
).filter(Q( | |
~Q(item_set__player_flag__in = ['0', ''])| | |
~Q(item_set__number= '' )| | |
~Q(item_set__name = ''))| | |
Q(item_set__product__fortryk=True)).distinct() | |
return items |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment