Basic setup for node schema adapters (+ some minor improvements)
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1023 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
ee7a84b6d5
commit
f3c02a6ac7
1 changed files with 8 additions and 1 deletions
|
@ -74,14 +74,18 @@ TODO: Work with views...
|
||||||
Resources and what they have to do with Concepts
|
Resources and what they have to do with Concepts
|
||||||
================================================
|
================================================
|
||||||
|
|
||||||
|
>>> from loops.interfaces import IDocument, IMediaAsset
|
||||||
|
|
||||||
We first need a resource manager:
|
We first need a resource manager:
|
||||||
|
|
||||||
>>> from loops.resource import ResourceManager, Document
|
>>> from loops.resource import ResourceManager
|
||||||
>>> loopsRoot['resources'] = ResourceManager()
|
>>> loopsRoot['resources'] = ResourceManager()
|
||||||
>>> resources = loopsRoot['resources']
|
>>> resources = loopsRoot['resources']
|
||||||
|
|
||||||
A common type of resource is a document:
|
A common type of resource is a document:
|
||||||
|
|
||||||
|
>>> from loops.interfaces import IDocument
|
||||||
|
>>> from loops.resource import Document
|
||||||
>>> doc1 = Document(u'Zope Info')
|
>>> doc1 = Document(u'Zope Info')
|
||||||
>>> resources['doc1'] = doc1
|
>>> resources['doc1'] = doc1
|
||||||
>>> doc1.title
|
>>> doc1.title
|
||||||
|
@ -93,6 +97,7 @@ A common type of resource is a document:
|
||||||
|
|
||||||
Another one is a media asset:
|
Another one is a media asset:
|
||||||
|
|
||||||
|
>>> from loops.interfaces import IMediaAsset
|
||||||
>>> from loops.resource import MediaAsset
|
>>> from loops.resource import MediaAsset
|
||||||
>>> img = MediaAsset(u'A png Image')
|
>>> img = MediaAsset(u'A png Image')
|
||||||
|
|
||||||
|
@ -274,6 +279,8 @@ It is also possible to edit a target's attributes directly in an
|
||||||
edit form provided by the node:
|
edit form provided by the node:
|
||||||
|
|
||||||
>>> from loops.target import DocumentProxy, MediaAssetProxy
|
>>> from loops.target import DocumentProxy, MediaAssetProxy
|
||||||
|
>>> ztapi.provideAdapter(INode, IDocument, DocumentProxy)
|
||||||
|
>>> ztapi.provideAdapter(INode, IMediaAsset, MediaAssetProxy)
|
||||||
|
|
||||||
Ordering Nodes
|
Ordering Nodes
|
||||||
--------------
|
--------------
|
||||||
|
|
Loading…
Add table
Reference in a new issue