Skip to content

Incoherence when using getattr in a field ObjPathSourceBinder #30

Open
@idgserpro

Description

@idgserpro

When I have a field ObjPathSourceBinder:

from plone.formwidget.contenttree import ObjPathSourceBinder
...

class ICarrossel(Interface):

    product = RelationChoice(
        title=_(u'Product'),
        source=ObjPathSourceBinder(object_provides=IProduct.__identifier__),
        required=False,
    )

When I create a Carrossel object that has never had the produtct field populated:

>>>print getattr(carrossel, 'product')
None

When I fill the product field, I then delete the product:

>>>print getattr(carrossel, 'product')
<z3c.relationfield.relation.RelationValue object at 0xb1289bac>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions