Re: [Zope] MySql connector error

2007-08-27 Thread Pelletier Vincent
Le Samedi 25 Août 2007 17:07, Kevin a écrit : Intermittently, I recieve an error *Shouldn't load state for 0xf5f137 when the connection is closed * This means there is somewhere a reference to a persistent object which keeps it past transaction commit, which is a bad behaviour. I

Re: [Zope] MySql connector error

2007-08-27 Thread Kevin
Your right, the older mysql da I was using gave 'Shouldn't Load State When Connection is Closed'. It turns out that my DA is implemented correctly, but the database cursor is being persisted in another object(past transaction commit) as you noted. So, with some readjusting, the error seems

Re: [Zope] Deleting a file in Python

2007-08-27 Thread Paul Winkler
On Sat, Aug 25, 2007 at 07:35:06AM -0400, [EMAIL PROTECTED] wrote: but I can't figure out where context.* is documented. It depends what kind of object context is. To find out, you may find this product useful: http://plone.org/products/docfindertab Here is a good start reference for Zope 2

[Zope] Re: Help with DateTime.earliestTime()

2007-08-27 Thread Maurits van Rees
Eric, on 2007-08-26: To work around this, I've modified the addition so that instead of adding 1 day, it adds 1.5 days. This extra half a day is removed by the theDateTime.earliestTime() call but is enough to overcome the DST addition problem. Ugly hack. I had the same problem once in the

Re: [Zope] Re: Help with DateTime.earliestTime()

2007-08-27 Thread Dieter Maurer
Andreas Jung wrote at 2007-8-26 21:23 +0200: ... If you can: use Python's datetime module. DateTime is broken in many ways. If it handles daytime saving and addition by some float days -- it will not have any chance... If it does not handle daytime saving -- then it misses an essential use

Re: [Zope] Re: Help with DateTime.earliestTime()

2007-08-27 Thread Eric Thomas
On 8/27/07, Dieter Maurer [EMAIL PROTECTED] wrote: Andreas Jung wrote at 2007-8-26 21:23 +0200: ... If you can: use Python's datetime module. DateTime is broken in many ways. If it handles daytime saving and addition by some float days -- it will not have any chance... If it does not

[Zope] Re: Help with DateTime.earliestTime()

2007-08-27 Thread J Cameron Cooper
Maurits van Rees wrote: Eric, on 2007-08-26: To work around this, I've modified the addition so that instead of adding 1 day, it adds 1.5 days. This extra half a day is removed by the theDateTime.earliestTime() call but is enough to overcome the DST addition problem. Ugly hack. I had the

[Zope] Deploying with buildout (was: buildout, instancemanager, and eggs)

2007-08-27 Thread Ross Patterson
We have a Plone 3.0/Zope 2.10 application that we need to develop on, maintain and deploy to a ZEO server and multiple ZEO clients. Currently we use svn bundles of Zope and Plone and our own packages and products in one big svn:externals definition. We also use some more recent versions of

[Zope-dev] Zope Tests: 5 OK

2007-08-27 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list. Period Sun Aug 26 12:00:00 2007 UTC to Mon Aug 27 12:00:00 2007 UTC. There were 5 messages: 5 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sun Aug 26 20:53:28 EDT 2007

Re: [Zope-dev] Options replacing DateTime with datetime!?

2007-08-27 Thread Dieter Maurer
Andreas Jung wrote at 2007-8-26 20:31 +0200: ... Conversion between both is pretty much trivial. However I have no idea how this would solve the DateTime problem. So what are our DateTime problems? - an insane constructor with a parser trying to parse almost every date format in the world

[Zope-dev] Re: Options replacing DateTime with datetime!?

2007-08-27 Thread Philipp von Weitershausen
Dieter Maurer wrote: Andreas Jung wrote at 2007-8-26 20:31 +0200: ... Conversion between both is pretty much trivial. However I have no idea how this would solve the DateTime problem. So what are our DateTime problems? - an insane constructor with a parser trying to parse almost every date

[Zope-dev] Re: Options replacing DateTime with datetime!?

2007-08-27 Thread Dieter Maurer
Philipp von Weitershausen wrote at 2007-8-27 22:11 +0200: ... In my personal opinion, we should * use datetime for all the new stuff that we write, * provide a convenient way to convert DateTime objects into datetime, * create alternate APIs for all the APIs that work with DateTime objects

[Zope-dev] Re: Options replacing DateTime with datetime!?

2007-08-27 Thread Philipp von Weitershausen
On 27 Aug 2007, at 22:25 , Dieter Maurer wrote: Philipp von Weitershausen wrote at 2007-8-27 22:11 +0200: ... In my personal opinion, we should * use datetime for all the new stuff that we write, * provide a convenient way to convert DateTime objects into datetime, * create alternate APIs

[Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread onsombal
Here's the scenario: 1. insertNew is a Z SQL Method for creating a new record in pgsql table1 Argument list = field1, field2, field3 SQL Query: INSERT INTO table1 (field1, field2, field3) VALUES ( dtml-sqlvar field1 type=string, dtml-sqlvar field2 type=string, dtml-sqlvar field3

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread Maciej Wisniowski
changed_field1 = a new computed value field1 = changed_field1 #create a new record with form field results for field2 field3, and a computed value for field1 context.insertNew() Obvious things are sometimes hardest to find ;) Try: field1 = changed_field1 context.insertNew(field1=field1)

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread onsombal
I tried the techniques you suggested and it results in the same error -- KeyError: 'form.submitted' field1 = changed_field1 context.insertNew(field1=field1) -- I also tried the other technique and got the same error. I tried your technique with the following changes to my pfg (ploneformgen) for

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread Charlie Clark
Am 27.08.2007, 15:59 Uhr, schrieb onsombal [EMAIL PROTECTED]: changed_field1 = form.get('field1') changed_field1 = a new computed value field1 = changed_field1 #create a new record with form field results for field2 field3, and a computed value for field1 context.insertNew()

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread Charlie Clark
Am 27.08.2007, 21:59 Uhr, schrieb onsombal [EMAIL PROTECTED]: I'm assuming the form results are stored as an object represented as a dictionary. If so, then there must be a way for my python script to change the key | value pair for field1 before I call my Z SQL Method. Is this reasonable,

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread Maciej Wisniowski
onsombal napisał(a): I tried the techniques you suggested and it results in the same error -- KeyError: 'form.submitted' You didn't tell about this kind of error before. Post a full traceback, please. I suppose that error is somewhere else... -- Maciej Wisniowski

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread onsombal
So, my script now works!! Thanks to everyone for your input. It is greatly appreciated. Below is a quick summary of what I did and a relevant excerpt of the working script. 1) I never was able to get passing the arguments via the context.Statement to work. I'm sure it's something I've done