added linkUrl attribute to note for controlling appearance of link text

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2440 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2008-03-08 10:15:17 +00:00
parent 32ef1a067d
commit dd66347498
6 changed files with 37 additions and 8 deletions

View file

@ -762,10 +762,11 @@ The new technique uses the ``fields`` and ``data`` attributes...
data textarea False None data textarea False None
contentType dropdown True <...SimpleVocabulary object...> contentType dropdown True <...SimpleVocabulary object...>
linkUrl textline False None linkUrl textline False None
linkText textline False None
>>> view.data >>> view.data
{'linkUrl': u'http://', 'contentType': 'text/restructured', 'data': u'', {'linkUrl': u'http://', 'contentType': 'text/restructured', 'data': u'',
'title': u'Test Note'} 'linkText': u'', 'title': u'Test Note'}
The object is changed via a FormController adapter created for The object is changed via a FormController adapter created for
a NodeView. a NodeView.
@ -834,6 +835,18 @@ informations about all parents of an object.
Type 2 Type 2
Caching
=======
To be done...
>>> from loops.common import cached
>>> obj = resources['test_note']
>>> cxObj = cached(obj)
>>> [p.object.title for p in cxObj.getAllParents()]
[u'Note', u'Type']
Import/Export Import/Export
============= =============

View file

@ -30,7 +30,9 @@
<b> <b>
<a href="." <a href="."
i18n:translate="" i18n:translate=""
tal:attributes="href linkUrl">more...</a> tal:attributes="href linkUrl"
tal:define="linkText item/adapted/linkText|nothing"
tal:content="python: linkText or 'more...'">more...</a>
</b> </b>
</div> </div>
</metal:block> </metal:block>

View file

@ -209,3 +209,9 @@ class NameChooser(BaseNameChooser):
specialCharacters = { specialCharacters = {
'\xc4': 'Ae', '\xe4': 'ae', '\xd6': 'Oe', '\xf6': 'oe', '\xc4': 'Ae', '\xe4': 'ae', '\xd6': 'Oe', '\xf6': 'oe',
'\xdc': 'Ue', '\xfc': 'ue', '\xdf': 'ss'} '\xdc': 'Ue', '\xfc': 'ue', '\xdf': 'ss'}
# caching
def cached(obj):
return obj

View file

@ -285,6 +285,7 @@ class Concept(Contained, Persistent):
if canListObject(r.second)) if canListObject(r.second))
return sorted(rels, key=sort) return sorted(rels, key=sort)
# concept manager # concept manager
class ConceptManager(BTreeContainer): class ConceptManager(BTreeContainer):

View file

@ -698,6 +698,11 @@ class INote(ITextDocument):
description=_(u'An (optional) link associated with this note'), description=_(u'An (optional) link associated with this note'),
default=u'http://', default=u'http://',
required=False) required=False)
linkText = schema.TextLine(
title=_(u'Link text'),
description=_(u'Text for "more..." link.'),
required=False,)
# events # events

View file

@ -37,7 +37,9 @@ class PersonSchemaFactory(SchemaFactory):
def __call__(self, interface, **kw): def __call__(self, interface, **kw):
schema = super(PersonSchemaFactory, self).__call__(interface, **kw) schema = super(PersonSchemaFactory, self).__call__(interface, **kw)
if 'phoneNumbers' in schema.fields.keys():
schema.fields.phoneNumbers.instance_name ='simplelist' schema.fields.phoneNumbers.instance_name ='simplelist'
if 'birthDate' in schema.fields.keys():
schema.fields.birthDate.display_format = ('date', 'long') schema.fields.birthDate.display_format = ('date', 'long')
return schema return schema