def dd_for_params(id_string, owner, request):
    start = end = None
    dd = DataDictionary.objects.get(id_string__exact=id_string,
                                    user=owner)
    if request.GET.get('start'):
        try:
            start = encode(request.GET['start'])
        except __HOLE__:
            # bad format
            return [False,
                    HttpResponseBadRequest(
                        _(u'Start time format must be YY_MM_DD_hh_mm_ss'))
                    ]
    if request.GET.get('end'):
        try:
            end = encode(request.GET['end'])
        except ValueError:
            # bad format
            return [False,
                    HttpResponseBadRequest(
                        _(u'End time format must be YY_MM_DD_hh_mm_ss'))
                    ]
    if start or end:
        dd.instances_for_export = instances_for_export(dd, start, end)

    return [True, dd]
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/apps/viewer/views.py/dd_for_params