Did I find the right examples for you? yes no

All Samples(7)  |  Call(6)  |  Derive(0)  |  Import(1)

src/p/r/Products.PloneGetPaid-0.10.5/Products/PloneGetPaid/catalog.py   Products.PloneGetPaid(Download)
# Make sure that catalog brains can have a 'price' attribute.
 
from getpaid.core.interfaces import IPayable
from Products.CMFPlone import CatalogTool
from Products.PloneGetPaid.interfaces import IPayableMarker
    def get_price(object):
        adapted = IPayable(object, None)
        if adapted is not None:
            return adapted.price
        return None
    def get_price(object, portal, **kw):
        if not IPayableMarker.providedBy(object):
            return None
        adapted = IPayable(object, None)
        if adapted is not None:

src/g/e/getpaid.formgen-0.6/src/getpaid/formgen/content/getpaidpfgadapter.py   getpaid.formgen(Download)
                content = parent_node.restrictedTraverse(fields['payable_path'], None)
 
                payable = GPInterfaces.IPayable(content)
                if payable.price:
                    title = content.title + " : $%0.2f" % (payable.price)
        for b in buyables:
            o = b.getObject()
            payable = GPInterfaces.IPayable(o)
            if payable.price:
                stuff.append((b.getPath(), o.title + " : %0.2f" % (payable.price)))

src/p/r/Products.PloneGetPaid-0.10.5/Products/PloneGetPaid/content.py   Products.PloneGetPaid(Download)
    def checkPayable(self, content):
        if not IPayableMarker.providedBy(content):
            raise RuntimeError("Invalid Context For Cart Add")
        return interfaces.IPayable(content)
 

src/g/e/getpaid.report-0.1.1/src/getpaid/report/sync.py   getpaid.report(Download)
def copyProduct( source, target, item=None, uid=None ):
    payable = interfaces.IPayable( source )
    uid = item and item.uid or uid
    assert uid, "must pass in either item or uid"