[Checkins] SVN: z3c.reference/branches/flash/src/z3c/reference/
Make progress on ViewReference implementation
Roger Ineichen
roger at projekt01.ch
Tue Sep 4 12:14:54 EDT 2007
Log message for revision 79462:
Make progress on ViewReference implementation
Changed:
U z3c.reference/branches/flash/src/z3c/reference/browser/tests.py
U z3c.reference/branches/flash/src/z3c/reference/browser/views.py
U z3c.reference/branches/flash/src/z3c/reference/browser/widget.py
U z3c.reference/branches/flash/src/z3c/reference/demo/app.py
U z3c.reference/branches/flash/src/z3c/reference/demo/browser/configure.zcml
D z3c.reference/branches/flash/src/z3c/reference/demo/browser/picker.pt
U z3c.reference/branches/flash/src/z3c/reference/demo/browser/tests.py
U z3c.reference/branches/flash/src/z3c/reference/demo/browser/views.py
U z3c.reference/branches/flash/src/z3c/reference/demo/interfaces.py
U z3c.reference/branches/flash/src/z3c/reference/demo/tests.py
U z3c.reference/branches/flash/src/z3c/reference/interfaces.py
U z3c.reference/branches/flash/src/z3c/reference/reference.py
U z3c.reference/branches/flash/src/z3c/reference/schema.py
U z3c.reference/branches/flash/src/z3c/reference/tests.py
-=-
Modified: z3c.reference/branches/flash/src/z3c/reference/browser/tests.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/browser/tests.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/browser/tests.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,3 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
import doctest
import unittest
from zope.testing.doctestunit import DocFileSuite, DocTestSuite
@@ -43,8 +61,11 @@
def test_suite():
- return unittest.TestSuite(
- (
+ return unittest.TestSuite((
+ DocFileSuite('README.txt',
+ setUp=setUp,tearDown=tearDown,
+ optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
+ ),
DocTestSuite('z3c.reference.browser.widget',
setUp=setUp,tearDown=tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
Modified: z3c.reference/branches/flash/src/z3c/reference/browser/views.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/browser/views.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/browser/views.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,7 +1,26 @@
-from zope.traversing.browser.absoluteurl import absoluteURL,AbsoluteURL
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
+from zope.traversing.browser.absoluteurl import absoluteURL, AbsoluteURL
import urllib
from zope.traversing.browser.interfaces import IAbsoluteURL
from zope import component
+from zope.app.intid.interfaces import IIntIds
from zope.traversing.interfaces import IContainmentRoot
noImage = '/@@/z3c.reference.resources/noimage.jpg'
@@ -65,5 +84,18 @@
IAbsoluteURL)
return view.breadcrumbs()
raise TypeError("Can't get breadcrumbs of external reference")
-
+
+class ViewReferenceEditor(object):
+ """View reference editor."""
+
+ def items(self):
+ intIds = component.getUtility(IIntIds)
+ for o in self.context.values():
+ yield dict(
+ name = o.__name__,
+ uid=intIds.getId(o))
+
+ @property
+ def url(self):
+ return absoluteURL(self.context, self.request)
Modified: z3c.reference/branches/flash/src/z3c/reference/browser/widget.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/browser/widget.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/browser/widget.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,17 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
+import urlparse, cgi, urllib
+from xml.dom.minidom import parse, parseString
+from zope import traversing
+from zope.traversing.browser import absoluteURL
+from zope.traversing.interfaces import TraversalError
+from zope.cachedescriptors.property import Lazy
+
from zope.app.form.browser.widget import SimpleInputWidget
from zope.app.form.browser.textwidgets import TextWidget
-from z3c.reference.reference import ViewReference,ImageReference
-from zope.traversing.browser.absoluteurl import absoluteURL
from zope.app.component import hooks
-from zope import traversing
from zope.app.form.browser.widget import renderElement
+
from zc import resourcelibrary
-from xml.dom.minidom import parse, parseString
-from zope.traversing.interfaces import TraversalError
-import urlparse, cgi, urllib
-from zope.cachedescriptors.property import Lazy
+from z3c.reference.reference import ViewReference,ImageReference
-
untitled = u'No Link defined'
undefined = u'Undefined'
@@ -121,13 +140,26 @@
refTag = u'a'
refTagOnClick=""
_emptyReference = emptyViewReference
+ referenceExplorerViewName = 'viewReferenceEditor.html'
def __init__(self, *args):
resourcelibrary.need('z3c.reference')
super(ViewReferenceWidget, self).__init__(*args)
-
+ def getReferenceExplorerURL(self):
+ """Returns the refrence explorer url."""
+ return absoluteURL(self.context.context, self.request) + '/%s' % \
+ self.referenceExplorerViewName
+
+ def getTargetString(self):
+ """Returns the target intid."""
+ return u''
+
+ def getViewString(self):
+ """Returns the view string."""
+ return u''
+
def __call__(self):
resourcelibrary.need('z3c.reference')
hidden = super(ViewReferenceWidget,self).__call__()
@@ -151,8 +183,23 @@
#ref = self._emptyReference
siteUrl = absoluteURL(hooks.getSite(),self.request)
contents = undefined
- tag = renderElement(self.refTag,
- href = siteUrl + '/@@picker.html',
+ href = self.getReferenceExplorerURL()
+ intIdName = self.name + '.intid'
+ viewName = self.name + '.view'
+ intidInput = renderElement(u'input',
+ type='hidden',
+ name=intIdName,
+ id=intIdName,
+ value=self.getTargetString(),
+ extra=self.extra)
+ viewInput = renderElement(u'input',
+ type='hidden',
+ name=viewName,
+ id=viewName,
+ value=self.getViewString(),
+ extra=self.extra)
+ linkTag = renderElement(self.refTag,
+ href = href,
name=self.name,
id=self.name + '.tag',
title=contents,
@@ -161,7 +208,7 @@
contents=contents,
style=self.style,
extra=self.extra)
- return hidden + tag
+ return linkTag + viewInput + intidInput
def _getFormValue(self):
res = super(ViewReferenceWidget,self)._getFormValue()
Modified: z3c.reference/branches/flash/src/z3c/reference/demo/app.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/demo/app.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/demo/app.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,3 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 72084 2007-01-18 01:02:26Z rogerineichen $
+"""
+__docformat__ = 'restructuredtext'
+
from zope import interface
from zope.schema.fieldproperty import FieldProperty
from zope.app.folder.folder import Folder
@@ -13,13 +31,19 @@
from z3c.reference.schema import ViewReferenceProperty
class DemoFolder(Folder):
+ """Demo folder implementation."""
+
interface.implements(IDemoFolder, IReferenced)
- previewImage = ViewReferenceProperty("PreviewImage")
- assets = ViewReferenceProperty("assets")
+
+ previewImage = ViewReferenceProperty(IDemoFolder['previewImage'])
+ assets = ViewReferenceProperty(IDemoFolder['assets'])
viewReferences = RelationPropertyIn(viewReferenceRelated)
class DemoImage(Image):
+ """DEmo image implementation."""
+
interface.implements(IDemoImage, IReferenced)
+
viewReferences = RelationPropertyIn(viewReferenceRelated)
Modified: z3c.reference/branches/flash/src/z3c/reference/demo/browser/configure.zcml
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/demo/browser/configure.zcml 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/demo/browser/configure.zcml 2007-09-04 16:14:53 UTC (rev 79462)
@@ -37,13 +37,15 @@
permission="zope.ManageContent"
/>
+ <configure package="z3c.reference.browser">
<page
- for="zope.app.component.interfaces.ISite"
- name="picker.html"
- class=".views.Picker"
+ name="viewReferenceEditor.html"
+ for="z3c.reference.demo.interfaces.IDemoFolder"
+ class=".views.ViewReferenceEditor"
permission="zope.ManageContent"
template="picker.pt"
/>
+ </configure>
<!-- test -->
<pages
Deleted: z3c.reference/branches/flash/src/z3c/reference/demo/browser/picker.pt
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/demo/browser/picker.pt 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/demo/browser/picker.pt 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,189 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:i18n="http://namespaces.zope.org/i18n"
- xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>demo picker</title>
- <style type="text/css">
- body {
- margin: 0px;
- padding: 0px;
- height: 100%;
- font-family: 'Trebuchet MS';
- font-size: 10pt;
- }
-
- a {
- color: #000;
- }
-
- a.ex1, a.ex2 {
- color: #888;
- text-decoration: none;
- }
-
- div {
- margin: 0px;
- }
-
- div.float {
- position: absolute;
- padding: 0px 10px;
- border: 0px solid #888;
- border-right-width: 1px;
- float:left;
- height: 100%
- }
-
- div.picker {
- width: 150px;
- }
-
- div.properties {
- position: absolute;
- left: 170px;
- width: 200px;
- }
-
- div.image-tool {
- position: absolute;
- left: 390px;
- width: 500px;
- }
-
- div.actions {
- position: absolute;
- left: 910px;
- padding: 0px 10px;
- }
-
- h1 {
- font-size: 12pt;
- margin: 10px 0px;
- }
-
- label {
- width: 80px;
- }
-
- input, textarea {
- width: 196px;
- }
-
- </style>
- <script src="jquery"
- type="text/javascript"
- tal:attributes="src context/++resource++jquery.js">
- </script>
- <script type="text/javascript"
- tal:content="string:
- function loadFlash() {
- var url='${context/++resource++imagetool.swf}';
- var img='${context/++resource++img.jpg}';
- url = url + '?url=' + img;
- var so = new SWFObject(url, 'image-tool', '100%', '490px', '8', '#FFFFFF');
- so.addParam('allowScriptAccess', 'sameDomain');
- so.addParam('movie', url);
- so.addParam('quality', 'high');
- so.addVariable('crop_x', '100');
- so.addVariable('crop_y', '100');
- so.addVariable('crop_w', '100');
- so.addVariable('crop_h', '100');
- //so.addVariable('original_w', '600');
- //so.addVariable('original_h', '400');
- so.addVariable('zoomfactor', '0.33');
- so.addVariable('rotation', '0');
- var ok = so.write('flash-target');
- }
- ">
- </script>
- <script type="text/javascript">
- $(document).ready(loadFlash);
-
- // user selects an item
- function setIntId(uid) {
- // reset values
- $("textarea").val("");
- $("input[@type=text]").val("");
- // set iniid of selected item
- $("input[@name=intid]").val(uid);
- // highlight selected item
- $("a").attr("style", "");
- $("a[@href*=" + uid + "]").attr("style","background-color: #888");
- // show divs
- $("div.properties").show();
- // $("div.actions").show();
- // $("div.image-tool").show();
- }
-
-
- $(document).ready(function(){
- // pressed submit button
- // return selected item to parent and close popup
- $("input[@type=submit]").click(function() {
- var intid = $("input[@name=intid]").val();
- window.opener.setIntId(intid);
- window.close();
- });
-
- $("a.target").click(function() {
- $("div.actions").hide();
- $("div.image-tool").hide();
- $("a.ex1").show();
- $("a.ex2").show();
- window.resizeTo(171, 550);
- window.resizeBy(220, 0);
- });
-
- $("a.ex1").click(function() {
- $("a.ex1").hide();
- $("div.image-tool").show();
- window.resizeBy(520, 0);
- });
-
- $("a.ex2").click(function() {
- $("a.ex2").hide();
- $("div.actions").show();
- window.resizeBy(220, 0);
- });
- });
- </script>
- </head>
- <body>
- <div class="picker float">
- <input name="intid" type="hidden" value="None" />
- <h1>Targets</h1>
- <tal:block repeat="item view/items">
- <a href="#" class="target"
- tal:attributes="href string:JavaScript:setIntId(${item/uid})">
- <span tal:replace="item/name" />
- </a>
- <br />
- </tal:block>
- </div>
- <div class="properties float" style="display:none;">
- <h1>
- Properties
- <a href="#" class="ex1">>></a>
- </h1>
- <label for="title">Title</label><br />
- <input id="title" name="title" type="text" /><br />
- <label for="description">Description</label><br />
- <textarea id="description" name="description"
- cols="20" rows="5"
- >abcd</textarea>
- </div>
- <div class="image-tool float" style="display:none;">
- <h1>
- Image-Tool
- <a href="#" class="ex2">>></a>
- </h1>
- <div id="flash-target"></div>
- </div>
- <div class="actions" style="display:none;">
- <h1>Save</h1>
- <input type="submit" value="add reference" />
- </div>
- </body>
-</html>
\ No newline at end of file
Modified: z3c.reference/branches/flash/src/z3c/reference/demo/browser/tests.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/demo/browser/tests.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/demo/browser/tests.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,4 +1,20 @@
-__docformat__ = "reStructuredText"
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 72084 2007-01-18 01:02:26Z rogerineichen $
+"""
+__docformat__ = 'restructuredtext'
import unittest
from zope.app.testing import functional
Modified: z3c.reference/branches/flash/src/z3c/reference/demo/browser/views.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/demo/browser/views.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/demo/browser/views.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,3 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 72084 2007-01-18 01:02:26Z rogerineichen $
+"""
+__docformat__ = 'restructuredtext'
+
from zope import interface
from zope.formlib import form
from zope.dublincore.interfaces import IWriteZopeDublinCore
@@ -20,23 +38,6 @@
form_fields = form.Fields(IDemoImage)
-
-class Picker(object):
- def items(self):
- intIds = component.getUtility(IIntIds)
- for o in self.context.values():
- # skip intid
- if str(o.__class__) == u"<class 'zope.app.intid.IntIds'>":
- continue
- yield dict(
- name = o.__name__,
- uid=intIds.getId(o))
-
- @property
- def url(self):
- return absoluteURL(self.context, self.request)
-
-
# temp
class Test(object):
def test(self):
Modified: z3c.reference/branches/flash/src/z3c/reference/demo/interfaces.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/demo/interfaces.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/demo/interfaces.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -20,15 +20,20 @@
from z3c.reference.interfaces import IViewReference
from z3c.reference.schema import ViewReferenceField
+
class IDemoFolder(interface.Interface):
""" demo folder"""
- previewImage = ViewReferenceField(viewName=u"",
- title=u"previewImage",
- required=False)
- #assets = schema.List(title=u"Related",
- # value_type=ViewReferenceField(u'demosettings'),
- # required=False,
- # default=[])
+
+ previewImage = ViewReferenceField(
+ title=u'previewImage',
+ required=False,
+ viewName=u'')
+
+ assets = schema.List(
+ title=u'Related',
+ value_type=ViewReferenceField(viewName=u''),
+ required=False,
+ default=[])
class IDemoImage(interface.Interface):
Modified: z3c.reference/branches/flash/src/z3c/reference/demo/tests.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/demo/tests.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/demo/tests.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,12 +1,30 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id: __init__.py 72084 2007-01-18 01:02:26Z rogerineichen $
+"""
+__docformat__ = 'restructuredtext'
+
import doctest
import unittest
+from zope import component
+from zope.dublincore.annotatableadapter import ZDCAnnotatableAdapter
+from zope.dublincore.interfaces import IWriteZopeDublinCore
from zope.testing.doctestunit import DocFileSuite, DocTestSuite
from zope.app.testing import setup
from zope.app.intid import IntIds
from zope.app.intid.interfaces import IIntIds
-from zope import component
-from zope.dublincore.annotatableadapter import ZDCAnnotatableAdapter
-from zope.dublincore.interfaces import IWriteZopeDublinCore
from zope.app.keyreference.testing import SimpleKeyReference
from lovely.relation import configurator
Modified: z3c.reference/branches/flash/src/z3c/reference/interfaces.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/interfaces.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/interfaces.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,3 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
from zope import interface,schema
from zope.location.interfaces import ILocation
from zope.app.file.interfaces import IImage
@@ -38,7 +56,7 @@
class IViewReferenceField(schema.interfaces.IObject):
"""a view reference field"""
- settings = schema.TextLine(title=u"Settings",
+ viewName = schema.TextLine(title=u"Settings",
required=False)
Modified: z3c.reference/branches/flash/src/z3c/reference/reference.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/reference.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/reference.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,3 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
from interfaces import *
from persistent import Persistent
from zope.schema.fieldproperty import FieldProperty
@@ -9,6 +27,8 @@
import urlparse,cgi
from lovely.relation.property import (FieldRelationManager,
RelationPropertyOut)
+
+
viewReferenceRelated = FieldRelationManager(IViewReference['target'],
IReferenced['viewReferences'])
Modified: z3c.reference/branches/flash/src/z3c/reference/schema.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/schema.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/schema.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -28,7 +28,7 @@
super(ViewReferenceField,self).__init__(IViewReference,
**kw)
-
+
class ViewReferenceProperty(property):
"""A property that takes care of setting __parent__ for all reference
objects when being set on the content object.
Modified: z3c.reference/branches/flash/src/z3c/reference/tests.py
===================================================================
--- z3c.reference/branches/flash/src/z3c/reference/tests.py 2007-09-04 15:37:44 UTC (rev 79461)
+++ z3c.reference/branches/flash/src/z3c/reference/tests.py 2007-09-04 16:14:53 UTC (rev 79462)
@@ -1,3 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
import doctest
import unittest
from zope.testing.doctestunit import DocFileSuite, DocTestSuite
More information about the Checkins
mailing list