gws.base.exporter.manager

Exporter manager.

Source code: gws.base.exporter.manager

Module Contents

class gws.base.exporter.manager.Object

Bases: gws.ExporterManager

Exporter manager.

exec_export(request, out_path)

Run an export directly, as the system user, and copy the result file.

Parameters:
  • request – Export request.

  • out_path – Path to copy the result file to.

Returns:

The export result.

Raises:

gws.Error – If no features were exported.

get_exporter(where, uid, user)

Find an exporter by uid among the exporters the user can use.

Parameters:
  • where – Objects with an exporters list, e.g. a project and the application.

  • uid – Exporter uid.

  • user – User.

Returns:

The exporter, or None if it is not found.

list_exporters(where, user)

List the exporters of the given objects that the user can use.

Of several exporters with the same title, only the first one is listed.

Parameters:
  • where – Objects with an exporters list, e.g. a project and the application. None entries are ignored.

  • user – User.

Returns:

A list of exporters.

start_export_job(request, user)

Create and schedule a background export job.

Parameters:
  • request – Export request.

  • user – User the export runs for.

Returns:

The status of the new job.