Exemplo n.º 1
0
 def handle(self, *args, **options):
     column = int(options.get('column'))
     csv_file = args[0]
     with open(csv_file, 'rb') as f:
         reader = csv.reader(f)
         for row in reader:
             LOGGER.debug(row[column])
             endpoint = get_sanitized_endpoint(row[column])
             create_services_from_endpoint(endpoint)
Exemplo n.º 2
0
def update_endpoint(self, endpoint):
    from hypermap.aggregator.utils import create_services_from_endpoint
    print 'Processing endpoint with id %s: %s' % (endpoint.id, endpoint.url)
    imported, message = create_services_from_endpoint(endpoint.url)
    endpoint.imported = imported
    endpoint.message = message
    endpoint.processed = True
    endpoint.save()
Exemplo n.º 3
0
def update_endpoint(self, endpoint):
    from hypermap.aggregator.utils import create_services_from_endpoint
    print 'Processing endpoint with id %s: %s' % (endpoint.id, endpoint.url)
    imported, message = create_services_from_endpoint(endpoint.url)
    endpoint.imported = imported
    endpoint.message = message
    endpoint.processed = True
    endpoint.save()
Exemplo n.º 4
0
def update_endpoint(self, endpoint, greedy_opt=False):
    from hypermap.aggregator.utils import create_services_from_endpoint
    from hypermap.aggregator.models import Endpoint

    LOGGER.debug('Processing endpoint with id %s: %s' % (endpoint.id, endpoint.url))

    # Override the greedy_opt var with the value from the endpoint list
    # if it's available.
    if endpoint.endpoint_list:
        greedy_opt = endpoint.endpoint_list.greedy

    imported, message = create_services_from_endpoint(endpoint.url, greedy_opt=greedy_opt, catalog=endpoint.catalog)

    # this update will not execute the endpoint_post_save signal.
    Endpoint.objects.filter(id=endpoint.id).update(
        imported=imported, message=message, processed=True
    )