Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install betahaus.exports.openmember

How to install betahaus.exports.openmember

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install betahaus.exports.openmember
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1b2 Available View build log
Windows (64-bit)
0.1b2 Available View build log
Mac OS X (10.5+)
0.1b2 Available View build log
Linux (32-bit)
0.1b2 Available View build log
Linux (64-bit)
0.1b2 Available View build log
 
Author
License
GPL
Lastest release
version 0.1b2 on Jan 5th, 2011

Introduction

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

Extensions

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 export.py

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.

Changelog

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

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.