This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Overview

z3c.discriminator provides a formalism for marking adapter specifications as discriminators in the sense that they will be used only for adapter lookup, not instantiation.

Using z3c.discriminator

To mark one or more interfaces as discriminators in a provideAdapter call, simply wrap your interface with the discriminator method:

>>> from z3c.discriminator import discriminator
>>> provideAdapter(MyAdapter, (IFoo, discriminator(IBar)))

To do the same in a Zope configuration file, prefix your dotted path with a dash like so:

<adapter for=”IFoo -IBar” factory=”some.package.YourFactory” />

Note that any interface in the declaration can be made a discriminator; they need not come in any particular order.

In your factory definition, simply require only the arguments that correspond to non-discriminator specifications, e.g.

class GetsOnlyFoo(object):
def __init__(self, foo):

-or-

def gets_only_bar(bar):

Changelog

Version 0.2 - November 26, 2007

  • Discriminator machinery is now introduced globally by patching the global adapter registry and the GlobalObject configuration field.

    The discriminator method now returns an interface that is in all aspects equal to the discriminated interface except it’s marked as a discriminator.

    Test suite have been expanded by including the entire test suite from zope.component. [malthe]

Version 0.1 - November 23, 2007

  • First public release [malthe]
Release History

Release History

0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
z3c.discriminator-0.2-py2.4.egg (9.0 kB) Copy SHA256 Checksum SHA256 2.4 Egg Nov 26, 2007
z3c.discriminator-0.2.tar.gz (4.4 kB) Copy SHA256 Checksum SHA256 Source Nov 26, 2007

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting