(user, startdate, enddate)
return ret
Returns a dictionary of messages seen for a given user, and date
    range of the format:
    {
        I: inbound_count,
        O: outbound_count
    }
Returns a dictionary of messages seen for a given user, and date
    range of the format:
    {
        I: inbound_count,
        O: outbound_count
    }
Returns a dictionary of messages seen for a given user and date range of the format : { I : inbound_count O : outbound_count }
def _sms_count(user, startdate, enddate):
    """
    Returns a dictionary of messages seen for a given user, and date
    range of the format:
    {
        I: inbound_count,
        O: outbound_count
    }
    """
    # utilizable if we want to stick it somewhere else
    direction_count = SMS.objects.filter(
        couch_recipient_doc_type=user.doc_type,
        couch_recipient=user._id,
        date__range=(startdate, enddate),
    ).values('direction').annotate(Count('direction'))
    ret = {INCOMING: 0, OUTGOING: 0}
    ret.update({d['direction']: d['direction__count'] for d in direction_count})
    return ret
def _sms_count ( user , startdate , enddate ) : # utilizable if we want to stick it somewhere else direction_count = SMS . objects . filter ( couch_recipient_doc_type = user . doc_type , couch_recipient = user . _id , date__range = ( startdate , enddate ) , ) . values ( 'direction' ) . annotate ( Count ( 'direction' ) ) ret = { INCOMING : 0 , OUTGOING : 0 } ret . update ( { d [ 'direction' ] : d [ 'direction__count' ] for d in direction_count } ) return ret