[Product-Developers] Re: AGX neither a method nor a callable

Roijen, Bas bas.roijen at cofely-gdfsuez.nl
Thu Sep 10 13:54:46 UTC 2009


Thnx, the UID I get is correct, but how do I use the catalog to get the
title?
This is what I got so far, but it gives the error: LazyMap instance has
no attribute 'Title':
security.declarePublic('findParentTitle')
def findParentTitle(self):
	"""
	Return the parents title
	"""
	catalog = getToolByName(self, 'portal_catalog')
	uid = self.aq_inner.aq_parent.UID()
	brain = catalog(UID=uid)
	result = brain.Title()
	return results


Met vriendelijke groet, 

Bas Roijen 
Technisch Applicatiebeheerder 
GSM +31 (0)6 27 464 235 
E-mail bas.roijen at cofely-gdfsuez.nl 



Cofely Experts BV 
Locatie Maastricht-Airport 
Amerikalaan 35 6199 AE Maastricht-Airport 
Postbus 305 6199 ZN Maastricht-Airport 
Alg. +31 (0)43 367 50 00 
Fax +31 (0)43 367 59 99 
Url www.gti-group.com/experts 


-----Oorspronkelijk bericht-----
Van: product-developers-bounces at lists.plone.org
[mailto:product-developers-bounces at lists.plone.org] Namens Yuri
Verzonden: donderdag 10 september 2009 12:00
Aan: product-developers at lists.plone.org
Onderwerp: Re: [Product-Developers] Re: AGX neither a method nor a
callable

Roijen, Bas ha scritto:
> Tried that, but is gives the same result.
>   

print the aq_parent UID and check if it is correct. If it is, use the
catalog to get the object title.

I've found also problems in getting the parent starting from 3.2.X

>
> -----Oorspronkelijk bericht-----
> Van: Maurits van Rees [mailto:m.van.rees at zestsoftware.nl]
> Verzonden: donderdag 10 september 2009 11:38
> Aan: Roijen, Bas
> CC: product-developers at lists.plone.org
> Onderwerp: Re: [Product-Developers] Re: AGX neither a method nor a 
> callable
>
> On Thu, Sep 10, 2009 at 11:32:52AM +0200, Roijen, Bas wrote:
>   
>> I got it!
>> It was getting its own title and not that of it's parent, found this 
>> out by trying to get the id. It returned the name of the contenttype.
>> So how do i get the title of the parent and not of itself?
>>     
>
> Try self.aq_inner.aq_parent.Title().  Depending on the exact code path

> the aq_parent might not be what you expect and the extra aq_inner 
> should help there.
>
> --
> Maurits van Rees | http://maurits.vanrees.org/
>             Work | http://zestsoftware.nl/ "Yes, we study economics, 
> got to make the money make some kind of sense."  - Geoff Mann 
> ================================================
> De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is 
> uitsluitend bestemd voor de geadresseerde. Indien u dit bericht 
> onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de

> afzender direct te informeren door het bericht te retourneren.
> ================================================
> The information contained in this message may be confidential and is 
> intended to be exclusively for the addressee. Should you receive this 
> message unintentionally, please do not use the contents herein and 
> notify the sender immediately by return e-mail.
> ================================================
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers
>   


_______________________________________________
Product-Developers mailing list
Product-Developers at lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers
================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht
onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de
afzender direct te informeren door het bericht te retourneren. 
================================================
The information contained in this message may be confidential and is
intended to be exclusively for the addressee. Should you receive this
message unintentionally, please do not use the contents herein and
notify the sender immediately by return e-mail.
================================================
================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en 
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht 
onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en 
de afzender direct te informeren door het bericht te retourneren. 
================================================
The information contained in this message may be confidential 
and is intended to be exclusively for the addressee. Should you 
receive this message unintentionally, please do not use the contents 
herein and notify the sender immediately by return e-mail.
================================================




More information about the Product-Developers mailing list