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:
parent
32ef1a067d
commit
dd66347498
6 changed files with 37 additions and 8 deletions
15
README.txt
15
README.txt
|
@ -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
|
||||
=============
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -285,6 +285,7 @@ class Concept(Contained, Persistent):
|
|||
if canListObject(r.second))
|
||||
return sorted(rels, key=sort)
|
||||
|
||||
|
||||
# concept manager
|
||||
|
||||
class ConceptManager(BTreeContainer):
|
||||
|
|
|
@ -698,6 +698,11 @@ class INote(ITextDocument):
|
|||
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
|
||||
|
|
|
@ -37,7 +37,9 @@ class PersonSchemaFactory(SchemaFactory):
|
|||
|
||||
def __call__(self, interface, **kw):
|
||||
schema = super(PersonSchemaFactory, self).__call__(interface, **kw)
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue