Revision 5a0f9d6c snf-astakos-app/astakos/quotaholder_app/callpoint.py
b/snf-astakos-app/astakos/quotaholder_app/callpoint.py | ||
---|---|---|
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 | 34 |
from datetime import datetime |
35 |
from django.db.models import F
|
|
35 |
from django.db.models import Q
|
|
36 | 36 |
from astakos.quotaholder_app.exception import ( |
37 | 37 |
QuotaholderError, |
38 | 38 |
NoCommissionError, |
... | ... | |
51 | 51 |
return d.strftime('%Y-%m-%dT%H:%M:%S.%f')[:24] |
52 | 52 |
|
53 | 53 |
|
54 |
def get_quota(holders=None, sources=None, resources=None): |
|
55 |
holdings = Holding.objects.all() |
|
54 |
def get_quota(holders=None, sources=None, resources=None, flt=None): |
|
55 |
if flt is None: |
|
56 |
flt = Q() |
|
57 |
|
|
58 |
holdings = Holding.objects.filter(flt) |
|
56 | 59 |
|
57 | 60 |
if holders is not None: |
58 | 61 |
holdings = holdings.filter(holder__in=holders) |
Also available in: Unified diff