def handle(self, *args, **kwargs): projects = request_with_auth(EVENTS_URL) if not projects: print('Couldn\'t find projects data at {}'.format(EVENTS_URL)) with reversion.create_revision(): for project in projects: self.import_project(project)
def handle(self, *args, **kwargs): frameworks = request_with_auth(ENTRY_TEMPLATES_URL) if not frameworks: print('Couldn\'t find AF data at {}'.format(ENTRY_TEMPLATES_URL)) with reversion.create_revision(): for framework in frameworks: self.import_framework(framework)
def run(self): frameworks = request_with_auth(get_source_url('entry-templates', 'v1')) if not frameworks: print('Couldn\'t find AF data at') with reversion.create_revision(): for framework in frameworks: self.import_framework(framework)
def run(self): projects = request_with_auth(get_source_url('events2', 'v1')) if not projects: print('Couldn\'t find projects data') with reversion.create_revision(): for project in projects: self.import_project(project)
def run(self): data = request_with_auth(get_source_url('leads')) if not data or not data.get('data'): print('Couldn\'t find leads data') leads = data['data'] with reversion.create_revision(): for lead in leads: self.import_lead(lead)
def handle(self, *args, **kwargs): data = request_with_auth(LEADS_URL) if not data or not data.get('data'): print('Couldn\'t find leads data at {}'.format(LEADS_URL)) leads = data['data'] with reversion.create_revision(): for lead in leads: self.import_lead(lead)
def run(self): entries = request_with_auth( get_source_url('entries', query='template=1', version='v1')) if not entries: print('Couldn\'t find entries data') with reversion.create_revision(): for entry in entries: self.import_entry(entry)
def run(self): if self.kwargs.get('data_file'): with open(self.kwargs['data_file']) as f: projects = json.load(f) else: projects = request_with_auth(get_source_url('events2', 'v1')) if not projects: print('Couldn\'t find projects data') with reversion.create_revision(): for project in projects: self.import_project(project)
def run(self): if self.kwargs.get('data_file'): with open(self.kwargs['data_file']) as f: user_groups = json.load(f) else: user_groups = request_with_auth(get_source_url( 'user-groups', 'v1')) if not user_groups: print('Couldn\'t find user groups data') with reversion.create_revision(): for user_group in user_groups: self.import_user_group(user_group)
def run(self): if self.kwargs.get('data_file'): with open(self.kwargs['data_file']) as f: entries = json.load(f) else: entries = request_with_auth( get_source_url('entries', query='template=1', version='v1')) if not entries: print('Couldn\'t find entries data') with reversion.create_revision(): for entry in entries: self.import_entry(entry)
def run(self): if self.kwargs.get('data_file'): with open(self.kwargs['data_file']) as f: frameworks = json.load(f) else: query = self.kwargs.get('query_str', '') frameworks = request_with_auth( get_source_url('entry-templates', 'v1', query)) if not frameworks: print('Couldn\'t find AF data at') with reversion.create_revision(): new_frameworks_file = open('new_afs.txt', 'a') for framework in frameworks: self.import_framework(framework, new_frameworks_file) new_frameworks_file.close()