use a note's data as its description
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1692 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
ea09e0d836
commit
6cac949842
3 changed files with 15 additions and 1 deletions
|
@ -48,6 +48,7 @@ from cybertools.browser.view import GenericView
|
||||||
from cybertools.relation.interfaces import IRelationRegistry
|
from cybertools.relation.interfaces import IRelationRegistry
|
||||||
from cybertools.text import mimetypes
|
from cybertools.text import mimetypes
|
||||||
from cybertools.typology.interfaces import IType, ITypeManager
|
from cybertools.typology.interfaces import IType, ITypeManager
|
||||||
|
from loops.common import adapted
|
||||||
from loops.interfaces import IView
|
from loops.interfaces import IView
|
||||||
from loops.resource import Resource
|
from loops.resource import Resource
|
||||||
from loops.type import ITypeConcept
|
from loops.type import ITypeConcept
|
||||||
|
@ -152,7 +153,7 @@ class BaseView(GenericView):
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def description(self):
|
def description(self):
|
||||||
return self.context.description
|
return adapted(self.context).description
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def dcTitle(self):
|
def dcTitle(self):
|
||||||
|
|
|
@ -363,6 +363,15 @@
|
||||||
set_schema="loops.interfaces.IFile" />
|
set_schema="loops.interfaces.IFile" />
|
||||||
</class>
|
</class>
|
||||||
|
|
||||||
|
<adapter factory="loops.resource.TextDocumentAdapter" trusted="True"
|
||||||
|
provides="loops.interfaces.ITextDocument" />
|
||||||
|
<class class="loops.resource.TextDocumentAdapter">
|
||||||
|
<require permission="zope.View"
|
||||||
|
interface="loops.interfaces.ITextDocument" />
|
||||||
|
<require permission="zope.ManageContent"
|
||||||
|
set_schema="loops.interfaces.ITextDocument" />
|
||||||
|
</class>
|
||||||
|
|
||||||
<adapter factory="loops.resource.NoteAdapter"
|
<adapter factory="loops.resource.NoteAdapter"
|
||||||
provides="loops.interfaces.INote"
|
provides="loops.interfaces.INote"
|
||||||
trusted="True" />
|
trusted="True" />
|
||||||
|
|
|
@ -381,6 +381,10 @@ class NoteAdapter(DocumentAdapter):
|
||||||
implements(INote)
|
implements(INote)
|
||||||
_contextAttributes = list(INote) + list(IBaseResource)
|
_contextAttributes = list(INote) + list(IBaseResource)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def description(self):
|
||||||
|
return self.data.replace('\n', ' ')
|
||||||
|
|
||||||
|
|
||||||
# other adapters
|
# other adapters
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue