[Zope3-Users] Installation Erros
/SetTemplate.c:266: warning: pointer targets in passing argument 1 of ‘PyString_FromStringAndSize’ differ in signedness In file included from Dependencies/BTrees-Zope-3.1.0b1/BTrees/BTreeModuleTemplate.c:338, from Dependencies/BTrees-Zope-3.1.0b1/BTrees/_fsBTree.c:70: Dependencies/BTrees-Zope-3.1.0b1/BTrees/BTreeTemplate.c: In function ‘BTree_getstate’: Dependencies/BTrees-Zope-3.1.0b1/BTrees/BTreeTemplate.c:953: warning: pointer targets in passing argument 1 of ‘PyString_FromStringAndSize’ differ in signedness Dependencies/BTrees-Zope-3.1.0b1/BTrees/BTreeTemplate.c: In function ‘BTree_maxminKey’: Dependencies/BTrees-Zope-3.1.0b1/BTrees/BTreeTemplate.c:1388: warning: pointer targets in passing argument 1 of ‘PyString_FromStringAndSize’ differ in signedness Dependencies/BTrees-Zope-3.1.0b1/BTrees/BTreeTemplate.c: In function ‘BTree_byValue’: Dependencies/BTrees-Zope-3.1.0b1/BTrees/BTreeTemplate.c:1638: warning: pointer targets in passing argument 1 of ‘PyString_FromStringAndSize’ differ in signedness Dependencies/BTrees-Zope-3.1.0b1/BTrees/BTreeTemplate.c:1644: warning: pointer targets in passing argument 1 of ‘PyString_FromStringAndSize’ differ in signedness bash-3.00$ *** ..and the last several lines of 'make check' Error in test test_3 (zope.pagetemplate.tests.test_htmltests.HTMLTests) Traceback (most recent call last): File /opt/Zope/Zope-3.1.0b1/build/lib.linux-i686-2.3/zope/pagetemplate/tests/test_htmltests.py, line 66, in test_3 t.write(util.read_input('teeshop1.html')) File /opt/Zope/Zope-3.1.0b1/build/lib.linux-i686-2.3/zope/pagetemplate/tests/util.py, line 107, in read_input return open(filename, 'r').read() IOError: [Errno 2] No such file or directory: '/opt/Zope/Zope-3.1.0b1/build/lib.linux-i686-2.3/zope/pagetemplate/tests/input/teeshop1.html' .. Error in test testDocumentClass (zope.structuredtext.tests.StngTests) Traceback (most recent call last): File /opt/Zope/Zope-3.1.0b1/build/lib.linux-i686-2.3/zope/structuredtext/tests.py, line 46, in testDocumentClass raw_text = readFile(regressions, f) File /opt/Zope/Zope-3.1.0b1/build/lib.linux-i686-2.3/zope/structuredtext/tests.py, line 34, in readFile myfile = open(os.path.join(dirname, fname), r) IOError: [Errno 2] No such file or directory: '/opt/Zope/Zope-3.1.0b1/build/lib.linux-i686-2.3/zope/structuredtext/regressions/index.stx' Error in test testRegressionsTests (zope.structuredtext.tests.StngTests) Traceback (most recent call last): File /opt/Zope/Zope-3.1.0b1/build/lib.linux-i686-2.3/zope/structuredtext/tests.py, line 53, in testRegressionsTests raw_text = readFile(regressions, f) File /opt/Zope/Zope-3.1.0b1/build/lib.linux-i686-2.3/zope/structuredtext/tests.py, line 34, in readFile myfile = open(os.path.join(dirname, fname), r) IOError: [Errno 2] No such file or directory: '/opt/Zope/Zope-3.1.0b1/build/lib.linux-i686-2.3/zope/structuredtext/regressions/index.stx' ...-- Ran 6408 tests in 466.171s FAILED (failures=3, errors=19) make: *** [check] Error 1 bash-3.00$ ** -- Tim Cook, Consultant CHASE Health Informatics, Inc. GPG Key is on key servers everywhere. signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Installation Erros
On Sat, 2005-07-09 at 09:49 -0400, Tim Peters wrote: [Tim Cook] Installing Zope-3.1.0b1 on Fedora Core 4 gcc (GCC) 4.0.0 20050519 (Red Hat 4.0.0-8) ... This is the only interesting part. It might help if you posted again, skipping all the compiler warnings (which aren't interesting), and gave the full output from `make check`. Hi All, I finally had a chance to look at this again. The results are in a text file on Zope.org. (it was too large to post to the list) http://www.zope.org/Members/tcook/check_results I'm not sure how soon it will be published. The problem is that there are several source files that end in .p instead of .py. My first clue was the first lines that said these tests weren't packages. I thought someone just forgot the init files. Nope, they were there, just missing a y in the filename. There are also misnamed .html and .stx files. Same problem, dropped last character. I checked the archive (Zope-3.1.0b1.tgz) and the files are misnamed in there. Obviously someone needs to create a new Linux distribution, eh! g Cheers, -- Tim Cook signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] problems with installation of zope3
On Wed, 2005-07-20 at 09:09 -0600, gf wrote: Hi, I just downloaded zope3 ( ZopeX3-3.0.0.tar.gz) and issued the 'configure', and 'make' commands. When I try a 'make check', I get multiple errors (see bottom of message). I am including below the output from what I think are relevant commands. I'd appreciate any help you can provide in diagnosing these errors. Is this relevant? http://www.zope.org/Collectors/Zope/1334 again, this may or may not lead you to a hint: http://zopewiki.org/HowToRunZopeUnitTests/src If you google the OSError: [Errno 10] No child processes you'll find more references to Python 2.3.4 and that error... But, my suggestion is to install Python 2.3.5 and Zope 3.1.0b unless you have some burning reason to install the experimental version. Cheers, -- Tim Cook, Consultant CHASE Health Informatics, Inc. GPG Key is on key servers everywhere. signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] at sea with basic setup
On Fri, 2005-11-04 at 19:32 -0800, Ross Boylan wrote: I'd like to create some users, set authentication methods, and so on. After a lot of fooling around with the GUI and looking at various docs, I conclude I have no idea what's going on. ... I'd appreciate some pointers. Best tip is to read this: http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/FrontPage/Zope3Book Then go out and buy a hard copy. Cheers, -- Tim Cook, Consultant CHASE Health Informatics, Inc. GnuPG Key is available at http://www.chasehealthinformatics.com/Members/twcook signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Convention Question
Does z3c stand for Zope 3 Component? Thanks, Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Convention Question
Does z3c stand for Zope 3 Component? Thanks, Tim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Convention Question
Thanks for the answer. I should have explained why I wanted to know. I've been away from Zope 3 or 4 years (so I missed those emails) and I am now tasked with preparing a workshop for next year (as I re-learn everything too). I know that is one of the questions I'll get. So, I wanted to be able to answer it. Though they carry no semantic significance, namespaces do always have a root. Cheers, Tim On Thu, 2007-07-19 at 11:28 -0400, Benji York wrote: Tim Cook wrote: Does z3c stand for Zope 3 Component? It stands for Zope 3 community, but (IMO), name space package names, while mnemonic, don't actually confer meaning. In other words, just because Zope Corp uses zc. as our name space doesn't mean anything other than we were the ones that created the project. Summary: name space packages are just for uniquifying package names. -- Timothy Cook, MSc Health Informatics Research Services http://home.comcast.net/~tw_cook/ 01-904-322-8582 signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] zopeproject install failure
Linux x86_64 Python 2.5.1 (r251:54863, Sep 17 2007, 10:13:22) [GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2 There are numerous warning: initialization from incompatible pointer type when compiling the .c modules. When I built Python 2.5.1 I had to use the CFLAG -fwrapv Is this the same issue? If so, where can I add that flag so the zope .c files will be compiled correctly? What happens is that the process builds and the server will start but when you execute a request (http://localhost:8080) you end up getting a MemoryError --- /buildout-eggs/tmpUBM6Io/zope.app.container-3.5.0a1-py2.5-linux-x86_64.egg/zope/app/container/browser/contents.py, line 120, in _normalListContentsInfo MemoryError -- Complete Traceback attached. Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services http://timothywayne.cook.googlepages.com/home 01-904-322-8582 Platform: Python 2.5.1 (r251:54863, Sep 12 2007, 09:06:03) [GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2 [EMAIL PROTECTED] WebApp]$ bin/webapp-ctl fg bin/paster serve deploy.ini /home/tim/buildout-eggs/zope.configuration-3.4.0b1-py2.5.egg/zope/configuration/config.py:182: DeprecationWarning: the gopherlib module is deprecated mod = __import__(mname, *_import_chickens) Starting server in PID 7641. serving on http://127.0.0.1:8080 -- 2007-09-17T09:15:31 ERROR SiteError http://127.0.0.1:8080/@@index.html Traceback (most recent call last): File /home/tim/buildout-eggs/tmpGF47n7/zope.publisher-3.5.0a1.dev_r78838-py2.5.egg/zope/publisher/publish.py, line 133, in publish File /home/tim/buildout-eggs/tmptGyD29/zope.app.publication-3.4.0a1_2-py2.5.egg/zope/app/publication/zopepublication.py, line 167, in callObject File /home/tim/buildout-eggs/tmpGF47n7/zope.publisher-3.5.0a1.dev_r78838-py2.5.egg/zope/publisher/publish.py, line 108, in mapply - __traceback_info__: bound method Contents.index of zope.app.publisher.browser.viewmeta.Contents object at 0x25df610 File /home/tim/buildout-eggs/tmpGF47n7/zope.publisher-3.5.0a1.dev_r78838-py2.5.egg/zope/publisher/publish.py, line 114, in debug_call File /home/tim/buildout-eggs/tmpUBM6Io/zope.app.container-3.5.0a1-py2.5-linux-x86_64.egg/zope/app/container/browser/contents.py, line 439, in index File /home/tim/buildout-eggs/tmpXtcwY7/zope.app.pagetemplate-3.4.0b1dev_r75616-py2.5.egg/zope/app/pagetemplate/viewpagetemplatefile.py, line 83, in __call__ File /home/tim/buildout-eggs/tmpXtcwY7/zope.app.pagetemplate-3.4.0b1dev_r75616-py2.5.egg/zope/app/pagetemplate/viewpagetemplatefile.py, line 51, in __call__ File /home/tim/buildout-eggs/tmpudHd93/zope.pagetemplate-3.4.0a1-py2.5.egg/zope/pagetemplate/pagetemplate.py, line 115, in pt_render File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 271, in __call__ File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 346, in interpret File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 891, in do_useMacro File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 346, in interpret File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 536, in do_optTag_tal File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 521, in do_optTag File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 516, in no_tag File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 346, in interpret File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 861, in do_defineMacro File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 346, in interpret File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 957, in do_defineSlot File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 346, in interpret File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 949, in do_defineSlot File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 346, in interpret File /home/tim/buildout-eggs/tmpM4Z-gT/zope.tal-3.4.0b1-py2.5.egg/zope/tal/talinterpreter.py, line 822, in do_loop_tal File /home/tim/buildout-eggs/tmp4nmVnm/zope.tales-3.4.0a1-py2.5.egg/zope/tales/tales.py, line 682, in setRepeat File /home/tim/buildout-eggs/tmp4nmVnm/zope.tales-3.4.0a1-py2.5.egg/zope/tales/tales.py, line 696, in evaluate - /home/tim/buildout-eggs/zope.app.container-3.5.0a1-py2.5-linux-x86_64.egg/zope/app/container/browser/index.pt - Line 36, Column 6 - Expression: PathExpr
Python 2.5.1 on x86_64 was: [Zope3-Users] Re: zopeproject install failure
On Mon, 2007-09-17 at 14:01 +0200, Philipp von Weitershausen wrote: There are numerous warning: initialization from incompatible pointer type when compiling the .c modules. Yup. Mostly if not only from the ZODB. There and from BTree/* When I built Python 2.5.1 I had to use the CFLAG -fwrapv Is this the same issue? If so, where can I add that flag so the zope .c files will be compiled correctly? What does that flag do? From the GCC manual: Using ‘-fwrapv’ means that signed overflow is fully defined: it wraps. When ‘-fwrapv’ is used, there is no difference between‘-fstrict-overflow’ and ‘-fno-strict-overflow’. With ‘-fwrapv’ certain types of overflow are permitted. For example, if the compiler gets an overflow when doing arithmetic on constants, the overflowed value can still be used with ‘-fwrapv’, but not otherwise. I can compile my stuff with Python 2.5.1 just fine. Which GCC is it built with? I've heard of another report where a MemoryError would occur with PYthon 2.5 on Linux x86 64bit. I don't have access to such a machine, unfortunately. It would be great if somebody with some C debugging skills could check this out. It might already be good to know whether it only occurs with zope.app.container, or also with other module that have C extensions. Probably any C code. Note, this isn't a bug of zopeproject :). It just shows that Python 2.4 is still the only blessed platform, for a good reason. You are correct and I shouldn't have used that subject line. I was ready to prove that it wasn't the Pythoon version but the GCC. So I installed Python 2.4.4 using GCC 4.1.2 and expected the exact same failures. I was wrong. It works as advertised. Hmm. Now I'm really confused. But; I haven't the skills to fix it. This is just so that others may see that even though some people are successful with Zope 3.4.x / Python 2.5.1 it may be a platform dependency issue as well. Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services http://timothywayne.cook.googlepages.com/home 01-904-322-8582 ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] An Interesting Podcast
For all of you that know (or don't know) Rob Page this is an interesting podcast: http://itc.conversationsnetwork.org/shows/detail3464.html Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Schema Fields
Hi All, I am having a problem creating new schema fields. I believe my answer may lie with classImplements in defining my interfaces but I've tried several things and had no success. I have posted an example of the issue and a description at: http://zope.pastey.net/87968 Thanks for any help. -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: Schema Fields
On Sat, 2008-05-17 at 13:40 -0300, Tim Cook wrote: Hi All, I am having a problem creating new schema fields. I believe my answer may lie with classImplements in defining my interfaces but I've tried several things and had no success. Answering myself.. Never mind. It was just ONE OF THOSE DAYS! :-) Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Best Practices - Zopeproject Deployment
Hi All, I have a Zope3 project that I started using 'zopeproject'. I now want to deploy this to an SVN server so other developers can checkout and work on the project. After reviewing the zopeproject and buildout docs as well as some examples like z3hello I still cannot decide the correct settings for SVN admin so that I ignore the correct things and yet still give the new developers all of the configuration requirements. For example I want to included my buildout.cfg so they can get all of the dependencies that are not listed in the default one from zopeproject. I also want to include my site.zcml. In my Linux installation instructions I have: Install Python-2.4.x Download and install virtual_env python24 virtual_env SANDBOX cd SANDBOX source bin/activate svn co url to svn server and application source Here is where the problem is though. Should I have the user install a zopeproject here first so that they get the correct paths setup? What should I do about having each user install the correct buildout.cfg since it has hard-coded paths to my egg repository? zopeproject was great for me getting started but now I am not certain how to deploy this application since it is an application framework for other developers. I would like to have an 'oship-project' like zopeproject/grokproject but that will have to wait I think. Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Best Practices - Zopeproject Deployment
Hi Christophe, Thanks for your reply. Maybe my question is naive? For background my original zopeproject looked like this below the virtualenv dir: oship-- bin develop-eggs log parts src-- oship (where all the good stuff is located) oship.egg-info var apidoc.zcml buildout.cfg debug.ini deploy.ini setup.py zdaemon.conf zope.conf .installed.cfg Creating a new space using zopeproject --no-buildout oship yields this: oship-- log src-- oship (where all the good stuff will be located) oship.egg-info var apidoc.zcml buildout.cfg debug.ini deploy.ini setup.py zdaemon.conf zope.conf .installed.cfg So I want to commit 'oship' as the top level dir whihc will include all of the above files/dirs? On Sat, 2008-05-24 at 17:58 +0200, Christophe Combelles wrote: You should start your project with zopeproject --no-buildout, then commit all the files to the svn. Okay. This prevents the buildout-generated files from being included in the svn. Except for the buildout.cfg which is really my question. I have added some dependencies to this file that are not part of the normal Zope buildout (Pyparsing,mglob, etc) and it has my system specific path to my buildout-eggs (eggs-directory = /home/tim/buildout-eggs). Also my site.zcml files will be different from the zopeproject generated one because it needs to include directives for the app I am delivering. Then your users just have to svn co the project and launch the buildout to generate the remaining files. The developpers don't even need to know that you used zopeproject, this is just a buildout at the end. So, I am now thinking that I will have to have instructions in my installation instructions that tell developers to edit the 'eggs-directory' line; correct? Also they will need to install buildout (or zopeproject) and create a project space before doing the checkout? (I think I am very confused) Granted that these are developers and it shouldn't be a problem. I am just trying to be as black and white as possible since my audience typically is the Zope developer community and we all know that those that have no seen the light (or drank the kool-aid) have adverse reactions to Zopish things. :-) I just want to be as transparent as possible for developers and eventually for users as well. Thanks, Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Best Practices - Zopeproject Deployment
Hi Kevin, On Mon, 2008-05-26 at 16:58 -0700, Kevin Teague wrote: You can avoid storing user specific information in your buildout.cfg by creating a ~/.buildout/default.cfg file in your home directory that contains user specific information: [buildout] eggs-directory = /Users/kteague/buildouts/shared/eggs Yep, I did that. If you leave the eggs-directory line out of a buildout.cfg, and it doesn't exist within a developer's ~/.buildout/default.cfg file, then buildout will simply create an eggs directory inside the project and put all of the eggs there. AH HA! My 2 brain cells didn't communicate the fact that I could just leave it out of the buildout.cfg and it would be recreated on their installation. Thanks, Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] ANN: Open Source Health Information Platform (OSHIP)
The wiki announcing the initial source code release of OSHIP is available at: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page Including links to installation and initial startup. There is a news release on Linux Medical News that contains more background and project justification information: http://linuxmednews.com/1212171292/index_html I am inviting expert discussion on the circular import issues due to the desire to adhere as closely to the openEHR specifications as possible. The issues are in the interfaces being implemented with schema types that are the same or at least in the same packages as the implementations of those classes. http://www.openehr.org/svn/ref_impl_python/TRUNK/oship/src/oship/openehr/rm/datatypes/interfaces Thanks for your comments. --Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] z3cformdemo w/zopeproject
In the zopeproject instructions for adding dependencies the indication is that (once the egg is installed) I would just have to add it to the configure.zcml But ... !-- Add your own component registrations here -- include package=z3c.formdemo / yields this configuration error: ZopeXMLConfigurationError: File /home/tim/buildout-eggs/z3c.formdemo-1.5.1-py2.4.egg/z3c/formdemo/configure.zcml, line 11.2-11.29 ZopeXMLConfigurationError: File /home/tim/buildout-eggs/z3c.formdemo-1.5.1-py2.4.egg/z3c/formdemo/skin/configure.zcml, line 22.2 ConfigurationError: ('Unknown directive', u'http://namespaces.zope.org/browser', u'zrt-resource') I looks like zrt-resource and everything else that z3c.formdemo needs is defined in application.zcml but is not it isn't registered in z3c.formdemo/configure.zcml So now I added it to my zopeproject/configure.zcml !-- Add your own component registrations here -- include package=z3c.formdemo file=application.zcml/ include package=z3c.formdemo / File /home/tim/buildout-eggs/z3c.formdemo-1.5.1-py2.4.egg/z3c/formdemo/application.zcml, line 23.2-23.47 browser:menu id=zmi_views title=Views / File /home/tim/buildout-eggs/zope.app.zcmlfiles-3.4.3-py2.4.egg/zope/app/zcmlfiles/menus.zcml, line 5.2-9.8 menu id=zmi_views title=Views description=Menu for displaying alternate representations of an object / So by now I am certain that there is something very fundamental about this third-party registration process that I don't understand. Any help is appreciated. --Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Python Package Construction
Hi All, I would like feedback on the proper/best 'Pythonic' approach. This is a rather subjective question. Where is the trade-off between package name lengths and faithfulness to the specifications? [Discussion follows] I am implementing a set of specifications for healthcare IT for Python programmers to be able to develop interoperable healthcare applications. I am using ZCA (aka.Zope3) extensively. My desire is to implement the specs as faithfully as possible for two reasons: 1) teachability - how easy/difficult is it to teach the framework and specifications to new developers? 2) maintainability - which approach, if either, will make it easier to maintain the framework if/when the specifications change? My first pass was to develop a skeleton of the specs using Interfaces from the ZCA approach and then the implementations following the document structure of the specs. The specs are available via SVN at: http://www.openehr.org/svn/specification/TRUNK/publishing/architecture/ It is best to probably use real examples. Following the document structure for packaging AND using the ZCA convention of having a sub-directory for interfaces caused massive circular import issues due to some classes being used in the interface definition of classes inside the same interface file being imported into the implementation file. If that sounds confusing; it is. It was confusing to write too. :-) If anyone has questions I'll try to expand. It is best to probably use specific, real examples. http://www.openehr.org/svn/specification/TRUNK/publishing/architecture/rm/data_types_im.pdf (note class names are converted from the upper case, underscore separated style to CamelCase) The package openehr.rm.datatypes.text defines the implementation class CodePhrase. The associated interface file openehr.rm.datatypes.interfaces.text needed CodePhrase as an attribute type in DvCodedText and TermMapping needs both CodePhrase and DvCodedText. This quickly got out of control. So my solution to solving the circular imports is to take each interface and implementation and put them into one file. Research tells me that this is probably the second mostly popular ZCA approach. So, ICodePhrase and CodePhrase are now in openehr/rm/datatypes/codephrase.py, DvCodeText and IDvCodedText in openehr/rm/datatypes/dvcodedtext.py, etc. But wait, now I don't have a 'text package'. So if codephrase.py and dvcodedtext.py were in openehr/rm/datatypes/text/ that would solve the problem. BUT! Throughout the specs many of the names are VERY long already. Adding another package name that is from 4 - 15 (or more) characters long adds to the length of already long import statements, i.e. (sorry for the email line wraps) from openehr.am.archetype.creferenceobject import ICReferenceObject,CReferenceObject should really be from openehr.am.archetype.constraintmodel.creferenceobject import ICReferenceObject,CReferenceObject Thoughts, opinions and jeers all gratefully accepted. :-) --Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] zope.interface.exceptions.InvalidInterface: Concrete attribute, existence
Hi All, [Zope3 on Linux, Python 2.4.4] I've been chasing a problem for a couple of days and I just can't figure out what the error is telling me. Thanks for any pointers. Google hasn't been much help as it mostly returns the source for the error or one conversation from 2004 discussing implementing Interfaces. The offending source code can be seen in this package: http://www.openehr.org/wsvn/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/?rev=0sc=0 At first I thought this was a circular import problem but now I am thinking that it may be a fundamental misunderstanding on my part in how to use Interfaces. I am currently inheriting an Interface from an associated Interface and then also inheriting the associated classes the same way. The problem begins when I attempt to import 'Archetype' which implements IArchetype. The full traceback is below but here is a synopsis: IArchetype has an attribute 'definition' which is a CComplexObject type CComplexObject implements ICComplexObject and inherits from CDefinedObject ICComplexObject inherits from ICDefinedObject CComplexObject inherits from CDefinedObject and implements ICComplexObject CDefinedObject inherits from CObject CObject has an attribute 'parent' which is a CAttribute type CAttribute inherits from Field and implements ICAttribute ICAttribute inherits from IField Traceback (most recent call last): File load_ar.py, line 183, in ? from atbldr.atbldr import CreateAT File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/atbldr/atbldr.py, line 49, in ? from openehr.am.archetype.archetype import Archetype File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/archetype.py, line 23, in ? from interfaces.archetype import IArchetype File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/interfaces/archetype.py, line 23, in ? from openehr.am.archetype.constraintmodel.ccomplexobject import CComplexObject File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/constraintmodel/ccomplexobject.py, line 23, in ? from interfaces.ccomplexobject import ICComplexObject File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/constraintmodel/interfaces/ccomplexobject.py, line 23, in ? from cdefinedobject import ICDefinedObject File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/constraintmodel/interfaces/cdefinedobject.py, line 23, in ? from cobject import ICObject File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/constraintmodel/interfaces/cobject.py, line 25, in ? from openehr.am.archetype.constraintmodel.cattribute import CAttribute File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/constraintmodel/cattribute.py, line 24, in ? from interfaces.cattribute import ICAttribute File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/constraintmodel/interfaces/cattribute.py, line 28, in ? class ICAttribute(IField): File /home/tim/buildout-eggs/tmpJ-oHMS/zope.interface-3.4.1-py2.4-linux-x86_64.egg/zope/interface/interface.py, line 488, in __init__ zope.interface.exceptions.InvalidInterface: Concrete attribute, existence -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] zope.interface.exceptions.InvalidInterface: Concrete attribute, existence
On Thu, 2008-07-03 at 14:08 -0400, Benji York wrote: On Thu, Jul 3, 2008 at 1:34 PM, Tim Cook [EMAIL PROTECTED] wrote: I've been chasing a problem for a couple of days and I just can't figure out what the error is telling me. Thanks for any pointers. It looks like the immediate problem is that oship.openehr.rm.support.interval.Interval is not a field. Thanks! That fixed that error. But I have NO IDEA how you arrived at that observation. Can you enlighten me? Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] zope.interface.exceptions.InvalidInterface: Concrete attribute, existence
On Thu, 2008-07-03 at 14:37 -0400, Benji York wrote: The last bit of user code in the traceback is attempting to define ICAttribute, I looked at it, noticed it had three attributes, one of which was referred to in the traceback (existence). The only bit of user code there was Interval, so I looked at it's definition and noticed that it didn't inherit from anything or provide any interfaces. Is there any way in which I might enlighten you further? :) Nope! You did a great job! I wasn't observant enough to catch that 'existence' was an attribute name. DUH! Thanks Again, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] zope.schema Question
I have a class attribute defined in an interface as such: description=Object( title=_(uDescription), description=_(uDescription of the activity.), required=True, ) I used Object because this attribute can be one of several different class instances. But I get an error: TypeError: __init__() takes exactly 2 non-keyword arguments (1 given) When the implementation is attempting to import the interface. But if I enter a default=None or description=Object(None, title=_(uDescription), description=_(uDescription of the activity.), required=True, ) I get: File /home/tim/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_field.py, line 453, in __init__ raise WrongType zope.schema._bootstrapinterfaces.WrongType I do not have these issues using many of the other zope.schema types. Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: zope.schema Question
On Mon, 2008-07-07 at 00:46 +0200, Philipp von Weitershausen wrote: description=Object( schema=IFoo, ... ) So the zope.schema.Object field is really about specifying objects that provide a certain schema. It's not for *arbitrary* objects (use zope.schema.Field or zope.interface.Attribute here). Thanks Philipp. Field doesn't work because it expects a unicode type. Attribute works but I would like to be able to flag it as 'required' which is not part of the Attribute class. Object would work if it would allow types that subclass from the schema given. A concrete example: IItemStructure(Interface) IItemTree(IItemStructure) IItemTable(IItemStructure) ... ItemTree(ItemStructure) implements(IItemTree) ItemTable(ItemStructure) implements(IItemTable) ... Now I want to allow description to be any descendant of ItemStructure. So I had hoped that: description=Object( schema=IItemStructure, title=_(uDescription), description=_(uDescription of the activity.), required=True, ) would provide that functionality. It still throws a WrongTypeError. I feel like the answer lies somewhere in the zope.interface.implement* functions but I lack the Zen to get the right combination. Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: zope.schema Question
On Mon, 2008-07-07 at 09:56 +0200, Philipp von Weitershausen wrote: Now I want to allow description to be any descendant of ItemStructure. So I had hoped that: description=Object( schema=IItemStructure, title=_(uDescription), description=_(uDescription of the activity.), required=True, ) would provide that functionality. It still throws a WrongTypeError. The declaration looks ok. What throws a WrongTypeError where? I feel like the answer lies somewhere in the zope.interface.implement* functions but I lack the Zen to get the right combination. It's hard to tell w/o knowing what actually throws the exception. I think I was misreading the traceback. In stepping through the debugger I was able to determine that the type 'unicode' in the error is referring to description entries several layers up the inheritance tree. I had copy/pasted a lot of this from the specifications document and there are the strange backwards single and double quote characters in the text. The documents were created with Framemaker and then saved to PDF. So once I remove all those characters I can get back to the task at hand. Am I correct in thinking that the above definition of Activity.description will constrain the possible types to the classes implementing IItemStructure or a subclass of it? BTW: The traceback is below. I don't think it would have been possible to find this without stepping through the debugger and watching the stack data. Cheers, Tim File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/atbldr/bldinstruction.py, line 28, in bldInstruction actObj=bldActivity(activities,errlog,ontology) File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/atbldr/bldactivity.py, line 38, in bldActivity actObj=Activity(descr,timing,actionArchetypeId,nodeid) File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/openehr/rm/ehr/composition/content/entry/activity.py, line 40, in __init__ self.description=descr File /home/tim/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/fieldproperty.py, line 52, in __set__ field.validate(value) File /home/tim/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_bootstrapfields.py, line 138, in validate self._validate(value) File /home/tim/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_bootstrapfields.py, line 263, in _validate super(MinMaxLen, self)._validate(value) File /home/tim/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_bootstrapfields.py, line 165, in _validate raise WrongType(value, self._type) zope.schema._bootstrapinterfaces.WrongType: (openehr.rm.datastructures.itemstructure.itemtree.ItemTree object at 0x7f4b3be6f610, type 'unicode') ( -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: zope.schema Question
Answering my own questions: On Mon, 2008-07-07 at 10:20 -0300, Tim Cook wrote: All of my source files have the unicode declaration: # -*- coding: utf-8 -*- as the first line. Do those strings inside the list have to be marked as unicode? for example: [([u'include', ([([u'archetype_id/value', ([u'/disposition\\.v1draft/'], {})], {})], {})], {})] After flattening the nested construct and unicode converting the strings: [u'include', u'archetype_id/value', u'/disposition\\.v1draft/'] Same problem. If so; if I remove the unicode declaration will that prevent this error? Nope! Now I don't know where to search for the problem. Any ideas? -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
SOLVED! Re: [Zope3-Users] Re: zope.schema Question
... and I've learned a lot thanks to you patience. On Mon, 2008-07-07 at 12:41 -0300, Tim Cook wrote: I've been Googling for a script I can run against all of my source to test characters for unicode just in case there are more of those that I copied into title or description fields. If you think of anything let me know. Otherwise I may have to write one. So I wrote one and sure enough there was a non-printing non-unicode character in a description string. --Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Not Really SOLVED! Re: [Zope3-Users] Re: zope.schema Question
On Mon, 2008-07-07 at 13:58 -0300, Tim Cook wrote: ... and I've learned a lot thanks to you patience. On Mon, 2008-07-07 at 12:41 -0300, Tim Cook wrote: I've been Googling for a script I can run against all of my source to test characters for unicode just in case there are more of those that I copied into title or description fields. If you think of anything let me know. Otherwise I may have to write one. So I wrote one and sure enough there was a non-printing non-unicode character in a description string. Seems I was a little premature. There was the character but I forgot about a change I had made that caused the real problem not to show up. It's still there. Sigh; back to the search. --Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: Not Really SOLVED! Re: [Zope3-Users] Re: zope.schema Question
On Mon, 2008-07-07 at 13:34 -0400, Benji York wrote: On Mon, Jul 7, 2008 at 1:28 PM, Tim Cook [EMAIL PROTECTED] wrote: Okay, the problem is defined but it really isn't a solution for me. It seems that Zope has defined 'description' as a keyword not allowed in schema definitions. That's rather odd. Can you construct a small example (say, a stand-alone .py file) that demonstrates the problem? Okay. But before I do that. Is my approach to initializing an instance correct or is the problem the way I handled the keywords? class Activity(Locatable): A single activity within an instruction. implements(IActivity) def __init__(self,descr,tim,atid,nodeid,**kw): self.descript=descr self.timing=tim self.actionArchetypeId=atid self.__name__=nodeid for n,v in kw.items(): setattr(self,n,v) Thanks, Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: Not Really SOLVED! Re: [Zope3-Users] Re: zope.schema Question
On Mon, 2008-07-07 at 13:34 -0400, Benji York wrote: On Mon, Jul 7, 2008 at 1:28 PM, Tim Cook [EMAIL PROTECTED] wrote: Okay, the problem is defined but it really isn't a solution for me. It seems that Zope has defined 'description' as a keyword not allowed in schema definitions. That's rather odd. Can you construct a small example (say, a stand-alone .py file) that demonstrates the problem? Okay, this demonstrates the problem. But now I know it's my code. Benji may recall answering another problem I had with: zope.interface.exceptions.InvalidInterface: Concrete attribute, Where he said one of the class didn't but should inherit from Field. So, I now have several ancestor classes (all the ones that used to inherit from object) that now inherit from Field. It appears I was careless in making these choices. If TestB inherits from Field and TestA inherits from object (current state) or both inherit from Field the problem appears. If TestB inherits from object and TestA inherits from Field or both inherit from object or you change the name of the TestB.description attribute the error goes away. Now it is probably obvious by now that I have no idea what is going on here so if someone has time to add a little Zen i would appreciate it since it will help me unscrew my inheritance tree. :-) Cheers, Tim --- # descr.py -- test behaviour of the Zope schema when using field names as class attributes. from zope.interface import Interface,implements from zope.schema import Field,Object class ITestA(Interface): one=Field( title=uone, description=uone ) class TestA(object): def __init__(self,num): self.one=num class ITestB(Interface): two=Field( title=utwo, description=utwo ) description=Object( schema=ITestA, title=udescrption, description=udescription ) class TestB(Field): def __init__(self,num,descr): self.two=num self.description=descr def buildit(): a=TestA(1) print a.one b=TestB(2,a) print b.two print b.description if __name__ == __main__: buildit() --- # descr.py -- test behaviour of the Zope schema when using field names as class attributes. from zope.interface import Interface,implements from zope.schema import Field,Object class ITestA(Interface): one=Field( title=uone, description=uone ) class TestA(object): def __init__(self,num): self.one=num class ITestB(Interface): two=Field( title=utwo, description=utwo ) description=Object( schema=ITestA, title=udescrption, description=udescription ) class TestB(Field): def __init__(self,num,descr): self.two=num self.description=descr def buildit(): a=TestA(1) print a.one b=TestB(2,a) print b.two print b.description if __name__ == __main__: buildit() signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] OOBtrees ZODB
I am building a platform where I want to initialize the ZODB (that will be running under Zope) with three folders with sitemanagers. If I use Folders like this: if 'AR' not in root['Application']: root['Application']['AR']=folder.Folder() sm = LocalSiteManager(root['Application']['AR']) root['Application']['AR'].setSiteManager(sm) transaction.commit() it works great and I can then add initial objects to the folders. But, these folder sill potentially contain tens of thousands of objects so I really want to use BTree Folders. But when I do this: from zope.app.container.btree import BTreeContainer ... lots of other stuff if 'AR' not in root['Application']: root['Application']['AR']=BTreeContainer() sm = LocalSiteManager(root['Application']['AR']) root['Application']['AR'].setSiteManager(sm) transaction.commit() I get this: File /home/tim/projects/ref_impl_python/TRUNK/oship/src/oship/atbldr/atbldr.py, line 78, in ? root['Application']['AR'].setSiteManager(sm) AttributeError: 'BTreeContainer' object has no attribute 'setSiteManager' So BtreeContainers don't have a siteManager. I would like to OOBTree but I have been unable to even discern the proper way to import it. Thanks. Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] OOBtrees ZODB
On Tue, 2008-07-08 at 09:31 -0700, Shailesh Kumar wrote: BTreeContainer doesn't support site managers. Folder is a subclass of SiteManagerContainer which is a subclass of BTreeContainer. You can happily use Folder here. Thanks. I hadn't noticed that. In the earlier days of Zope2, Folder was kind of weak with large numbers of objects. Cheers, Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] zopeproject Translations
I have a project that is based on zopeproject. There are several people working on translations on this domain via Launchpad translation services. The project is in a directory called oship. I have initially put the translations in a directory: oship/src/oship/locales But I was wondering if the correct location to use with Zope should really be in oship/locales I haven't investigated Zope Translation tools in many months so this may be completely configurable but I am hoping for an answer here before I create my document to tell the users how to install translations into the application(s). Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] OOBtrees ZODB
On Wed, 2008-07-09 at 08:39 -0500, Randy Crafton wrote: Folder uses an OOBTree to store it's data, so it should be ok. Thanks. I believe that solves my issue. :-) But if you want to use BTreeContainer and have it work as a Site, you just have the mix the two together in a custom container class: Is there some advantage to jumping through that hoop? I just want to be sure that my container will be able to handle a large (20,000+) number of objects. Cheers, Tim -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Set List constraints
When constraining the membership of zope.schema List and Set; is it valid to say that this will work: value=List( title=uValue, constraint=classProvides(IMyClass) ) where IMyClass defines the schema for the MyClass and is the only objects allowed in the List? Thanks, Tim -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Set List constraints
On Thu, 2008-07-10 at 16:59 +0200, Markus Kemmerling wrote: I would rather say: value=List( title=uValue, value_type=Object(schema=IMyClass) ) Can you elaborate why? Anyhow, such a constraint is of limited use only, since it does not prevent you from adding any object you like to the list *after* it got assigned to the 'value' attribute. Okay, but that would be badly behaved code; correct? In my implementation I am creating instances and committing them to a ZODB repository. My thoughts were that copies of those instances would continue to constrain the types allowed in that attribute. Is that incorrect? Cheers, Tim -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Set List constraints
I appreciate the list members time and patience. I used Zope heavily 2000-2003 but after not writing any code for almost five years this is like starting over. :-) On Fri, 2008-07-11 at 06:48 +0200, Markus Kemmerling wrote: You want to restrict the elements of a list to instances that provide a given interface IMyClass, right? That's exactly what a field's value_type attribute is for: Thanks. I missed that in the docs about collections. is meant to be used in class definitions to declare that a class itself -- not is instances -- provides a given interface. I use that and I guess that's why I thought it might do double duty. I am not sure if I get this. If you set an instance of a mutable type like a list as an attribute of some other instance described by a schema, it will be validated, but still remain mutable (finally your other object only holds a reference to your mutable). It doesn't matter if it is persistent or not, or if it was copied before. But I might misunderstand your intention here. As usual a bit of context will help if you'll bear with me. I am implementing a set of healthcare application specifications designed (over almost 2 decades) to maintain semantic context of information across applications and to be implementable in any OO language. There are implementations in Eiffel,Java and .Net. http://www.openehr.org This will reduce the number healthcare data silos since any application in any language can exchange information. The reference model describes broad concepts such as observation,instruction,action,etc along with the required data types and data structures to support them. The 'instances', referred to above, are created as constraints on the reference model in order to define a maximal dataset for ONE clinical concept, i.e. blood pressure. These definitions are parsed from a special purpose language (see attachment) designed to describe the entire semantics of that concept. Since (with my code) parsing one of these and creating the in-memory object takes about .1 - .2 secs. and since an application may use as many as 20 on a screen it is out of the question to do it on-the-fly. My solution then is to pre-store these in a repository in the ZODB as a kind of template. An application can then reuse these by making a copy. My priorities are: 1. To demonstrate implement-ability in Python. 2. Have a platform that can be used to demonstrate and teach the reference model and archetypes in use to a broad audience; physicians, health care researchers, computer science and medical students, etc. 3. Build an interested open source community where 'real' developers can fine tune my code and create wonderful interoperable healthcare applications using the reference model in their chosen language. So, yes I am recruiting developers to what I believe is a good cause project. In the interim I will keep plugging away at. :-) Thanks, Tim -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** openEHR-EHR-OBSERVATION.blood_pressure.v1.adl Description: application/extension-adl signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Interface confusion (still)
If interface B inherits from interface A and class B implements interface B; do I need to explicitly state that class B provides interface A? Concrete example: class IElement(Interface): value = Object( schema=IDataValue, title=_(uvalue), description=_(uData value of this leaf.), required=False ) class IDvText(IDataValue): ... class DvText(DataValue): implements(IDvText) classProvides(IDvText) Will Element.value allow instances of DvText or do I need to change the DvText classProvides call to: classProvides(IDataValue,IDvText) Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Interface confusion (still)
The purpose of this question is related to an earlier question I had about using the best/correct schema field choice. It was pointed out that I should use 'Object' and set the schema to the interface of the class(es) that I wanted that attribute to accept. Since I did not point out that all of the classes that I wanted an attribute to accept would be descendants of that base class (and their interfaces) that is probably where I misunderstood that I would need to use classProvides. On Tue, 2008-07-15 at 21:39 +0200, Markus Kemmerling wrote: An instance of a class provides not only the interface the class declares to implement, but also all base interfaces of this interface. In particular an instance that povides any interface, will always provide 'Interface'. ... and that makes perfect sense. Note: classes *implement* interfaces, their instances *provide* them. ... and I am still confused about a use case for classProvides. You probably don't want to use 'classProvides' at all. The 'implements(IDvText)' statement is enough for all instances of 'DvText' to provide 'IDataValue'. Barring any replies to the contrary; I will remove all the superfluous classProvides calls. Since this makes sense to me and was my original understanding. Basically that interface inheritance acts just like class inheritance. Thanks, Tim -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Interface confusion (still)
On Tue, 2008-07-15 at 18:56 -0400, Benji York wrote: On Tue, Jul 15, 2008 at 6:31 PM, Tim Cook [EMAIL PROTECTED] wrote: Note: classes *implement* interfaces, their instances *provide* them. ... and I am still confused about a use case for classProvides. When one says that a class *provides* an interface they're saying that instances of that class *implements* the interface. On the other hand, lets say you had an IFooFactory interface that only required that objects *providing* it be callable. In that case a class Foo itself can *provide* the interface (because the class is callable). Make sense? Hmmm, not really. I tend to be VERY applied so how about an example from Zope? == class Maildir(object): See `zope.sendmail.interfaces.IMaildir` classProvides(IMaildirFactory) implements(IMaildir) class IMaildirFactory(Interface): def __call__(dirname, create=False): Opens a `Maildir` folder at a given filesystem path. ... class IMaildir(Interface): Read/write access to `Maildir` folders. See http://www.qmail.org/man/man5/maildir.html for detailed format description. def __iter__(): Returns an iterator over the pathnames of messages in this folder. def newMessage(): Creates a new message in the `maildir`. = Now why wouldn't IMaildir just not inherit from IMaildirFactory instead of from Interface? If it did; what would be the effect of the difference(s) in approach to the rest of the application? Thanks, Tim -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Interface confusion (still)
On Tue, 2008-07-15 at 19:27 -0400, Fred Drake wrote: On Tue, Jul 15, 2008 at 6:56 PM, Benji York [EMAIL PROTECTED] wrote: When one says that a class *provides* an interface they're saying that instances of that class *implements* the interface. Sorry, you got that backwards. Instances provide the interfaces their class implements. Thanks. And in my Maildir example it implements what is defined in IMaildir but how does it 'provide' what is in IMaildirFactory? Specifically the __call__ method. So my continuing thick-headed questions is: What does classProvides really mean from a practical standpoint? Some kind of use case? --Tim -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Copying Objects from/in the ZODB
Hi All, Another basic question but I can't seem to find the easy way to do this. I have a group of instances stored in the ZODB. They are basically skeletons that I want to copy, edit and store as new instances elsewhere in the ZODB. In Zope2.x this was fairly obvious to me. Using the ZCA it isn't so obvious. Is there a class I should be inheriting from to do this or do I need to provide a copy method in the class itself? If the later; are there any good examples? Thanks, Tim -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Configuration Problems?
Hi All, I've read all the books and readme's as well as most of the source. I also went through as many tutorials as I could find. I just can't seem to 'get' the configuration process for the ZCA. I used Paul Carduner's ZContact tutorial. I had no problem with it. I have a rather large healthcare project based on a robust set of specifications. Most of the implementation for the specifications are complete. We are just finishing a 10 day workshop on implementing these specs. using the ZCA as the application server. We made some great improvements in the code. But .. When it comes to actually viewing our content with a browser we fail. I thought that certainly a workshop full of bright people working all day on this problem would be able to discover what is missing; nope. If you have ZCA skills and are interested in getting into a field developing interoperable healthcare applications for NGOs and governments worldwide then we can offer to teach you the intricacies of these specs in exchange for your help. We NEED you! Running paster serve debug.ini: The exact issue at this point is that we built a skin and layer as well as a display form using the zc3.* eggs modeled after the ZContact example. Using the introspector from the ZMI shows the contents of the object and all looks okay. But if we try to use the skin and form (named index.html) using a URL like this: http://127.0.0.1:8080/++skin ++DemoAT/AR/openEHR-EHR-EVALUATION.goal.v1/@@index.html we get a ComponentLookupError (traceback below). I just can't seem to figure out WHERE the look up error is coming from. I do see that if adapter is None:' raises the error and my guess is that there isn't one registered for Archetype objects (these are not Plone Archetypes). So, where to look? The source is available at: http://www.openehr.org/svn/ref_impl_python/TRUNK/oship Since this is based on zopeproject the configure files and browser subdirectory are at: http://www.openehr.org/svn/ref_impl_python/TRUNK/oship/src/oship/ Thanks for taking a look and I hope I can encourage some (one at least) of you to spend some time with us on this rapidly growing project. Cheers, Tim = URL: http://127.0.0.1:8080/%2B%2Bskin%2B% 2BDemoAT/AR/openEHR-EHR-EVALUATION.goal.v1/%40%40index.html Module paste.evalexception.middleware:306 in respond Module zope.app.wsgi:54 in __call__ handle_errors = environ.get('wsgi.handleErrors', True) request = publish(request, handle_errors=handle_errors) response = request.response request = publish(request, handle_errors=handle_errors) Module zope.publisher.publish:133 in publish Module zope.app.publication.zopepublication:167 in callObject security proxied zope.app.publisher.browser.viewmeta.ArchetypeDisplayForm instance at 0x217ebd0 Module zope.publisher.publish:108 in mapply Module zope.publisher.publish:114 in debug_call Module z3c.form.form:189 in __call__ Module z3c.form.form:184 in update Module z3c.form.form:134 in update Module z3c.form.form:126 in updateWidgets Module z3c.form.field:241 in update Module zope.component._api:103 in getMultiAdapter adapter = queryMultiAdapter(objects, interface, name, context=context) if adapter is None: raise ComponentLookupError(objects, interface, name) return adapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((zope.schema._bootstrapfields.Field object at 0x7f9af8717ad0, zope.publisher.browser.BrowserRequest instance URL=http://127.0.0.1:8080/++skin ++DemoAT/AR/openEHR-EHR-EVALUATION.goal.v1/@@index.html), InterfaceClass z3c.form.interfaces.IFieldWidget, u'') = -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Configuration Problems?
Marius, Thanks for the feedback. On Fri, 2008-08-01 at 21:13 +0300, Marius Gedminas wrote: The traceback shows you the WHERE, but that's not interesting. The WHY is interesting, Very true. and I could make a guess. Your form schema contains a plain Field() field. Zope has no widgets for this. Usually this happens when you define a content object's interface inheriting from IContained or ILocation. The fix is to omit __name__ and __parent__ from the interface. and I'd change it to class ATDemoDisplayForm(form.Form): A simple display form Archetypes. fields = field.Fields(IArchetype).omit('__name__', '__parent__') mode = DISPLAY_MODE Okay. This wasn't 'the solution' but it did give me a hint as to the cause of the problem. In the project we have many complex classes where attributes are of another type within the project and not one of the basic zope.schema types. Their interface looks like this: archetypeId=Object( schema=IArchetypeId, title=_(uArchetype Id), description=_(uMulti-axial identifier of this archetype.), required=True, So, since there are no widgets for these types of fields I assume then they will cause the same error? I had hoped that it would just return a __repr__. So just to show something in the browser to be sure I have the wiring correct I tried to figure out how to only display one attribute that does have a widget: adlVersion = TextLine( title = _(uadlVersion), description = _(uADL version if archteype was read in from an ADL sharable archetype.), required = False, default = None ) I tried changing the display form to: class ArchetypeDisplayForm(form.Form): A simple display form for archetypes. #fields = field.Fields(IArchetype).omit('__name__', '__parent__') fields=['adlVersion'] mode = DISPLAY_MODE But this returns: AttributeError: 'list' object has no attribute 'values' in the browser (running paster serve debug.ini). So I assume fields should be a mapping but looking through the text files in z3c.form I can't determine the expected contents. In fact I find this Zope convention of showing examples being created in the Python interpreter to be very confusing. I'm sure that if you are already familiar with the components it can be intuitive. But for someone that doesn't know their way around yet (me). It is difficult to determine how the code should look in a module when so often certain things have been imported or created in an earlier example. Case in point. I want to start by just displaying the contents of my instance that has already been created and stored in the ZODB. I may never need an add form, only edit and display forms. BTW: Is this the proper way to say that I want an attribute that is a Set and the contents must implement IAssertion? invariants=Set( title=_(uInvariants), description=_(uFOPL invariant statements), required=False, value_type=Object(schema=IAssertion), ) Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Configuration Problems?
On Sun, 2008-08-03 at 19:52 -0300, Tim Cook wrote: I tried changing the display form to: class ArchetypeDisplayForm(form.Form): A simple display form for archetypes. #fields = field.Fields(IArchetype).omit('__name__', '__parent__') fields=['adlVersion'] I've been staring at this too long I guess. :-) Of course: fields=field.Fields(IArchetype['adlVersion']) works fine. So now I have something in my browser. The question about all those potential custom widgets still exists though.Is there a 'magic' Object widget that will walk the tree all the way to the leaf of each object and use the z3c widget??? Probably not but I am hoping. Cheers, Tim -- ** Join the OSHIP project. It is the standards based, open source healthcare application platform in Python. Home page: https://launchpad.net/oship/ Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Windows Vista, Buildout python-cjson
This isn't a buildout question nor even really a python-cjson question. I used zopeproject to startup my OSHIP project https://launchpad.net/oship/ and then added most of the Zope3.4 packages (avoiding lxml due to incompatibility hell) so this is why I'm posting it to the Zope3 Users list. It seems that Windows Vista users are having issues when installing OSHIP because of issues with python-cjson. http://lists.chime.ucl.ac.uk/mailman/private/ref_impl_python/2008-September/000293.html (List membership required). Which is similarly reported elsewhere: http://www.pypi.info/index.php?option=com_contentview=articleid=369% 3Apython-cjson-07-18-2008-16catid=53%3Apython-tips-and-tricksItemid=1 First of all I do not know what is causing python-cjson to be loaded as a dependency. Maybe we can eliminate it for now. Any guesses? Our buildout.cfg is here: http://www.openehr.org/svn/ref_impl_python/TRUNK/oship/buildout.cfg Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] thoughts about z3c.form-package
On Wed, 2008-10-08 at 06:25 +0200, Roger Ineichen wrote: Adam Groszer is working on a ObjectWidget implementation. What is the proposed functionality of ObjectWidget? Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] thoughts about z3c.form-package
On Wed, 2008-10-08 at 15:32 +0200, Roger Ineichen wrote: What is the proposed functionality of ObjectWidget? The ObjectWidget is a widget for an IObject field. This field is used for attributes which provide a own schema and hold a refenece to a pyton instance providing this schema. (does this make sense?) Yes, it makes perfect sense to me. I have LOTS of these in my implementation. http://www.openehr.org/svn/ref_impl_python/TRUNK/oship/src/oship/openehr/ I just do not have working forms yet. :-( I still have a lot to learn about z3c.form I am assuming, though haven't tried, that I can specify an interface that is maybe 3,4 or more steps through Object attributes and have the correct widget (text, textline, etc.) render? The ObjectWidget is now responsible for render an input widgets in an EditForm for the color attribte of the door. Sorry but I have *no clue* what this means. Cheers, Tim ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] thoughts about z3c.form-package
(Thanks Roger and Adam for your earlier replies.) On Wed, 2008-10-08 at 16:59 +0200, Hermann Himmelbauer wrote: Moreover, z3c.form is complex, but it isn't hard if one knows what to do/how to do - which leads me back to my WIKI idea... Hermann, This is a very good point. For those of us just trying to get a handle on how to use z3c.form, in the best and most efficient way, a Wiki is a great way to collect patterns. I think (feel?) that z3c.form is a very powerful package and the documentation isn't bad either. Some of us learn better by seeing actual use cases though in order to adapt them to our own needs. This usually means that folks like Roger, Stephen, etc. can keep doing what they do best (making the package better) and experienced users can contribute their experiences and ideas via the Wiki. (My 2 cents) Regards, --Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] ZCML Layout Decision?
Hi All, What are your thoughts on the best way to implement the configure.zcml files for this application framework? The framework is a nested structure up to five levels deep in places of approximately 150 classes. Would it be better/more efficient to create a configure.zcml in each package or just one at the top level? Another design decision is that this is a framework for application developers and probably 99% of them will have no previous Zope experience. So teaching them how to setup zcml for their own security declarations etc will be an issue as well. Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] WrongContainedType
I am having difficulty understanding this error. It occurs in the call: ontObj.parentArchetype = ObjectRef(oid,u'openehr',u'ARCHETYPE') The first parameter for ObjectRef is declared in the schema as: refId = Object( schema=IObjectId, title = _(u'Id'), description = _(u'Globally unique id of an object (of type ObjectId), regardless of where it is stored.'), required = True ) If I print the parameter 'oid' it does correctly report: oship.openehr.rm.support.identification.objectid.ObjectId object at 0x1b70210 the other two parameters for ObjectRef are declared as TextLines. The traceback is: zope.schema.interfaces.WrongContainedType: [, []] What I do not understand is how to interpret the [, []] I'm not passing a list nor is the schema using a list. I realize that this may be pretty basic but I am missing something in reading the error. Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] WrongContainedType
On Fri, 2008-10-10 at 11:07 +0200, Roger Ineichen wrote: What do you think about a validateSchema=True/False option or something like that? Maybe it's just a requirement to fix the code? The code at around line 466 in _field.py says errors = _validate_fields(self.schema, value) if errors: raise WrongContainedType(errors) errors is an empty list so should the if statement just be a test to see if the list is not empty? Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] WrongContainedType
On Fri, 2008-10-10 at 12:38 -0300, Tim Cook wrote: Maybe it's just a requirement to fix the code? The code at around line 466 in _field.py says errors = _validate_fields(self.schema, value) if errors: raise WrongContainedType(errors) errors is an empty list so should the if statement just be a test to see if the list is not empty? Actually, the problem is that the second iteration of the check causes the first list not to be empty anymore. by adding the line: print 'Object schema validation errors=',errors before the if errors: line I get this output: Object schema validation errors= [] Object schema validation errors= [, []] So I'm not sure WHERE errors is being created as a list each pass. I tried setting it to None with an else: clause and that didn't fix it. I hope this can help someone track down the problem. For now I have just commented out the error condition: #if errors: #raise WrongContainedType(errors) Cheers, --Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] WrongContainedType
On Fri, 2008-10-10 at 17:46 +0200, Roger Ineichen wrote: I guess not, normaly such an error has an empty representation and the list is not empty. Try to do errors[0] or type(errors[0]) and you probably see something. If not I'm confused Well, I'm confused anyway, but that isn't difficult. ;-) After commenting the the if test on errors and the raise. With print 'Object schema validation errors=',type(errors[0]): I get: Object schema validation errors= class'zope.schema._bootstrapinterfaces.RequiredMissing' Object schema validation errors= class'zope.schema._bootstrapinterfaces.RequiredMissing' With print 'Object schema validation errors=',errors[0]: I get: just the string Object schema validation errors= printed on each line. With print 'Object schema validation errors=',errors: I get: Object schema validation errors= [] Object schema validation errors= [] Just to try to cover all bases. I uncommented the if test and the only print that changed was the one with just 'errors' (the last one above). It produces, as I said before: Object schema validation errors= [] Object schema validation errors= [, []] Chasing this down is definitely above my Python abilities. Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] ZCML Layout Decision?
On Thu, 2008-10-09 at 09:28 -0700, Marius Gedminas wrote: Have you considered Grok? I looked at Grok when I first started this project about a yer ago. I didn't really see much help there at the time so I used zopeproject to kickstart a foundation and started building from that. Well, at your suggestion I have given Grok a new try. I think I can best express my opinion as: **GROK IS FRICKEN AWESOME!!*** I noticed in the Grok list archives that a member of my project had asked last month about migrating a Zope3 project to Grok. The replies weren't too encouraging and rightfully so since no one really knew how Zope3 the project already was. The truth is that it is not very Zope3 at this point. So, off to Grok we go. This rethinking also prompted a major design decision change. I'll be throwing away a lot of code but the end result will be well worth it. Thanks for the prod to look at Grok again. Cheers, --Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] WrongContainedType
Thanks for your help Roger, On Fri, 2008-10-10 at 18:19 +0200, Roger Ineichen wrote: The error (probably, not sure) means that the object you like to store has a missing value. Can you check the schema of this object and set required=False in all fields? Did that in both schemas on my local copy and no change. I just did a new commit to the svn prior to this email. If there is a problem, can you post the interface and class of this object as a sample? And probably the code which tries to store the object. The code for these are quite verbose and will certainly obscure the commentary so I hope it's okay that I post links to the SVN within the comments? The failing code is when building an ArchetypeOntology class: http://www.openehr.org/svn/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/ontology/archetypeontology.py Interface: http://www.openehr.org/svn/ref_impl_python/TRUNK/oship/src/oship/openehr/am/archetype/ontology/interfaces/archetypeontology.py The builder code for this is here: http://www.openehr.org/svn/ref_impl_python/TRUNK/oship/src/oship/atbldr/bldontolgy.py It is failing when I try to assign the the value for the parentArchetype attribute. Here's the traceback: * Traceback (most recent call last): File load_ar.py, line 182, in module CreateAT() File /home/tim/oshipenv/oship/src/oship/atbldr/atbldr.py, line 142, in CreateAT bldArchetype(parsed_adl) File /home/tim/oshipenv/oship/src/oship/atbldr/atbldr.py, line 175, in bldArchetype ontology=bldOntology(parsed_adl) File /home/tim/oshipenv/oship/src/oship/atbldr/bldontolgy.py, line 47, in bldOntology ontObj.parentArchetype = ObjectRef(oid,u'openehr',u'ARCHETYPE') File /home/tim/.buildout/eggs/zope.schema-3.4.0-py2.5.egg/zope/schema/fieldproperty.py, line 52, in __set__ field.validate(value) File /home/tim/.buildout/eggs/zope.schema-3.4.0-py2.5.egg/zope/schema/_bootstrapfields.py, line 138, in validate self._validate(value) File /home/tim/.buildout/eggs/zope.schema-3.4.0-py2.5.egg/zope/schema/_field.py, line 469, in _validate raise WrongContainedType(errors) zope.schema.interfaces.WrongContainedType: [, []] * In the builder code you can see that oid is an instance of ObjectID. That seems to work okay. ObjectRef has three attributes, the first an instance of ObjectId, the second two are TextLines. http://www.openehr.org/svn/ref_impl_python/TRUNK/oship/src/oship/openehr/rm/support/identification/objectref.py Interface: http://www.openehr.org/svn/ref_impl_python/TRUNK/oship/src/oship/openehr/rm/support/identification/interfaces/objectref.py The ObjectId class and interface are in the same package if you want to look at them. Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Grok and Permissions was: ZCML Layout Decision?
On Fri, 2008-10-10 at 10:30 -0700, John de la Garza wrote: I much prefer configuring permissions outside of my python code and having the app server handle it than checking if a person is authenticated before a method's main body. Hmmm, It is my impression so far (and that isn't very far) that one still has all the control of Zope3 but with an easy to get used to frontend. It will be key for the users of my platform that they will be able to set permission on an attribute basis. Am I wrong in thinking that this will be possible even though the application started out as Grok? Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] WrongContainedType
On Fri, 2008-10-10 at 14:01 -0300, Tim Cook wrote: The code for these are quite verbose and will certainly obscure the commentary so I hope it's okay that I post links to the SVN within the comments? Well, that isn't very helpful I just discovered that the svn servers will be down all weekend for upgrades. The code is mirrored on Launchpad and the openehr code where the core classes and interfaces are should be up to date since the last import was five hours ago. http://bazaar.launchpad.net/~vcs-imports/oship/trunk/files/126?file_id=oshipsrcoship-20080801142259-4s7gdkogcl0fvfo2-13 -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] WrongContainedType
On Fri, 2008-10-10 at 21:17 +0200, Roger Ineichen wrote: I do not fully understand what the codes does but this does not work: ontObj.parentArchetype = '' Because it will set an empty string but an IObjectRef is needed. Thats' not valid, just let it be, don't set anything else then an IObjectRef as value. Unfortuuately you are looking at older code (before I really began testing this section). The code that is failing is: oid = ObjectId(unicode(parsed_adl.archetype[1])) ontObj.parentArchetype = ObjectRef(oid,u'openehr',u'ARCHETYPE') where oid is an instance of ObjectId. Sorry that the servers are down right now and will be all weekend. Also this doesn't work: ... In the sample above just remove the else condition. The object whould return an empty list as defined in default anyway. Okay. btw, I really dislike this invalid schema definitions. With invalid I mean the default value is not a vaild value if ou try to store them. because of: required=True default=[] This is a combination which is not valid and it's not possible to store the default value again. Thanks. This is so obvious now that you pointed it out. :-) I'll look around for more of these. Thanks and have a great weekend. I'll be busy Grokifying this application. Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] WrongContainedType
Just to follow up on this issue. I have created a bug report on launchpad with a possible fix. However, I do not know for sure that this doesn't have other negative consequences. https://bugs.launchpad.net/zope3/+bug/301226 Cheers, Tim On Thu, 2008-10-09 at 18:08 -0700, Marius Gedminas wrote: On Thu, Oct 09, 2008 at 08:42:21AM -0300, Tim Cook wrote: I am having difficulty understanding this error. It occurs in the call: ontObj.parentArchetype = ObjectRef(oid,u'openehr',u'ARCHETYPE') The first parameter for ObjectRef is declared in the schema as: refId = Object( schema=IObjectId, title = _(u'Id'), description = _(u'Globally unique id of an object (of type ObjectId), regardless of where it is stored.'), required = True ) If I print the parameter 'oid' it does correctly report: oship.openehr.rm.support.identification.objectid.ObjectId object at 0x1b70210 the other two parameters for ObjectRef are declared as TextLines. The traceback is: zope.schema.interfaces.WrongContainedType: [, []] Oh dear. That's one of the worst error messages I've seen. What I do not understand is how to interpret the [, []] By reading the source code. Object field validation actually attempts to validate the schema (IObjectId in this case) of the object you're trying to store (the ObjectId object, in this case). If any of the fields cannot be validated during this nested validation, you get a WrongContainedType with the list of errors (one for each field). Apparently those errors have horrible __repr__s. That ought to be fixed. I'm not passing a list nor is the schema using a list. I realize that this may be pretty basic but I am missing something in reading the error. I'd put a breakpoint in zope.schema._field, specifically, in Object._validate, and try to see what's wrong by single-stepping. Marius Gedminas ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** attachment: oe_trick.png signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Next Step to Bug Resolution???
Hi Dan, Thanks for taking a look. On Thu, 2008-12-18 at 20:06 +0300, Dan Korostelev wrote: Hi, Tim. I builded out your application and took a quick look at the error. It looks like you're mis-using the zope.schema.Field class and its interface. It should be only used in schema definition, while you are using Field instances as attributes for other objects. For example, you are defining the ObjectId as a field, but are using its instances as objects. That's not a valid use. Okay. I can accept that it might be a mis-use. I extracted the problematic code to separate file and changed the IField to Interface and Field to ``object`` (though you'll want to use Persistent, i guess) for ObjectId and ObjectRef and it works okay. :-) This is actually what I did at first. You may want to refer to the UML http://www.openehr.org/svn/specification/TAGS/Release-1.0.1/publishing/architecture/computable/UML/uml_start_view.html (This is the rm.support.identification package we are looking at) Since ObjectId is an abstract class so inheriting from object seems reasonable. However, most of the other id classes inherit from ObjectId and when they are used as attributes to other classes they need to have the meta data expected by zope.schema. Otherwise you get errors like keyword required not found (or something similar). This is true throughout the model. So my solution (and CERTAINLY there may be a better one) was to use the Field class (it is just a Python class - right?) as the base class for all of the base classes in the model. As I said before I may have miss-diagnosed the problem and may fix may break other things? Or, it might be that I don't fully understand your code and application architecture, so I would like to hear more about it. It looks quite over-engeneered to me. I fully understand why you might think that. IF you'll bear with me... healthcare information is very complex (certainly the complex domain I've run into in 32 years of dealing with information systems) and the knowledge domain is constantly changing. I have a short point paper here http://timothywayne.cook.googlepages.com/context-lies.pdf that gives a 30,000' view of the issues of semantic interoperability and computability of healthcare information. and a good introduction to the domain issues are here: http://www.openehr.org/shared-resources/getting_started/openehr_primer.html This model has more than 20 years of constantly improving RD on this subject. The key goal have always been to be abstract enough so that it can be implemented in any OO language on any platform in any type of healthcare setting and all stored patient information is guaranteed to be computable (decision support, etc) as well as maintain it's semantic integrity over the course of time irregardless of the changes in the science. So in essence you can go back to any point in time and not only know what the blood pressure of the patient was, but also what was known about blood pressure at that time. This model has been implemented in Eiffel, Java, C# and VB. The applications (both commercial and open source) have demonstrated these capabilities. Certainly the model isn't perfect but there is a completely open change management system in place that deals with any changes due to new ares or new science. In order for this Python implementation to remain as true as possible to the model as well as exercise the value in the ZCA; this is the path I have taken. Thanks for your help. Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** attachment: oe_trick.png signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] [Zope-dev] Next Step to Bug Resolution???
Hi Chris, On Fri, 2008-12-19 at 10:06 +, Chris Withers wrote: Tim Cook wrote: As I said before I may have miss-diagnosed the problem and may fix may break other things? This is what a full-coverage unit and functional test suit is for. You have got automated tests for all this stuff, right? NO! I do not! I am a ZCA user not a full time python programmer. That is why I a asking for help here. Initially at least on the Zope Users list. If you are expecting ZCA users to be full time Python gurus then why have two mailing lists? It seems that you are asking a user to provide the developers with a ready to commit patch. I wish I had those skills and could do so. Alas, it isn't going to happen. Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] [Zope-dev] Next Step to Bug Resolution???
Thanks Dieter, On Fri, 2008-12-19 at 19:41 +0100, Dieter Maurer wrote: I often approach situations like this with so called Monkey Patches: I replace or enhance classes or methods during startup (triggered by some startup event). This may not be optimal but allows me to solve my problems without tight coupling with the core developpers who usually do not have my problems and tend not see them as very high priority. I am starting to see why other Python developers aren't too interested in Zope. Despite the awesome power of the architecture. I've been poking around and using and supporting Zope since 1999. But because I am not an expert programmer (my skills are in another field) and because I do not know Zope inside and out. I am being chastised for not supplying my own complete fixes to the developers or at least being able to cover for their mistakes inside my application. Silly me. Working in open source for 14 years and I had no idea it worked like this. I'm sure glad that we do not run openEHR like that. Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] [Zope-dev] Next Step to Bug Resolution???
On Fri, 2009-01-09 at 11:02 +, Chris Withers wrote: Hi Chris, Thanks for the opportunity to address these issues. Hang on, you're making out this project of yours is some big deal, Well, it is kind of a big deal in healthcare. Simplistix (and others) may be interested in the fact that the UK NHS CfH project (the world's largest heathcare project) is using this technology in it's infrastructure. and yet when questioned on whether you use sane development practises, you throw your hands up in the air... H, somehow I think that this is a misunderstanding. If anyone is developing any kind of serious project, even as a ZCA user, I'd expect them to have automated unit tests with execellent coverage. If you don't, then your project starts to look pretty weak. Our project (OSHIP) *DOES* have unit tests that are comprehensive. Remember that my complaint is about the ZCA not covering all test cases; i.e. multiple Object fields simply return and empty list AS AN ERROR when there really isn't an error at all. This means that the ZCA tests do not fully cover the cases. If you are expecting ZCA users to be full time Python gurus then why have two mailing lists? zope-dev is for the development *of* the zope libraries zope3-users is for people developing software *with* the zope libraries. ... and that is why I started my question as a ZCA user but then went to the development list because the issue is obviously a ZCA core issue. I have received some other off-list advice and I do appreciate their input. One interesting comment was that this cannot be understood in 15 minutes (probably my lack of ability to explain it) and that being such an edge case it is on me to supply the complete solution. Fortunately, we have received funding for a project based on this framework and I will place this issue at the forefront. Thanks to the ZCA community for enduring my rants and hopefully in the coming weeks we can contribute to the zope.schema code and test cases that will exercise this demon. Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] [Zope-dev] Next Step to Bug Resolution???
Thanks for all the assistance. On Fri, 2009-01-16 at 18:05 +0100, Martijn Faassen wrote: Yes, you do create new schema fields by subclassing from Field. It's just that we saw you putting a field not in a schema but in what looked like a concrete object. This has given me a BIG pause while I'm working on a simpler example. It may actually solve the problem. Are you saying that in order to create a Field that can be used as an attribute of another class; I should define it in an interface and ONLY in an interface? Such like pseudo: import Field class IAbc(Interface) myNewField = Field( and then when I need to use it in a class, simply state that that class implements(IAbc)? If this is true I have a two month hard core re-factoring to do. Cheers, Tim Perhaps we were wrong in reading your code, and this is one reason why you should come up with a minimum example that demonstrates the problem and only that, without a lot of distracting code surrounding it. You're the best suited person to actually create a minimum example. Thanks again. Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] [Zope-dev] Next Step to Bug Resolution???
Hi Shane, On Tue, 2009-01-13 at 14:10 -0700, Shane Hathaway wrote: Sorry, but the patch doesn't make any sense. Your version of _validate_fields quietly skips validation entirely by default. First of all that is why I asked for others to look at it. :-) But I DID test it by inserting an incorrect schema and it did throw the correct error. I think it was the ShemaNotImplemented error. This was a few weeks ago but I can repeat it if needed. As I explained before; when one schema is checked by _validate_fields then all is well. The parameter 'errors' is None. Then errors is set to an empty list and any possible error msgs are appended. BUT when a schema has to check another schema because they are chained. 'errors' is already an empty list but even though the parameter errors is None a new list is appended to the first pass errors. This creates the msg WrongContainedType: [, []] because it IS a WrongContainedType because there is an empty list inside the original list. 'errors' is returned from _validate_fields back to the _validate method of the Object class where it is simply tested to see if it is empty. On this second pass it ISN't empty. It has another list inside so it fails the truth test and incorrectly throws an error. Look at the __repr__ method of the ValidationError class in the _bootstrapinterfaces.py module of the zope.schema package. This method was designed to generate short error messages, but in your case it appears to be truncating the error messages altogether. I would start by changing that particular __repr__() method to: def __repr__(self): return '%s(%s)' % (self.__class__.__name__, repr(self.args)) This version prefers verbosity. At a minimum, I hope this version of __repr__ will change the bizarre message zope.schema.interfaces.WrongContainedType: [, []] into something legible. It is more verbose. But I'm afraid it exhibits the same behavior as described above. Here are the results: in _validate raise WrongContainedType(errors) WrongContainedType: [RequiredMissing(()), WrongContainedType(([RequiredMissing(())],))] Note the empty parens. Now if I introduce bad code I get: in _validate raise WrongContainedType(errors) WrongContainedType: [RequiredMissing(()), SchemaNotProvided(())] SchemaNotProvided is correct. Though there isn't much else to go on but the full traceback points me to the right place. *** Shane, I think that so much of this is no longer useful. Right not now I'll go back and read all the obscure documentation (for the upteenth time) and see if it makes more sense now. I am very confused about thee use cases between creating Fields and using the Object(schema=Ischema) approach. Thanks for your help. --Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] [Zope-dev] Next Step to Bug Resolution???
Thanks All, On Fri, 2009-01-16 at 21:55 +0100, Carsten Senger wrote: Sure you can have specialized fields that subclass from Field, TextLine, or another base class. E.g. RegistrationNumber(TextLine) that takes care to validate the input for a special format. But you use them in an interface class, not the class that implements the interface. Okay. I got this down now. I still have a problem with understanding the use cases for using attribute=Object(schema=IMySchema ... But now all of the docs may make mmore sense with all I've leearned to past few days. Cheers, Tim signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] [Zope-dev] Next Step to Bug Resolution???
Hi Dan, On Sat, 2009-01-17 at 01:28 +0300, Dan Korostelev wrote: Hi Tim. Unfortunately I didn't follow the discussion lately, so may be the problem is no more, but... There has been a tremendous amount of help from folks like you. However there is still not a solution. I have been asked several times for a 15 minute overview. This is tough given the complexity but allow me to ask the question at a more basic level. I believe it is similar to the way I asked it last year, but here goes. I'm not going to address Field or Object here, just explain the basics. class DataStructure(Persistence): abstract class class ItemStructure(DataStructure): abstract class class ItemList(ItemStructure): u Logical list data structure, where each item has a value and can be referred to by a name and a positional index in the list. The list may be empty. items = List( value_type=Object(schema=IElement), title=_(uitems), description=_(uPhysical representation of the list.), required=False ) class ItemTable(ItemStructure): u Logical relational database style table data structure, in which columns are named and ordered with respect to each other. Implemented using Cluster-per-row encoding. Each row Cluster must have an identical number of Elements, each of which in turn must have identical names and value types in the corresponding postions in each row. Some columns may be designated 'key' columns, containing key data for each row, in the manner of relational tables. This allows row-naming, where each row represents a body site, a blood antigen etc. All values in a column have the same data type. Used to represent any data which is logically a table of values, such as blood pressure, most protocols, many blood tests etc. Not used for time-based data, which should be represented with the temporal class HISTORY.. The table may be empty. class ItemSingle(ItemStructure): u Logical single value data structure. Used to represent any data which is logically a single value, such as a person's height or weight. * There are others and I left out the attributes and methods of these classes; with the exception of ItemList attribute 'items', where it is a zope.schema List but the value types are restricted to the schema described by IElement (also part of openEHR); but I think you get the idea. These classes are used as the base software for all openEHR applications. Of course the classes get more complex and deal directly with healthcare related issues. Now there are thousands of applications that will have data instance with attributes expressed in classes based on the above software that represent single (but complete) clinical concepts. But not all application user interfaces will use all available attributes of the concept. One may use an ItemTable and another an ItemList but they will both be valid in ANY application because the attribute represents a legal instance of ItemStructure. When that data instance is sent from application to another the receiving applications still needs to know the complete semantic context of when that data was collected.Think medico-legal, research and decision support over the lifetimes of patients and populations. So even if the user didn't see all the options in their GUI; it is still all contained in the data that was transfered. So how do I build my schemas so that Zope does the validation of nested schemas and even lets me use standard widgets? I hope this was less than 15 min. For those that want specific examples I can list a few. Cheers, Tim attachment: oe_trick.png signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Next Step to Bug Resolution???
On Sun, 2009-01-18 at 15:18 +0100, Roger Ineichen wrote: class DataStructure(Persistence): abstract class What is Persistence? Where does is come from? Sorry, I was just typing in a hurry. In reality it inherits from an openEHR class called Locatable but that gets into another whole thing about writing queries one time that run on every openEHR application. I hope you don't instanciate any of this classes and use them for store something. Do you? [my next 15 minutes] No! These classes are part of a reference model where clinical experts can use tools to build and govern maximal data sets for clinical concepts. The tools only give them the options to use classes developed in the reference model. These are called archetypes and are represented in a language called the Archetype Definition Language (A CEN/ISO standard). They are version controlled and every compliant system will have them. To describe how they work in an application let's use just one attribute of blood pressure; 'position'. So position would be an ItemList that is composed of Elements that are of type Text. In the Archetype, position can be one of: Standing Sitting Lying Reclining A specific application may only want to use Standing, Sitting, Lying. So a GUI in one location (triage?) may only want to allow the option of Sitting. But say in the ER GUI they may want to also Standing and Lying or a cardiologist may want to record Reclining (as well as the +/-angle). Of course there is lots more to BP than this. So at the application level the archetype can be constrained to allow only certain options and at the GUI level the template can be used to further constrain the options for ease AND accuracy of data entry. But now everywhere that instance of that BP goes it can be validated against the archetype and the reference model. It really isn't unlike writing Python code that runs on multiple platforms. The exception here is that openEHR is also programming language independent. OSHIP (the app I'm working on) is the Python implementation of the openEHR specifications. It will be a framework for building interoperable healthcare applications basically by writing only the templates. This work is based on more than 20 years of research and development (and other language implementations). More info at: http://www.openehr.org/shared-resources/getting_started/openehr_primer.html Cheers, Tim attachment: oe_trick.png signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Reusing Widgets
If I have an interface (IDvText) and a class DvText (shown below). and I want it to act exactly as a zope.schema Textline (with some additional attributes) then is this correct and how do I (where do I find how to) register/add to the TextLine widget? Apologies for the line wraps. ** from zope.schema import TextLine,Text,List,Dict,URI,Object from zope.i18nmessageid.message import MessageFactory from zope.interface import Interface from interfaces.codephrase import ICodePhrase from oship.openehr.rm.support.identification.interfaces.objectref import IObjectRef _ = MessageFactory('oship') class IDvText(Interface): blah blah! value = TextLine( title = _(uValue), description = _(uDisplayable rendition of the item, regardless of its underlying structure. For DV_CODED_TEXT, this is the rubric of the complete term as provided by the terminology service. No carriage returns, line feeds, or other non-printing characters permitted.), ) mappings=List( value_type=Object(schema=IObjectRef), title = _(uMappings), description = _(uA list of MappingTerm,terms from other terminologies most closely matching this term, typically used where the originator (e.g. pathology lab) of information uses a local terminology but also supplies one or more equivalents from wellknown terminologies (e.g. LOINC). The list contents should be of the type TermMapping), required = False, ) formatting = Text( title = _(uFormatting), description = _(uA format string of the form name:value; name:value..., e.g. font-weight : bold; font-family : Arial; font-size : 12pt;. Values taken from W3C CSS2 properties lists background and font.), required = False ) hyperlink = URI( title = _(uHyperlink), description = _(uOptional link sitting behind a section of plain text or coded term item as type DvUri.), required = False ) language = Object( schema = ICodePhrase, title = _(uLanguage), description = _(uOptional indicator of the localised language in which the value is written. Coded from openEHR Code Set languages. Only used when either the text object is in a different language from the enclosing ENTRY, or else the text object is being used outside of an ENTRY or other enclosing structure which indicates the language.), required = False ) encoding = Object( schema = ICodePhrase, title = _(uEncoding), description = _(uName of character encoding scheme in which this value is encoded. Coded from openEHR Code Set character sets. Unicode is the default assumption in openEHR, with UTF-8 being the assumed encoding. This attribute allows for variations from these assumptions.), required = False ) ** from zope.interface import implements from zope.i18nmessageid.message import MessageFactory from zope.schema import TextLine from interfaces.dvtext import IDvText _ = MessageFactory('oship') class DvText(TextLine): blah blah! implements(IDvText) def __init__(self, value, mappings=None, formatting=None, hyperlink=None, language=None, encoding=None): self.value = value self.mappings = mappings self.formatting = formatting self.hyperlink = hyperlink self.language = language self.encoding = encoding ** attachment: oe_trick.png signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Astonishing Error: Import Error: No module named interfacce
On Wed, 2009-02-04 at 23:53 +0100, Massimiliano della Rovere wrote: After restarting the zope istance I receive the following error: ImportError: No module named interfacce (from mabon.interfacce import IScheda) If you cpoy/pasted that error (and it looks the same in two places in your email) then you might want to check your spelling of interface.note one 'c'. HTH, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Selecting a Vocabulary for a Choice field upon the value of another field
On Fri, 2009-05-01 at 13:57 +0200, Massimiliano della Rovere wrote: 2) split the schema into two pages: in the first page, and thus stage, you define the wine colour, in the second the associated vocabulary is used. I do not like it because I want all the data describing the degustative experience in one page. This applies to page reloading too. I suggest using Viewlets attached to a Viewletmanager. I am just learning about these myself but it was easy to see how you can communicate between Viewlets. I recently did a remake of a Grok tutorial on viewlets: http://grok.zope.org/documentation/how-to/understanding-viewlets that demonstrates something that might help you out. Unfortunately they haven't published it yet but if you have a login on grok.zope.org I think I can share it with you. I'll also send you the code via email if you wish. Cheers, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Selecting a Vocabulary for a Choice field upon the value of another field
[talking to myself again] :-) On Fri, 2009-05-01 at 09:28 -0300, Tim Cook wrote: Unfortunately they haven't published it yet but if you have a login on grok.zope.org I think I can share it with you. I just discovered that I can share it with all logged in users. http://grok.zope.org/documentation/how-to/fred-wilma-revisited/view HTH, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] ComponentLookupError
I'm getting this traceback: == serving on http://127.0.0.1:8080 2009-05-17 11:56:42,332 ERROR [SiteError] http://localhost:8080 Traceback (most recent call last): File /home/tim/.buildout/eggs/zope.publisher-3.7.0-py2.5.egg/zope/publisher/publish.py, line 127, in publish publication.beforeTraversal(request) File /home/tim/.buildout/eggs/zope.app.publication-3.5.3-py2.5.egg/zope/app/publication/zopepublication.py, line 85, in beforeTraversal principal = auth.authenticate(request) File /home/tim/.buildout/eggs/zope.principalregistry-3.7.0-py2.5.egg/zope/principalregistry/principalregistry.py, line 58, in authenticate if p.validate(password): File /home/tim/.buildout/eggs/zope.principalregistry-3.7.0-py2.5.egg/zope/principalregistry/principalregistry.py, line 190, in validate pwManager = self.__getPasswordManager() File /home/tim/.buildout/eggs/zope.principalregistry-3.7.0-py2.5.egg/zope/principalregistry/principalregistry.py, line 184, in __getPasswordManager return getUtility(IPasswordManager, self.__pwManagerName) File /home/tim/.buildout/eggs/zope.component-3.6.0-py2.5.egg/zope/component/_api.py, line 171, in getUtility raise ComponentLookupError(interface, name) ComponentLookupError: (InterfaceClass zope.password.interfaces.IPasswordManager, u'SHA1') Though everything seems to me to be okay. This was originally a grokproject based application and uses grok 1.0a3 but I have been incrementally/painfully changing the versions of components to get it to run with ZODB3.9.0b1 The server starts but when I try to access http://localhost:8080 I get the above error. The principal in site.zcml looks like this: principal id=zope.manager title=Manager login=admin password=17e15cddd033e22ae348aeb5660fc2140aec35850c4da997 description=OSHIP Developer password_manager=SHA1 / Any ideas where to start on this? Thanks, Tim -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook ** *You may get my Public GPG key from popular keyservers or * *from this link http://timothywayne.cook.googlepages.com/home* ** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Z3ext 1.0 Beta3 Released
I have the same problem on Ubuntu. Besides the fact it is a weird datetime format it simply doesn't work with any format. --Tim On Mon, 2009-08-24 at 09:26 +1000, George Wright wrote: OK Nikolay It worked this time. New problem: I am unable to satisfy the date format requirement on an edit screen! For example I tried to create a new News item. I have tried everything I can think of but continue to get this message: The datetime string did not match the pattern u'M/d/yy h:mm a' Could someone give me an example of a date entry that does work? (My location is Australia. Mac OSX 10.5.8) Regards George On 23/08/2009, at 7:12 PM, Nikolay Kim wrote: problem is fixed just run ./bin/buildout again On Aug 23, 2009, at 5:16 AM, George Wright wrote: I downloaded Z3ext 1.0 Beta3. The installation did not run smoothly - just stopped in middle of self test cycle. ... ... ... George Wright georg...@bigpond.net.au http://mywebsite.bigpond.net.au/georgewr/ http://www.labyrinth.net.au/~gwright ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- Timothy Cook, MSc Health Informatics Research Development Services LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook Skype ID == timothy.cook *** *You may get my Public GPG key from popular keyservers or* *from this link http://timothywayne.cook.googlepages.com/home * *** signature.asc Description: This is a digitally signed message part ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users