Пример #1
0
def check_layer(self, layer):
    print 'Checking layer %s' % layer.name
    success, message = layer.check()
    if not success:
        from aggregator.models import TaskError
        task_error = TaskError(
            task_name=self.name,
            args=layer.id,
            message=message
        )
        task_error.save()
Пример #2
0
def index_layer(self, layer):
    from aggregator.solr import SolrHypermap
    print 'Syncing layer %s to solr' % layer.name
    solrobject = SolrHypermap()
    success, message = solrobject.layer_to_solr(layer)
    if not success:
        from aggregator.models import TaskError
        task_error = TaskError(
            task_name=self.name,
            args=layer.id,
            message=message
        )
        task_error.save()