Skip to main content

Exports for the betahaus.openmember

Project description


Extension package for betahaus.openmember that exports searches and full database to CVS. It is also has support for registering own exporters.


It is possible to extend with custom exporters. You need one Adapter and a browser view

The adapter is created by making a interface that inherits from the betahaus.exports.openmember.interfaces.IExporter interface.

>>> from betahaus.exports.openmember.interfaces import IExporter
>>> class IExportCustomAdapter(IExporter):
...    """ Interface for registering custom exporter"""

With code that implements the adapter interface.

>>> from betahaus.exports.openmember.browser.export import make_url
>>> class ExportCustomAdapter(object):
...    """Another exporter"""
...    implements(IExportCustomAdapter)
...    adapts(IExportable)
...    def __init__(self, context):
...        self.context = context
...    def url(self):
...        return '%s/custom_exporter%s' % (self.context.portal_url(), make_url(self.context.request))
...    def Title(self):
...        return _('Custom Export from table')

This then needs to be registered as a exporter by calling:

>>> registerExporter(IExportContactsAdapter)

We also needs some zcml to register the adapter, since everything is defined in the adapter the only thing we need is:

<adapter factory=”.export.ExportCustomAdapter” />

Assuming that the file is called

Now we only need a browser view to handle the exporting

>>> from betahaus.exports.openmember.browser.export import ExportBase
>>> class ExportCustom(ExportBase):
...    """Download as csv"""
... def __call__(self):
...     # here you can do the changes that you need to do for your custom exporter.

Look at ExportBase for more information about what functions are available.


0.1b2 (2010-04-16)

  • Fixed bug with full database csv export. [mlundwall]
  • Updated the loading of exporters from the action. [mlundwall]

0.1b (2010-02-10)

  • Initial release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for betahaus.exports.openmember, version 0.1b2
Filename, size File type Python version Upload date Hashes
Filename, size (27.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page