Exemplo n.º 1
0
 def after_delete(self, context, data_dict):
     ckan_ini_filepath = os.path.abspath(config['__file__'])
     api.compat_enqueue(
         'datadotworld.syncronize',
         tasks.syncronize,
         args=[data_dict['id'], ckan_ini_filepath])
     return data_dict
Exemplo n.º 2
0
def syncronize_org(id):
    ckan_ini_filepath = os.path.abspath(config['__file__'])
    packages = model.Session.query(model.Package).filter_by(owner_org=id)
    for pkg in packages:
        compat_enqueue('datadotworld.syncronize',
                       syncronize,
                       args=[pkg.id, ckan_ini_filepath])
Exemplo n.º 3
0
    def _push_failed(self):
        # XXX: DO NOT IMPORT celery at the top of file - it will
        # use incorrect config then and you'll receive error like
        # "no section app:main in config file"
        # from ckan.lib.celery_app import celery
        ckan_ini_filepath = path.abspath(config['__file__'])
        failed = model.Session.query(Extras).filter_by(state='failed')

        for record in failed:
            compat_enqueue(
                'datadotworld.syncronize',
                syncronize,
                args=[record.package_id, ckan_ini_filepath])