I don't know if you can use default_method in reference field, but, if
you can, shouldn't the default_method return the UID of the referenced
object instead of the title_or_id?
regards,
Bruno
On Tue, 8 Mar 2005 13:15:05 -0500, Mee Chu Cheung
<meechu-XxgC2+TuPe...@public.gmane.org> wrote:
Hi:
I am using the ReferenceField as one of the field in my AT. I use:
vocabulary_custom_label="b.getObject().title_or_id()" to set the list for
selection. It's working fine and I can see the getRawRefclientgroup as a
metadata in the portal_catalog. However, when I want to set a default value
for this field using a default_method, it seems the method is ignored. My
default_method ("getRefGroupFromParent") return the title_or_id of the
reference object. MY question is: can I use default_method in a
Referencefield?
ReferenceField('refclientgroup',
relationship="A",
index="KeywordIndex:schema",
default_method="getRefGroupFromParent",
allowed_types=("Client",),
vocabulary_custom_label="b.getObject().title_or_id()",
widget=ReferenceWidget(label="Group"),
),
Thanks a lot.
Mee chu