def __init__(self, request, domain, export_id=None, minimal=False): self.request = request self.domain = domain self.presave = False self.transform_dates = False self.creating_new_export = not bool(export_id) self.minimal = minimal if export_id: self.custom_export = self.ExportSchemaClass.get(export_id) # also update the schema to include potential new stuff self.custom_export.update_schema() # enable configuring saved exports from this page saved_group = HQGroupExportConfiguration.get_for_domain( self.domain) self.presave = export_id in saved_group.custom_export_ids self.export_stock = self.has_stock_column() try: assert self.custom_export.doc_type == 'SavedExportSchema', 'bad export doc type' assert self.custom_export.type == self.export_type, 'wrong export type specified' assert self.custom_export.index[ 0] == domain, 'bad export doc domain' except AssertionError as e: raise BadExportConfiguration(str(e)) else: self.custom_export = self.ExportSchemaClass(type=self.export_type) self.export_stock = False
def __init__(self, request, domain, export_id=None): self.request = request self.domain = domain self.export_type = request.GET.get('type', 'form') self.presave = False if self.export_type == 'form': self.ExportSchemaClass = FormExportSchema else: self.ExportSchemaClass = SavedExportSchema if export_id: self.custom_export = self.ExportSchemaClass.get(export_id) # also update the schema to include potential new stuff self.custom_export.update_schema() # enable configuring saved exports from this page saved_group = HQGroupExportConfiguration.get_for_domain(self.domain) self.presave = export_id in saved_group.custom_export_ids assert(self.custom_export.doc_type == 'SavedExportSchema') assert(self.custom_export.type == self.export_type) assert(self.custom_export.index[0] == domain) else: self.custom_export = self.ExportSchemaClass(type=self.export_type) if self.export_type == 'form': self.custom_export.app_id = request.GET.get('app_id')
def __init__(self, request, domain, export_id=None, minimal=False): self.request = request self.domain = domain self.presave = False self.transform_dates = False self.creating_new_export = not bool(export_id) self.minimal = minimal if export_id: self.custom_export = self.ExportSchemaClass.get(export_id) # also update the schema to include potential new stuff self.custom_export.update_schema() # enable configuring saved exports from this page saved_group = HQGroupExportConfiguration.get_for_domain(self.domain) self.presave = export_id in saved_group.custom_export_ids self.export_stock = self.has_stock_column() try: assert self.custom_export.doc_type == 'SavedExportSchema', 'bad export doc type' assert self.custom_export.type == self.export_type, 'wrong export type specified' assert self.custom_export.index[0] == domain, 'bad export doc domain' except AssertionError, e: raise BadExportConfiguration(str(e))
def __init__(self, request, domain, export_id=None): self.request = request self.domain = domain self.export_type = request.GET.get('type', 'form') self.presave = False if export_id: self.custom_export = self.ExportSchemaClass.get(export_id) # also update the schema to include potential new stuff self.custom_export.update_schema() # enable configuring saved exports from this page saved_group = HQGroupExportConfiguration.get_for_domain(self.domain) self.presave = export_id in saved_group.custom_export_ids assert(self.custom_export.doc_type == 'SavedExportSchema') assert(self.custom_export.type == self.export_type) assert(self.custom_export.index[0] == domain) else: self.custom_export = self.ExportSchemaClass(type=self.export_type)
def __init__(self, request, domain, export_id=None): self.request = request self.domain = domain self.presave = False self.transform_dates = False self.creating_new_export = not bool(export_id) if export_id: self.custom_export = self.ExportSchemaClass.get(export_id) # also update the schema to include potential new stuff self.custom_export.update_schema() # enable configuring saved exports from this page saved_group = HQGroupExportConfiguration.get_for_domain(self.domain) self.presave = export_id in saved_group.custom_export_ids assert(self.custom_export.doc_type == 'SavedExportSchema') assert(self.custom_export.type == self.export_type) assert(self.custom_export.index[0] == domain) else: self.custom_export = self.ExportSchemaClass(type=self.export_type)
def _get_daily_saved_export_ids(domain): group_config = HQGroupExportConfiguration.get_for_domain(domain) return set(group_config.custom_export_ids)
def _get_daily_saved_export_ids(domain): group_config = HQGroupExportConfiguration.get_for_domain(domain) return set(group_config.custom_export_ids)