[Zope-Annce] CMF 2.1.0-beta released

2007-03-09 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

The CMF developer community is hereby announcing the release of CMF
version 2.1.0-beta. The CMF 2.1 series will be used as the foundation
for the Plone 3.0 release, which will see its first beta over the next
few days as well.

What is the CMF?

  The Zope Content Management Framework provides a set of services and
  content objects useful for building highly dynamic, content-oriented
  portal sites. The CMF provides the foundation for popular software
  packages such as Plone. It is intended to be easily customizable, in
  terms of both the types of content used and the policies and services
  it provides.

Where do I get it?

  For release files, change logs, installation instructions and more
  please visit http://www.zope.org/Products/CMF/CMF-2.1.0-beta.

  Roadmap and release information can be found at
  http://www.zope.org/Products/CMF/docs/roadmap.

  The CMF mailing list can be reached at the [EMAIL PROTECTED] address,
  to sign up please visit http://mail.zope.org/mailman/listinfo/zope- 
cmf.


  Please file bug reports, feature requests or suggestions in the CMF
  bug collector at http://www.zope.org/Collectors/CMF .

What has changed since the last release?

  IMPORTANT NOTE:

If you upgrade an existing CMF instance to CMF 2.1, please see
INSTALL.txt for instructions on how to run a separate upgrade  
script.


  New Features

- CMFCalendar: Zope3 style browser views are now used by default.
  An additional setup profile allows you to hook up the oldstyle  
skins and

  to make customizations TTW.

- DirectoryView: Added 'registerDirectory' ZCML directive.
  Using the old registerDirectory method in __init__.py is now  
deprecated.

  See zcml.IRegisterDirectoryDirective for details.

- DirectoryView: Added support for non-product packages.
  This introduces new registry keys. Old registry keys stored in
  persistent DirectoryView objects are updated on the fly.
  (http://www.zope.org/Collectors/CMF/467)

- Document: Added two new methods for safety belt handling.

- setup handlers: Improved properties handler.
  It now works with properties using a default_charset other  
than UTF-8.


- Merged patches from Martin Aspeli to enable generating events  
before
  and after DCWorkflow transitions, and in the 'notify' methods  
of the

  workflow tool (http://www.zope.org/Collectors/CMF/461).

  Bug Fixes

- CMFUid.UniqueIdHandlerTool: Touching the internal UID value on a
  content item will not cause reindexing all indices anymore,  
only the

  specific UID index will be touched.
  (http://www.zope.org/Collectors/CMF/469)

- CMFCore.MembershipTool: Fixed inconsistent behavior where  
member lookup
  would take all user folders up to the Zope root into account  
whereas

  member area creation would not.

- CMFCore.MembershipTool/CMFDefault.MembershipTool: when using an
  object without a __nonzero__ but with a __len__ (ala
  CMFBTreeFolder) as a member folder, the createMemberArea method
  would believe there was no members folder if the folder was
  empty, and so would fail (change not membersfolder to
  membersfolder is not None) .

- CMFDefault.File and CMFDefault.Image: Restored ZMI Cache tab  
which was

  lost in CMF 1.6.

- CMFCore.DynamicType: Fixed behaviour regarding default view.
  DynamicType was making it impossible to use a Zope3-style
  default view for CMF content types.
  (http://www.zope.org/Collectors/CMF/459)

  Others

- Tool lookup and registration is now done the Zope 3 way as  
utilities.

  Please see docs/ToolsAreUtilities.txt for some developer notes.

- CMFCore utils: Marked 'minimalpath' and 'expandpath' as  
deprecated.


- The CMF now depends on Zope 2.10.2 or higher.

jens


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFF8SvFRAx5nvEhZLIRAoMdAKCpDmPch1uLAR6g/3Xq+x3F12w1kgCfZKsa
qVpT3k6bRXm6C+dutlylMMk=
=94JT
-END PGP SIGNATURE-
___
Zope-Announce maillist  -  Zope-Announce@zope.org
http://mail.zope.org/mailman/listinfo/zope-announce

 Zope-Announce for Announcements only - no discussions

(Related lists - 
Users: http://mail.zope.org/mailman/listinfo/zope

Developers: http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope-Checkins] SVN: Zope/branches/2.9-with-ZODB3.8/ - Making a Zope 2.9 flavour that supports ZODB 3.8.

2007-03-09 Thread Christian Theune
Log message for revision 73117:
   - Making a Zope 2.9 flavour that supports ZODB 3.8. 
  
   This is an unofficial branch.
  
  

Changed:
  A   Zope/branches/2.9-with-ZODB3.8/

-=-
Copied: Zope/branches/2.9-with-ZODB3.8 (from rev 73116, Zope/branches/2.9)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9-with-ZODB3.8/lib/python/ - moved pointers to ZODB and zope.proxy to trunk

2007-03-09 Thread Christian Theune
Log message for revision 73118:
   - moved pointers to ZODB and zope.proxy to trunk
  

Changed:
  _U  Zope/branches/2.9-with-ZODB3.8/lib/python/
  _U  Zope/branches/2.9-with-ZODB3.8/lib/python/zope/

-=-

Property changes on: Zope/branches/2.9-with-ZODB3.8/lib/python
___
Name: svn:externals
   - ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3.1
BTrees svn://svn.zope.org/repos/main/ZODB/tags/3.6.2/src/BTrees
persistent svn://svn.zope.org/repos/main/ZODB/tags/3.6.2/src/persistent
ThreadedAsync  svn://svn.zope.org/repos/main/ZODB/tags/3.6.2/src/ThreadedAsync
transactionsvn://svn.zope.org/repos/main/ZODB/tags/3.6.2/src/transaction
ZEOsvn://svn.zope.org/repos/main/ZODB/tags/3.6.2/src/ZEO
ZODB   svn://svn.zope.org/repos/main/ZODB/tags/3.6.2/src/ZODB
ZopeUndo   svn://svn.zope.org/repos/main/ZODB/tags/3.6.2/src/ZopeUndo
# Todo: tag zdaemon
zdaemon-r 40792 svn://svn.zope.org/repos/main/zdaemon/trunk/src/zdaemon
pytz   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/pytz
zodbcode   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zodbcode
ClientCookie   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/ClientCookie
mechanize  svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/mechanize

   + ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3.1
BTrees svn://svn.zope.org/repos/main/ZODB/trunk/src/BTrees
persistent svn://svn.zope.org/repos/main/ZODB/trunk/src/persistent
ThreadedAsync  svn://svn.zope.org/repos/main/ZODB/trunk/src/ThreadedAsync
transactionsvn://svn.zope.org/repos/main/ZODB/trunk/src/transaction
ZEOsvn://svn.zope.org/repos/main/ZODB/trunk/src/ZEO
ZODB   svn://svn.zope.org/repos/main/ZODB/trunk/src/ZODB
ZopeUndo   svn://svn.zope.org/repos/main/ZODB/trunk/src/ZopeUndo
# Todo: tag zdaemon
zdaemon-r 40792 svn://svn.zope.org/repos/main/zdaemon/trunk/src/zdaemon
pytz   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/pytz
zodbcode   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zodbcode
ClientCookie   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/ClientCookie
mechanize  svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/mechanize



Property changes on: Zope/branches/2.9-with-ZODB3.8/lib/python/zope
___
Name: svn:externals
   - cachedescriptors  
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/cachedescriptors
component 
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/component
configuration 
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/configuration
documenttemplate  
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/documenttemplate
event svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/event
exceptions
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/exceptions
hookable  
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/hookable
i18n  svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/i18n
i18nmessageid 
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/i18nmessageid
interface 
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/interface
modulealias   
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/modulealias
pagetemplate  
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/pagetemplate
proxy svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/proxy
publisher 
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/publisher
schemasvn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/schema
security  
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/security
serversvn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/server
structuredtext
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/structuredtext
tal   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/tal
tales svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/tales
threadsvn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/thread
deprecation   
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/deprecation
dottedname
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/dottedname
formlib   
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/formlib
index svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/index
testbrowser   
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/testbrowser
testing   
svn://svn.zope.org/repos/main/zope.testing/tags/3.0/src/zope/testing
contentprovider   
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/contentprovider
viewlet   
svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zope/viewlet



   + cachedescriptors  

[Zope-Checkins] SVN: Zope/branches/2.9-with-ZODB3.8/lib/python/ - updated to newer zodbcode because of testbreakage

2007-03-09 Thread Christian Theune
Log message for revision 73120:
   - updated to newer zodbcode because of testbreakage
  

Changed:
  _U  Zope/branches/2.9-with-ZODB3.8/lib/python/

-=-

Property changes on: Zope/branches/2.9-with-ZODB3.8/lib/python
___
Name: svn:externals
   - ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3.1
BTrees svn://svn.zope.org/repos/main/ZODB/trunk/src/BTrees
persistent svn://svn.zope.org/repos/main/ZODB/trunk/src/persistent
ThreadedAsync  svn://svn.zope.org/repos/main/ZODB/trunk/src/ThreadedAsync
transactionsvn://svn.zope.org/repos/main/ZODB/trunk/src/transaction
ZEOsvn://svn.zope.org/repos/main/ZODB/trunk/src/ZEO
ZODB   svn://svn.zope.org/repos/main/ZODB/trunk/src/ZODB
ZopeUndo   svn://svn.zope.org/repos/main/ZODB/trunk/src/ZopeUndo
# Todo: tag zdaemon
zdaemon-r 40792 svn://svn.zope.org/repos/main/zdaemon/trunk/src/zdaemon
pytz   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/pytz
zodbcode   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/zodbcode
ClientCookie   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/ClientCookie
mechanize  svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/mechanize

   + ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3.1
BTrees svn://svn.zope.org/repos/main/ZODB/trunk/src/BTrees
persistent svn://svn.zope.org/repos/main/ZODB/trunk/src/persistent
ThreadedAsync  svn://svn.zope.org/repos/main/ZODB/trunk/src/ThreadedAsync
transactionsvn://svn.zope.org/repos/main/ZODB/trunk/src/transaction
ZEOsvn://svn.zope.org/repos/main/ZODB/trunk/src/ZEO
ZODB   svn://svn.zope.org/repos/main/ZODB/trunk/src/ZODB
ZopeUndo   svn://svn.zope.org/repos/main/ZODB/trunk/src/ZopeUndo
# Todo: tag zdaemon
zdaemon-r 40792 svn://svn.zope.org/repos/main/zdaemon/trunk/src/zdaemon
pytz   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/pytz
zodbcode   svn://svn.zope.org/repos/main/Zope3/trunk/src/zodbcode
ClientCookie   svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/ClientCookie
mechanize  svn://svn.zope.org/repos/main/Zope3/tags/3.2.2/src/mechanize


___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9-with-ZODB3.8/lib/python/OFS/tests/testHistory.py - fixed test that was too strict

2007-03-09 Thread Christian Theune
Log message for revision 73121:
   - fixed test that was too strict
  

Changed:
  U   Zope/branches/2.9-with-ZODB3.8/lib/python/OFS/tests/testHistory.py

-=-
Modified: Zope/branches/2.9-with-ZODB3.8/lib/python/OFS/tests/testHistory.py
===
--- Zope/branches/2.9-with-ZODB3.8/lib/python/OFS/tests/testHistory.py  
2007-03-09 15:47:50 UTC (rev 73120)
+++ Zope/branches/2.9-with-ZODB3.8/lib/python/OFS/tests/testHistory.py  
2007-03-09 15:49:14 UTC (rev 73121)
@@ -69,8 +69,8 @@
 self.failUnless('tid' in entry) 
 self.failUnless('time' in entry) 
 if i:
-# check times are increasing
-self.failUnless(entry['time']r[i-1]['time'])
+# check times are not decreasing
+self.failUnless(entry['time']=r[i-1]['time'])
 self.assertEqual(entry['user_name'],'')
 self.assertEqual(entry['version'],'')
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9-with-ZODB3.8/ - backported feature to support named temporary files

2007-03-09 Thread Christian Theune
Log message for revision 73132:
   - backported feature to support named temporary files
  

Changed:
  U   Zope/branches/2.9-with-ZODB3.8/doc/CHANGES.txt
  U   Zope/branches/2.9-with-ZODB3.8/lib/python/ZPublisher/HTTPRequest.py
  U   
Zope/branches/2.9-with-ZODB3.8/lib/python/ZPublisher/tests/testHTTPRequest.py

-=-
Modified: Zope/branches/2.9-with-ZODB3.8/doc/CHANGES.txt
===
--- Zope/branches/2.9-with-ZODB3.8/doc/CHANGES.txt  2007-03-09 21:00:06 UTC 
(rev 73131)
+++ Zope/branches/2.9-with-ZODB3.8/doc/CHANGES.txt  2007-03-09 21:27:51 UTC 
(rev 73132)
@@ -4,6 +4,10 @@
   Change information for previous versions of Zope can be found in the
   file HISTORY.txt.
 
+  Blob-support branch
+
+  - Backported feature from Zope 2.11 to support named temporary files.
+
   Zope 2.9.7 (unreleased)
 
Bugs fixed

Modified: Zope/branches/2.9-with-ZODB3.8/lib/python/ZPublisher/HTTPRequest.py
===
--- Zope/branches/2.9-with-ZODB3.8/lib/python/ZPublisher/HTTPRequest.py 
2007-03-09 21:00:06 UTC (rev 73131)
+++ Zope/branches/2.9-with-ZODB3.8/lib/python/ZPublisher/HTTPRequest.py 
2007-03-09 21:27:51 UTC (rev 73132)
@@ -13,7 +13,7 @@
 
 __version__='$Revision: 1.96 $'[11:-2]
 
-import re, sys, os, time, random, codecs
+import re, sys, os, time, random, codecs, tempfile
 from types import StringType, UnicodeType
 from BaseRequest import BaseRequest, quote
 from HTTPResponse import HTTPResponse
@@ -383,7 +383,7 @@
 taintedform=self.taintedform
 
 meth=None
-fs=FieldStorage(fp=fp,environ=environ,keep_blank_values=1)
+fs=ZopeFieldStorage(fp=fp,environ=environ,keep_blank_values=1)
 if not hasattr(fs,'list') or fs.list is None:
 # Hm, maybe it's an XML-RPC
 if (fs.headers.has_key('content-type') and
@@ -1395,7 +1395,11 @@
 except: pass
 return dict
 
+class ZopeFieldStorage(FieldStorage):
 
+def make_file(self, binary=None):
+return tempfile.NamedTemporaryFile(w+b)
+
 class FileUpload:
 '''\
 File upload objects
@@ -1420,7 +1424,7 @@
 else: methods= ['close', 'fileno', 'flush', 'isatty',
 'read', 'readline', 'readlines', 'seek',
 'tell', 'truncate', 'write', 'writelines',
-'__iter__','next'] # see Collector 1837
+'__iter__','next', 'name'] # see Collector 1837
 
 d=self.__dict__
 for m in methods:

Modified: 
Zope/branches/2.9-with-ZODB3.8/lib/python/ZPublisher/tests/testHTTPRequest.py
===
--- 
Zope/branches/2.9-with-ZODB3.8/lib/python/ZPublisher/tests/testHTTPRequest.py   
2007-03-09 21:00:06 UTC (rev 73131)
+++ 
Zope/branches/2.9-with-ZODB3.8/lib/python/ZPublisher/tests/testHTTPRequest.py   
2007-03-09 21:27:51 UTC (rev 73132)
@@ -1,6 +1,15 @@
 import unittest
 from urllib import quote_plus
 
+TEST_LARGEFILE_DATA = '''
+--12345
+Content-Disposition: form-data; name=file; filename=file
+Content-Type: application/octet-stream
+
+test %s
+
+''' % ('test' * 1000)
+
 class AuthCredentialsTestsa( unittest.TestCase ):
 
 def _getTargetClass(self):
@@ -684,6 +693,17 @@
 req.close()
 self.assertEqual(start_count, sys.getrefcount(s))  # The test
 
+def testFileName(self):
+# checks fileupload object supports the filename
+from StringIO import StringIO
+s = StringIO(TEST_LARGEFILE_DATA)
+env = TEST_ENVIRON.copy()
+from ZPublisher.HTTPRequest import HTTPRequest
+req = HTTPRequest(s, env, None)
+req.processInputs()
+f = req.form.get('file')
+self.assert_(f.name)
+
 def testFileIterator(self):
 # checks fileupload object supports the iterator protocol
 # collector entry 1837

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Zope Tests: 7 OK

2007-03-09 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Thu Mar  8 12:00:00 2007 UTC to Fri Mar  9 12:00:00 2007 UTC.
There were 7 messages: 7 from Zope Unit Tests.


Tests passed OK
---

Subject: OK : Zope-2.6 Python-2.1.3 : Linux
From: Zope Unit Tests
Date: Thu Mar  8 21:03:43 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007412.html

Subject: OK : Zope-2.6 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Thu Mar  8 21:05:13 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007413.html

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Thu Mar  8 21:06:43 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007414.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Thu Mar  8 21:08:14 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007415.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Mar  8 21:09:44 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007416.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Mar  8 21:11:14 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007417.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Mar  8 21:12:44 EST 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007418.html

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Early processing of request body (was: Proposal for optimized Blob handling)

2007-03-09 Thread Dieter Maurer
Christian Theune wrote at 2007-3-7 22:05 +0100:
 ...
If 5 seconds are spend in the application thread to untangle mime data
which has nothing application-specific about it and then only 100ms or
so in the application itself, I'd say there is a major overhead problem.

But if the IO thread spends 5 seconds, then Zope will be unresponsive
for 5 seconds -- for me (and hopefully others, too) a far more
critical situation than a (single) worker spending 5 seconds...

The IO (ZServer) thread should only perform minimal work in its
asyncore callbacks -- each callback should return within
a few milliseconds.


My argument does not argue against different threads between
the IO thread and the worker threads, just against giving
the IO thread significant work (whether or not you consider it
application specific).




-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Upcoming Zope releases

2007-03-09 Thread Andreas Jung

Hi,

I plan to release in about two weeks:

- Zope 2.10.3
- Zope 2.9.7
- Zope 2.8.9

The releases should fix some minor issues. If you have some
fixes pending, please commit them during the next two week.

Andreas


pgpUT9QcnEJN0.pgp
Description: PGP signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope] have problem with managing objects within a external product

2007-03-09 Thread Allen Huang
I made a simple product using python that stores some varibles, but I couldn't 
make it acts like a folderish, stores objects, and have a content tab page 
using manage_main like when I use to have when I use internal product.

I reviewed the tutorials on how to make internal products and I found the base 
class modules ObjectManager and PropertySheets under OFS folder but I really 
ahve no idea how to use them.

So it I want my product to act like an internally made product with baseclass 
ObjectManager, CatalogAware, and use propertysheets to manage my attributes and 
control what object type I want to store, 

would importing ObjectManager, PropertySheets, CatalogAware baseclass be enough?


 

Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html ___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] have problem with managing objects within a external product

2007-03-09 Thread Andreas Jung



--On 9. März 2007 00:01:50 -0800 Allen Huang [EMAIL PROTECTED] wrote:


I made a simple product using python that stores some varibles, but I
couldn't make it acts like a folderish, stores objects, and have a
content tab page using manage_main like when I use to have when I use
internal product.

I reviewed the tutorials on how to make internal products and I found the
base class modules ObjectManager and PropertySheets under OFS folder but
I really ahve no idea how to use them.

So it I want my product to act like an internally made product with
baseclass ObjectManager, CatalogAware, and use propertysheets to manage
my attributes and control what object type I want to store,

would importing ObjectManager, PropertySheets, CatalogAware baseclass be
enough?


For folderish content you derive from ObjectManager or for being on the 
safe side from OFS.Folder


from OFS.Folder import Folder

class MyType(Folder):

 meta_type= 'MyType'



.

IntiializeClass(MyType)

-aj



pgplu6AnFYrqr.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Two mysql / timestamp related fixes

2007-03-09 Thread Tino Wildenhain

Gaute Amundsen schrieb:

On Thursday 08 March 2007 17:27, Tino Wildenhain wrote:

Gaute Amundsen schrieb:

Hi.

snip

1 )
First I got a ValueError 'query' when using a very simple zsql method.
(consisting of only dtml-var sql )

Thats a very bad idea. Better make zsql methods
for every query 


I know the orthodoxy :-/
I'd rather have a proper DB library, (or model layer, if you will) 
and build my SQL in python. 


So you want to use SQLAlchemy? Feel free to write a product
as wrapper :-)


To build anything complex or generalized in dtml is a PAIN.


Is it? Can you come up with examples?


And a sea of too specific templates is even worse.


Well from some level of complexity you could also use
database functions. But if its so complex, why using
MySQL?

instead of 
rebuilding your own (obviously not working)
templating for SQL. 


I's not a template, it's a wrapper to get around the whole mess.
A hack in fact ;)

If a template this simple dtml-var sql  is obviously not working
then it is ZSQLMethods that have a problem, not me.


No, the content of your variable sql is wrong :-)
dtml-var sql would indeed work if it contains valid sql
code.


(it's working fine now.)

Quoting is done automatically 
when you use dtml-sqlvar ...


I can use sql_quote when I need to, thankyou.


this does not need to work identical - but current
adaptors indeed do their handmade quoting.



The only thing that I worry about is transaction support.
insert foo; select last_inserted works when built inside the template with 
dtml, but not with the exact same statement passed to this wrapper.

Probably another bug, but I have not taken time to dig properly into it yet.


Yes, MySQL doesnt want ; as sql-delimiter. It rather wants \0 and sql
methods hack around it for you if you put the template there.

Transactions are maintained thrughout your session (read: request)
so there is no need to squeeze it all into one ZSQL call. Every
subsequent ZSQL call inside your request will be in the same
database transaction.


Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] No space left on device

2007-03-09 Thread tonylabarbara
Hi;
I'm moving everything over to a new server because the old server's OS is 
corrupt. I've d'l'd a 300MB *.zexp file from the old server. (I have to d'l it 
to my PC over a slow satellite connection, then upload it to the new server 
because of the corruption.) When I went to install it, I got this error:
 
No space left on device
 
Here's the entire traceback. Is this stating that it's too big for the 
temporary storage? Is there a way to increase that limit? I suppose I could 
create a new Data.fs with just this folder, but because of the above-mentioned, 
it's a nightmare downloading and then uploading it.
 
TIA,
Tony
 
Traceback (innermost last):
* Module ZPublisher.Publish, line 101, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 39, in call_object
* Module OFS.ObjectManager, line 543, in manage_importObject
* Module OFS.ObjectManager, line 560, in _importObjectFromFile
* Module ZODB.ExportImport, line 85, in importFile
* Module Products.TransactionAgents, line 54, in new_commit
* Module ZODB.Transaction, line 241, in commit
* Module ZODB.Transaction, line 356, in _commit_objects
* Module ZODB.Connection, line 344, in commit
* Module ZODB.ExportImport, line 157, in _importDuringCommit
* Module ZODB.TmpStore, line 87, in store
IOError: [Errno 28] No space left on device

AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-09 Thread Tino Wildenhain

Martijn Pieters schrieb:

On 3/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I thought I could call a variable in a page template by defining it 
and then

putting a ? in front of it in a URL, like this:


Incorrect, you can only use ? to interpolate variables into a path 
expression:


 span tal:define=foo string:bar
 tal:content=here/?foo/span

The above example will look up 'bar' and render it as the content of the 
span.



I notice ZPT gets weirder and weirder...
How many syntactic specialities will we add to path expressions? ;)
Why not keep it simple? :-)

Or make it simpler by removing even tal:define ...

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] No space left on device

2007-03-09 Thread Andreas Jung



--On 9. März 2007 03:45:05 -0500 [EMAIL PROTECTED] wrote:


Hi;
I'm moving everything over to a new server because the old server's OS is
corrupt. I've d'l'd a 300MB *.zexp file from the old server. (I have to
d'l it to my PC over a slow satellite connection, then upload it to the
new server because of the corruption.) When I went to install it, I got
this error:
No space left on device



This is not a Zope issue but an issue of your system: your
file system is *full*. In detail your /tmp filesystem system to be full.
Either clear it or change the temporary directory for the Zope process
by setting the TMPDIR environment variable.

-aj

pgpm8XYHOgWsw.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-09 Thread Martijn Pieters

On 3/9/07, Tino Wildenhain [EMAIL PROTECTED] wrote:

I notice ZPT gets weirder and weirder...
How many syntactic specialities will we add to path expressions? ;)


?var interpolation have been supported since the first checkin Evan
Simpson made nearly 6 years ago, the feature has been a bit
underdocumented, but it is not a recent addition..

--
Martijn Pieters
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] No space left on device

2007-03-09 Thread tonylabarbara
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; zope@zope.org
Sent: Fri, 9 Mar 2007 4:49 AM
Subject: Re: [Zope] No space left on device


 
--On 9. März 2007 03:45:05 -0500 [EMAIL PROTECTED] wrote: 
 
  Hi; 
  I'm moving everything over to a new server because the old server's OS is 
  corrupt. I've d'l'd a 300MB *.zexp file from the old server. (I have to 
  d'l it to my PC over a slow satellite connection, then upload it to the 
  new server because of the corruption.) When I went to install it, I got 
  this error: 
  No space left on device 
  
 
 This is not a Zope issue but an issue of your system: your 
 file system is *full*. In detail your /tmp filesystem system to be full. 
 Either clear it or change the temporary directory for the Zope process 
 by setting the TMPDIR environment variable. 
 
Where? I added this line to zopectl and rebooted:
TMPDIR=/usr/local/zope/tmp
(usr has plenty of space) but it didn't help.
TIA,
Tony

AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] No space left on device

2007-03-09 Thread Maciej Wisniowski
 
 Where? I added this line to zopectl and rebooted:
 TMPDIR=/usr/local/zope/tmp
 (usr has plenty of space) but it didn't help.

TMPDIR=/usr/local/zope/tmp
export TMPDIR

also there is df -h command that shows free space
on devices, you may use this to observe how it
changes while importing etc.

-- 
Maciej Wisniowski
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Andreas Jung



--On 9. März 2007 14:42:57 +0530 Remil Mathew [EMAIL PROTECTED] wrote:


Hi,
How can run  multiple query in an Z sql method..


Sure. SQL Statement just have to separated by dtml-sql-delimiter.

I am using Mysql..

Also is there any method to return a value from insert query?


An insert statement does not return a value! If you are working
with sequences for generating the primary  key you might perform
a select on the current value of the related sequence.

-aj

pgpCeOnEf4T8A.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] No space left on device

2007-03-09 Thread Tino Wildenhain

Maciej Wisniowski schrieb:
 

Where? I added this line to zopectl and rebooted:


rebooted? Lets hope you only restartet zope :-)


Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] No space left on device

2007-03-09 Thread tonylabarbara
Right, restarted. But it didn't work, Tino. Any ideas? 
 
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Fri, 9 Mar 2007 6:28 AM
Subject: Re: [Zope] No space left on device


Maciej Wisniowski schrieb: 
  Where? I added this line to zopectl and rebooted: 
 
rebooted? Lets hope you only restartet zope :-) 
 
Regards 
Tino 

AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Tino Wildenhain

Andreas Jung schrieb:



--On 9. März 2007 14:42:57 +0530 Remil Mathew [EMAIL PROTECTED] wrote:


Hi,
How can run  multiple query in an Z sql method..


Sure. SQL Statement just have to separated by dtml-sql-delimiter.

I am using Mysql..

Also is there any method to return a value from insert query?


An insert statement does not return a value! If you are working
with sequences for generating the primary  key you might perform
a select on the current value of the related sequence.


Well, it can. See RETURNING clause:
http://www.postgresql.org/docs/8.2/static/sql-insert.html

but I doubt mysql supports this ... checking ... no, it doesnt.

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-09 Thread Chris Withers

[EMAIL PROTECTED] wrote:

Hi;
I thought I could call a variable in a page template by defining it and then 
putting a ? in front of it in a URL, like this:
 
html tal:define=global base_url here/baseURL;

template_id string:index;
here python:here.restrictedTraverse('s/c/x/root/en-us/Help')


redefining 'here' isn't a good idea...


a href=?base_url/contactus.pt


I think you meant:

a href=#
   tal:attributes=href string:${base_url}/contactus.pt

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a Variable

2007-03-09 Thread Chris Withers

Tino Wildenhain wrote:

I notice ZPT gets weirder and weirder...


It's always been that weird ;-)

If you want sanity, try Twiddler instead :-)

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Two mysql / timestamp related fixes

2007-03-09 Thread Gaute Amundsen
On Friday 09 March 2007 09:40, Tino Wildenhain wrote:
 Gaute Amundsen schrieb:
  On Thursday 08 March 2007 17:27, Tino Wildenhain wrote:
  Gaute Amundsen schrieb:
  Hi.
 
  snip
 
  1 )
  First I got a ValueError 'query' when using a very simple zsql method.
  (consisting of only dtml-var sql )
 
  Thats a very bad idea. Better make zsql methods
  for every query
 
  I know the orthodoxy :-/
  I'd rather have a proper DB library, (or model layer, if you will)
  and build my SQL in python.

 So you want to use SQLAlchemy? Feel free to write a product
 as wrapper :-)

Hm.. have never quite gotten around  to writing my first product.
Looks like a very nice candidate, but no promises :)

  To build anything complex or generalized in dtml is a PAIN.

 Is it? Can you come up with examples?

tabell:string
felter:list
INSERT INTO dtml-var tabell sql_quote SET
dtml-in expr=felter.keys()
  dtml-let key=sequence-item value=felter[key]
dtml-unless sequence-start,/dtml-unless
dtml-var key sql_quote =
dtml-if expr=same_type(value, 1)
  dtml-sqlvar value type=int
dtml-elif expr=same_type(value, 1.0)
  dtml-sqlvar value type=float
dtml-else
  dtml-sqlvar value type=string
/dtml-if
  /dtml-let
/dtml-in
dtml-var sql_delimiter
SELECT LAST_INSERT_ID()

and that is not _really_ complex is it?
There's the whole sqlgroup thing.

dtml is after all depreciated, so I can see no reason to learn it as torougly 
as ZSQLMethods obviously requires when I can use python instead.

  And a sea of too specific templates is even worse.

 Well from some level of complexity you could also use
 database functions. But if its so complex, why using
 MySQL?

Don't see quite what you mean here, but it would be just the same problems 
with PGsql.

  instead of
  rebuilding your own (obviously not working)
  templating for SQL.
 
  I's not a template, it's a wrapper to get around the whole mess.
  A hack in fact ;)
 
  If a template this simple dtml-var sql  is obviously not working
  then it is ZSQLMethods that have a problem, not me.

 No, the content of your variable sql is wrong :-)
 dtml-var sql would indeed work if it contains valid sql
 code.

It did not. 
That was the whole point of this mail.

The method was dtml-var sql  and the sql was select * from foo
care to spot the invalid code in that?

  (it's working fine now.)
 
  Quoting is done automatically
  when you use dtml-sqlvar ...
 
  I can use sql_quote when I need to, thankyou.

 this does not need to work identical - but current
 adaptors indeed do their handmade quoting.

  The only thing that I worry about is transaction support.
  insert foo; select last_inserted works when built inside the template
  with dtml, but not with the exact same statement passed to this
  wrapper. Probably another bug, but I have not taken time to dig
  properly into it yet.

 Yes, MySQL doesnt want ; as sql-delimiter. It rather wants \0 and sql
 methods hack around it for you if you put the template there.


Hm.. interesting, but I looked into it a bit, and I can't find where this 
happens.
I see that ZRDB/DA.py does: argdata['sql_delimiter']='\0'
Tried a query = query.replace(';','\0') at line 444, but to no effect :)

Suggestions?
I guess this could be a problem with LAST_INSERT_ID, forcing me to use 
ZSQLMethods, or dome ugly workaround  for inserts, where I need the id 
afterwards.

 Transactions are maintained thrughout your session (read: request)
 so there is no need to squeeze it all into one ZSQL call. Every
 subsequent ZSQL call inside your request will be in the same
 database transaction.


No plans to squeze it all into one huge SQL statement. Now THAT would be ugly!
but python errors does not trigger rollback it seems. I guess only sql errors 
would do that?

regards

Gaute 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Gaute Amundsen
On Friday 09 March 2007 10:12, Remil Mathew wrote:
 Hi,
 How can run  multiple query in an Z sql method.. I am using Mysql..
 Also is there any method to return a value from insert query?

 Thanks
 Remil

could you possibly be thinking of?

insert foo into bar
dtml-var sql_delimiter
SELECT LAST_INSERT_ID()


gaute
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Jary Busato




Yes, I must do it when I need to know an autonumber PK after an insert.
when DB support transaction i write:

begin transaction
insert foo into bar
dtml-var sql_delimiter
SELECT LAST_INSERT_ID() as lastid
commit

Then, a DTML method:

dtml-in myZSQLinsertandselect()
dtml-var lastid
/dtml-in

Make the insert and write the id returned by the select.

Illorca

Gaute Amundsen ha scritto:

  On Friday 09 March 2007 10:12, Remil Mathew wrote:
  
  
Hi,
How can run  multiple query in an Z sql method.. I am using Mysql..
Also is there any method to return a value from insert query?

Thanks
Remil

  
  
could you possibly be thinking of?

insert foo into bar
dtml-var sql_delimiter
SELECT LAST_INSERT_ID()


gaute
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )
.

  




___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Two mysql / timestamp related fixes

2007-03-09 Thread Tino Wildenhain

Gaute Amundsen schrieb:

On Friday 09 March 2007 09:40, Tino Wildenhain wrote:

Gaute Amundsen schrieb:

On Thursday 08 March 2007 17:27, Tino Wildenhain wrote:

Gaute Amundsen schrieb:

Hi.

snip


1 )
First I got a ValueError 'query' when using a very simple zsql method.
(consisting of only dtml-var sql )

Thats a very bad idea. Better make zsql methods
for every query

I know the orthodoxy :-/
I'd rather have a proper DB library, (or model layer, if you will)
and build my SQL in python.

So you want to use SQLAlchemy? Feel free to write a product
as wrapper :-)


Hm.. have never quite gotten around  to writing my first product.
Looks like a very nice candidate, but no promises :)


To build anything complex or generalized in dtml is a PAIN.

Is it? Can you come up with examples?


tabell:string
felter:list
INSERT INTO dtml-var tabell sql_quote SET
dtml-in expr=felter.keys()
  dtml-let key=sequence-item value=felter[key]
dtml-unless sequence-start,/dtml-unless
dtml-var key sql_quote =
dtml-if expr=same_type(value, 1)
  dtml-sqlvar value type=int
dtml-elif expr=same_type(value, 1.0)
  dtml-sqlvar value type=float
dtml-else
  dtml-sqlvar value type=string
/dtml-if
  /dtml-let
/dtml-in
dtml-var sql_delimiter
SELECT LAST_INSERT_ID()

and that is not _really_ complex is it?


Well, it looks a bit silly - I mean you make
a hand-written ORM? This would be the time to
either write a real ORM as product or try
some of the available: ZPatterns, Archetypes, ...

Usual database interacting zope solutions
have only a handful insert places where you
need bulk inserts. And even then you can just
call one ZSQL method (per table) in a loop
to insert your values from a list.

More, sql_quote does not really work
for tablenames or column names - it
may work by accident for MySQL though,
but not for standards compliant databases.



There's the whole sqlgroup thing.


Well to be honest I never used it ;)

dtml is after all depreciated, so I can see no reason to learn it as torougly 
as ZSQLMethods obviously requires when I can use python instead.


You always can but what do you gain? How does your python script
code look like for the above problem?


And a sea of too specific templates is even worse.

Well from some level of complexity you could also use
database functions. But if its so complex, why using
MySQL?

Don't see quite what you mean here, but it would be just the same problems 
with PGsql.


Not direct related but if you have complex queries,
e.g. join over many tables, partial indexes, subqueries, ...
it may be a bit hard to get reliable performance with MySQL.
I think it was related to different views at the word complex
queries


instead of
rebuilding your own (obviously not working)
templating for SQL.

I's not a template, it's a wrapper to get around the whole mess.
A hack in fact ;)

If a template this simple dtml-var sql  is obviously not working
then it is ZSQLMethods that have a problem, not me.

No, the content of your variable sql is wrong :-)
dtml-var sql would indeed work if it contains valid sql
code.


It did not. 
That was the whole point of this mail.


The method was dtml-var sql  and the sql was select * from foo
care to spot the invalid code in that?


wait... your variable really is named sql? Maybe that is
the problem. I did not verify this but it could be. DTML
is sometimes weird ;)


(it's working fine now.)


Quoting is done automatically
when you use dtml-sqlvar ...

I can use sql_quote when I need to, thankyou.

this does not need to work identical - but current
adaptors indeed do their handmade quoting.


The only thing that I worry about is transaction support.
insert foo; select last_inserted works when built inside the template
with dtml, but not with the exact same statement passed to this
wrapper. Probably another bug, but I have not taken time to dig
properly into it yet.

Yes, MySQL doesnt want ; as sql-delimiter. It rather wants \0 and sql
methods hack around it for you if you put the template there.



Hm.. interesting, but I looked into it a bit, and I can't find where this 
happens.

I see that ZRDB/DA.py does: argdata['sql_delimiter']='\0'
Tried a query = query.replace(';','\0') at line 444, but to no effect :)


Interesting. I must admit the whole ZSQL Code is very old and ugly
and I even removed some parts in my private installations ;)



Suggestions?
I guess this could be a problem with LAST_INSERT_ID, forcing me to use 
ZSQLMethods, or dome ugly workaround  for inserts, where I need the id 
afterwards.


Last_insert_id is really part of the uglyness of mysql. But you would
work around with distinct ZSQL Methods. See these methods as interface
and really methods of your database to interact with your data model.


Transactions are maintained thrughout your session (read: request)
so there is no need to squeeze it all into one ZSQL call. Every
subsequent ZSQL call inside your request will be in the same
database transaction.



No 

Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Andreas Jung



--On 9. März 2007 15:30:23 +0100 Jary Busato [EMAIL PROTECTED] wrote:


Yes, I must do it when I need to know an autonumber PK after an insert.
when DB support transaction i write:

begin transaction

insert foo into bar
dtml-var sql_delimiter
SELECT LAST_INSERT_ID() as lastid
commit


Sorry, but you must be crazy to perform you own transaction handling within 
Zope. Dealing with transactions is the task of Zope and your database but 
it is *not recommended* to perform your own transaction hand here...at least
not in this way. If you want o integration a third-party system the 
transaction handling of Zope: look at the DataManager API of Zope's

transaction module.

-aj



pgpCOvEGVPQep.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Jary Busato
My only need is to be sure to keep the right id; I did'nt use this 
method for other operations.
You sayd that it's not recommended but I don't understand why in this 
simple context.


Andreas Jung ha scritto:



--On 9. März 2007 15:30:23 +0100 Jary Busato [EMAIL PROTECTED] wrote:


Yes, I must do it when I need to know an autonumber PK after an insert.
when DB support transaction i write:

begin transaction

insert foo into bar
dtml-var sql_delimiter
SELECT LAST_INSERT_ID() as lastid
commit


Sorry, but you must be crazy to perform you own transaction handling 
within Zope. Dealing with transactions is the task of Zope and your 
database but it is *not recommended* to perform your own transaction 
hand here...at least
not in this way. If you want o integration a third-party system the 
transaction handling of Zope: look at the DataManager API of Zope's

transaction module.

-aj



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Andreas Jung



--On 9. März 2007 16:45:56 +0100 Jary Busato [EMAIL PROTECTED] wrote:


My only need is to be sure to keep the right id; I did'nt use this method
for other operations.
You sayd that it's not recommended but I don't understand why in this
simple context.



Simple or complex context..that does not matter. It is just bad-style.

-aj

pgpD8jUybMYcl.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] can not install ZMySQLDA

2007-03-09 Thread Daniel
Sorry! I'm new to this fields. Where can I change this PYTHON_EGG_CACHE?
Is it in zope.conf? I can not find it.

Thanks, -DY


On Thu, March 8, 2007 10:28 pm, Maciej Wisniowski wrote:

 I already change the permission.
 8 drwxrwxrwx   4 zope zope  4096 Mar  7 22:13 .python-eggs
 The result is the same. I completely lost?
 And what with /home/zope permissions?

 You may also try to set PYTHON_EGG_CACHE variable to a
 different folder.
 I've never had such problems so I can't help too much.
 Try to search the web for this problem, you'll possibly
 find something.

 --
 Maciej Wisniowski

 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )






___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Marco Bizzarri

On 3/9/07, Jary Busato [EMAIL PROTECTED] wrote:

If I understood you're telling me that begin and commit statements are
redundant.


Yes, exactly: they are issued by Zope at the boundaries of a transaction.


Sometimes conflicts are not correctly managed by ZTM (no rollbacks in db)


Are you using a non-transactional database (like old MySQL version)?


--
Marco Bizzarri
http://iliveinpisa.blogspot.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] can not install ZMySQLDA

2007-03-09 Thread Andreas Jung



--On 9. März 2007 08:19:50 -0800 Daniel [EMAIL PROTECTED] wrote:


Sorry! I'm new to this fields. Where can I change this PYTHON_EGG_CACHE?
Is it in zope.conf? I can not find it.




PYTHON_EGG_CACHE is an environment variable and has nothing to do with Zope.

-aj

pgpg8H33YRPNw.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How can run multiple query in an Z sql method

2007-03-09 Thread Marco Bizzarri

On 3/9/07, Jary Busato [EMAIL PROTECTED] wrote:

Marco Bizzarri ha scritto:
 On 3/9/07, Jary Busato [EMAIL PROTECTED] wrote:
 If I understood you're telling me that begin and commit statements are
 redundant.

 Yes, exactly: they are issued by Zope at the boundaries of a transaction.

 Sometimes conflicts are not correctly managed by ZTM (no rollbacks in
 db)

 Are you using a non-transactional database (like old MySQL version)?


sql server with ZODBC



Sorry, I don't have direct experience with it. However, IIRC, ZODBC is
quite old and could have some problems. I would suggest you to invest
a few Euros in mxODBC: I've never tried it but Egenix has a good
record of producing good products.

Regards
Marco


--
Marco Bizzarri
http://iliveinpisa.blogspot.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] can not install ZMySQLDA

2007-03-09 Thread Daniel

export PYTHON_EGG_CACHE=/tmp
chmod 777 tmp
/opt/Plone-2.5.2/zeocluster/bin/restartcluster.sh

It still has the same error, and did not got to the /tmp directory.
Where did I set wrong?

Thanks,
Daniel


ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python
egg
cache:

  [Errno 13] Permission denied: '/root/.python-eggs'

The Python egg cache directory is currently set to:

  /root/.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.



On Fri, March 9, 2007 8:27 am, Andreas Jung wrote:


 --On 9. März 2007 08:19:50 -0800 Daniel [EMAIL PROTECTED]
wrote:

 Sorry! I'm new to this fields. Where can I change this
 PYTHON_EGG_CACHE?
 Is it in zope.conf? I can not find it.

 PYTHON_EGG_CACHE is an environment variable and has nothing to do with
Zope.

 -aj





___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] External Methods and Authentication error

2007-03-09 Thread Dieter Maurer
Jonathan wrote at 2007-3-8 09:27 -0500:
 ...
  Module /apps/Zope-2.9.2/Extensions/playwiser-1.0.py, line 3228, in 
IncrementViewCount
  Module OFS.PropertyManager, line 320, in manage_changeProperties
  Module Shared.DC.Scripts.Bindings, line 311, in __call__

This looks funny.

  Your manage_changeProperties calls a DMTL object.

This looks like a nameclash. I guess you have overridden some
method of PropertyManager with a DML object.

Check line 320 in OFS/PropertyManager.py what method is called
there and why it is a DTML object.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] SQL Server Network Error

2007-03-09 Thread Dieter Maurer
David VanKirk wrote at 2007-3-8 10:08 -0500:
I have Zope and SQL Server setup on the same machine, with no firewall
running on that PC, so there is no firewall between the two.
Occasionally I will get the following error, upon refreshing the page
the error disappears.

Error Type: ReplayTransaction
Error Value: OperationalError on : ('08S01', 11, '[Microsoft][ODBC SQL
Server Driver][Shared Memory]General network error. Check your network
documentation.', 6108)

Your ODBC SQL Server Driver tells you about a General network error.

I fear the Zope community will be unable to help you understand
this error message.

I see two possibilities:

  1.  the message from your ODBC SQL Server Driver is wrong.

  In this case, you need an expert for this driver (maybe,
  the support from the respective company)

  2.  the message is right. Then you need a network expert,
  that can (locally!) analyse your network to understand
  what happens.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )