[Zope3-dev] how to manipulate interfaces?

Adam Groszer adamg at fw.hu
Tue Dec 13 05:41:39 EST 2005


I have a schema where for one attribute (processDef) the user should
be able to modify it only at the time he adds the object.
This is a quick hack to spare some lines of code, but it is not
working as expected. Modifying derived interface modifies the base
too.

Is that the expected behavior?
How could I solve these minor changes in a schema easily?

class IDocType(Interface):
        """DocType dok string
        """
        
        title = MyTextLine(
                title=u"DocType name",
                description=u"DocType name",
                required=True
                )
        processDef = MyChoice(
                title=u"ProcessDefinition tipus",
                description=u"ProcessDefinition tipus",
                required=True,
                vocabulary="processdef",
                readonly=False
                )

class IDocTypeEditForm(IDocType):
        """ """

IDocTypeEditForm.getDescriptionFor('processDef').readonly=True

>>>IDocType.getDescriptionFor('processDef').readonly
True
>>>IDocTypeEditForm.getDescriptionFor('processDef').readonly
True

-- 
Best regards,
 Adam                          mailto:adamg at fw.hu
--
Quote of the day:
The fear of God kills all other fears. 
- Hugh Black 



More information about the Zope3-dev mailing list