Пример #1
0
    def _create_export(xform, export_type, options):
        export_options = {
            key: get_boolean_value(value, default=True)
            for key, value in options.iteritems()
            if key in Export.EXPORT_OPTION_FIELDS
        }

        return Export.objects.create(xform=xform,
                                     export_type=export_type,
                                     options=export_options)
Пример #2
0
    def _create_export(xform, export_type, options):
        export_options = {
            key: get_boolean_value(value, default=True)
            for (key, value) in iteritems(options)
            if key in Export.EXPORT_OPTION_FIELDS
        }
        if query and 'query' not in export_options:
            export_options['query'] = query

        return Export.objects.create(
            xform=xform, export_type=export_type, options=export_options)
Пример #3
0
    def _create_export(xform, export_type, options):
        export_options = {
            key: get_boolean_value(value, default=True)
            for (key, value) in iteritems(options)
            if key in Export.EXPORT_OPTION_FIELDS
        }
        if query and 'query' not in export_options:
            export_options['query'] = query

        return Export.objects.create(
            xform=xform, export_type=export_type, options=export_options)
Пример #4
0
    def _create_export(xform, export_type, options):
        export_options = {
            key: get_boolean_value(value, default=True)
            for key, value in options.iteritems()
            if key in Export.EXPORT_OPTION_FIELDS
        }

        if EXPORT_QUERY_KEY in export_options:
            query_str = '{}'.format(export_options[EXPORT_QUERY_KEY])

            export_options[EXPORT_QUERY_KEY] \
                = hashlib.md5(query_str).hexdigest()

        return Export.objects.create(
            xform=xform, export_type=export_type, options=export_options)