On Mar 12, 12:06 am, Darryl Dixon <[email protected]> wrote:
> Sub-class the interface.

Sublcassing isn't a solution in my case because I want to write a
plugin. Any other user extension or plugin would also sub-class the
base class and so only one set of extensions would be available.

Subclassing also leads me to having to sub-class the sub-classed
interfaces and the adapters and the viewlets - basically everything
using the interface.


Directly extending the interface from an external piece of code works
to a point.

from getpaid.core.interfaces import IPayable
from zope import schema
IPayable.vat_method=schema.Choice(title=u'VAT Method', values=[u'A',
u'B'])

The view "fields" are initialised when the class is declared, not when
the views are created, i.e. the following element is ignored by @@edit-
payable. I have to apply the same logic to the classes, i.e. import
edit-payable and re-initialise the fields.

This patching approach would work. However, I hope there is something
cleaner.

Kevin

>
> D
>
> On 12/03/2011 11:12 AM, "kevin gill" <[email protected]> wrote:
>
> Hi,
>
> I am finding myself extending IPayable.(To add vat codes to
> products).
>
> I have forked the getpaid.core.interfaces code base to add the code I
> want into the base class. This obviously causes long term problems.
>
> Is there a schema extension approach I should be using?
>
> This is probably a generic Plone issue. I am not a very experienced
> Plone user.
>
> Thanks,
>
> Kevin
>
> --
> GetPaid for Plone:http://www.plonegetpaid.com(overview info) 
> |http://code.google.com/p/getpaid(code and issue tracker)
> You received this message because you are subscribed to the Google Groups
> "getpaid-dev" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
>
> For more options, visit this group 
> athttp://groups.google.com/group/getpaid-dev?hl=en?hl=en

-- 
GetPaid for Plone: http://www.plonegetpaid.com (overview info) | 
http://code.google.com/p/getpaid (code and issue tracker)
You received this message because you are subscribed to the Google Groups 
"getpaid-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]

For more options, visit this group at
http://groups.google.com/group/getpaid-dev?hl=en?hl=en

Reply via email to