summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Messiant <cedricmessiant@ecreall.com>2013-03-05 12:21:30 (GMT)
committerCédric Messiant <cedricmessiant@ecreall.com>2013-03-05 12:21:30 (GMT)
commitaa6c37de208280c768c43e400cd29f0c5dd69e21 (patch)
treece986a96bced113e928e3b1c1bce3c24e07f8a9c
parent633d7a5cfc1f3d17bfffd3c834eb3d7c5c7d9c9e (diff)
downloadcollective.contact.widget-aa6c37de208280c768c43e400cd29f0c5dd69e21.zip
collective.contact.widget-aa6c37de208280c768c43e400cd29f0c5dd69e21.tar.gz
collective.contact.widget-aa6c37de208280c768c43e400cd29f0c5dd69e21.tar.bz2
Now uses get_full_title brain metadata
-rw-r--r--src/collective/contact/widget/source.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/collective/contact/widget/source.py b/src/collective/contact/widget/source.py
index 767ba3a..b183960 100644
--- a/src/collective/contact/widget/source.py
+++ b/src/collective/contact/widget/source.py
@@ -62,13 +62,8 @@ class ContactSource(ObjPathSource):
value = brain._unrestrictedGetObject()
else:
value = brain.getPath()[len(self.portal_path):]
- # TODO avoid to wake up object, create a get_full_title brain metadada
- if base_hasattr(brain.getObject(), "get_full_title"):
- full_title = brain.getObject().get_full_title()
- return Term(value, token=brain.getPath(), title=full_title, brain=brain)
- else:
- return Term(value, token=brain.getPath(), title=brain.Title or
- brain.id, brain=brain)
+ full_title = brain.get_full_title or brain.Title or brain.id
+ return Term(value, token=brain.getPath(), title=full_title, brain=brain)
def tokenToPath(self, token):
"""For token='/Plone/a/b', return '/a/b'