Example #1
0
def get_people():
    for contact in Contact.objects.filter(supply_point__type__code=SupplyPointCodes.FACILITY):
        print contact.supply_point.supplypointstatus_set.all()
        if not contact.supply_point.supplypointstatus_set.filter\
                (status_type=SupplyPointStatusTypes.SUPERVISION_FACILITY,
                 status_date__gte=get_facility_cutoff()).exists():
            yield contact
Example #2
0
def get_people():
    for contact in Contact.objects.filter(
            supply_point__type__code=SupplyPointCodes.FACILITY):
        print contact.supply_point.supplypointstatus_set.all()
        if not contact.supply_point.supplypointstatus_set.filter\
                (status_type=SupplyPointStatusTypes.SUPERVISION_FACILITY,
                 status_date__gte=get_facility_cutoff()).exists():
            yield contact
Example #3
0
def construct_randr_summary(supply_point):
    children = supply_point.children().filter(groups__code=DeliveryGroups().current_submitting_group())
    # assumes being run in the same month we care about.
    cutoff = randr.get_facility_cutoff()
    return _construct_status_dict(SupplyPointStatusTypes.R_AND_R_FACILITY,
                                  [SupplyPointStatusValues.SUBMITTED, 
                                   SupplyPointStatusValues.NOT_SUBMITTED],
                                  children, DateSpan(cutoff, datetime.utcnow()))
Example #4
0
def construct_randr_summary(supply_point):
    children = supply_point.children().filter(
        groups__code=DeliveryGroups().current_submitting_group())
    # assumes being run in the same month we care about.
    cutoff = randr.get_facility_cutoff()
    return _construct_status_dict(SupplyPointStatusTypes.R_AND_R_FACILITY, [
        SupplyPointStatusValues.SUBMITTED,
        SupplyPointStatusValues.NOT_SUBMITTED
    ], children, DateSpan(cutoff, datetime.utcnow()))