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
contentType dropdown True <...SimpleVocabulary object...>
linkUrl textline False None
linkText textline False None
>>> view.data
{'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
a NodeView.
@ -834,6 +835,18 @@ informations about all parents of an object.
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
=============

View file

@ -30,7 +30,9 @@
<b>
<a href="."
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>
</div>
</metal:block>

View file

@ -209,3 +209,9 @@ class NameChooser(BaseNameChooser):
specialCharacters = {
'\xc4': 'Ae', '\xe4': 'ae', '\xd6': 'Oe', '\xf6': 'oe',
'\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))
return sorted(rels, key=sort)
# concept manager
class ConceptManager(BTreeContainer):

View file

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

View file

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