5 messages in net.sourceforge.lists.archetypes-usersRe: Default_method in ReferenceField
FromSent OnAttachments
Mee Chu CheungMar 8, 2005 10:14 am 
Bruno RezendeMar 8, 2005 11:33 am 
Mee Chu CheungMar 9, 2005 6:22 am 
Bruno RezendeMar 9, 2005 7:03 am 
Mee Chu CheungMar 10, 2005 11:01 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Default_method in ReferenceFieldActions
From:Bruno Rezende (brun@public.gmane.org)
Date:Mar 8, 2005 11:33:51 am
List:net.sourceforge.lists.archetypes-users

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