Re: [Zope] Zope scheduling problem

2006-02-27 Thread Martijn Pieters
On 2/24/06, Nicholas Watmough <[EMAIL PROTECTED]> wrote:
> Out of interest, why am I unable to access the method from with my Zope
> python code? What is a private object, and why is it private?

All through-the-web code is run in a restricted sandbox; this includes
Python Scripts, DTML methods, ZSQL methods and Page Templates. Any
access to non-restricted code (Zope Products, the Zope framework
itself, External Methods) is governed by the Zope security system, and
the permissions set. 'Private' is the label given to code that cannot,
ever, be directly called from restricted code.

The method in question is private because it bypasses the security
restrictions imposed by the regular version.

--
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 )


[Zope] webdav and PUT_factory

2006-02-27 Thread Luca Dall'Olio
First of all, I would like to thank everybody for your accurate and fast 
answers.


I am working with a small group of developers, each in different places 
and working at different times.

According to my past experience in java, this means "cvs" ^_^
I have some doubts about how to synchronize Zope development with cvs or 
subversion.

Should I stop using the ZMI? Should I develop a Zope Product instead?
Should I use fsdump instead of webdav to export from zope ? Should I 
use  webdav when deploying back to Zope?


This is my actual state-of-the-art about team management in Zope :
We develop inside locally installed Zope Instances, using the ZMI.
At the end of the day, we export the work done using webdav, and this 
works for DTML documents, DTML methods and ZSQL methods.
After that, we commit inside the source code repository, using the 
update, diff and merge features to synchronize with other developers' work.
We need to deploy to a Zope server in order to test the integration of 
developers' code, so I wrote a little PUT_factory to re-create the right 
objects, this is a snippet:


   elif ext == 'zsql':
   from Products.ZSQLMethods.SQL import SQL
   return SQL(name, '', 'daticonvegno', '' ,'')
   elif ext == 'dtml':
   from OFS.DTMLDocument import DTMLDocument
   return DTMLDocument( '', __name__=name )
   elif ext == 'dtmm':
   from OFS.DTMLMethod import DTMLMethod
   return DTMLMethod( '', __name__=name )
   elif major == 'text':
   from OFS.DTMLDocument import DTMLDocument
   return OFS.DTMLDocument.DTMLDocument( '', __name__=name )

As you can see, it uses extensions to understand the type of the file. 
This has some minor drawbacks :
1) you have to use extensions to make it work, otherwise you will have 
trouble at deploy-time
2) some additional parameters such as the connectionIds for ZSQLMethods 
must be auto-magically chosen by the PUT_factory
3) what about more complex objects, such as Plone, Archetypes or 
Openflow? should I map them all in the PUT_factory?


Is this the "right way" to do things in Zope? Is there any native 
solution for Source Code Versioning and Team Management?

How do other team solve this issue? Any advice is welcome!

Thank you very much in advance,
Luca


___
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] Dates off by one day

2006-02-27 Thread Dennis Allison

It is likely to be a problem with timezones.  Zope recognizes one 
particular date format as UTC and not local.  If that sounds like 
the problem, I can provide a patch.


On Sat, 25 Feb 2006, Kevin Carlson wrote:

> Recently moved to a new server farm and am having a problem with dates 
> from MySQL that are rendered using strftime.  The date in MySQL is 
> correct (e.g. 2005-01-22) but if the date is rendered with strftime the 
> date displayed is one day earlier (e.g., 2005-01-21).  MySQL and Zope 
> are on separate servers as they were before the switch to the new 
> servers but this didn't happen in the old environment.
> 
> Anyone have any thoughts on this?
> 
> Thanks,
> 
> Kevin
> ___
> 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 )


[Zope] Dynamic dictionary keys?

2006-02-27 Thread Andrew Hedges
Allow me to preface this by saying I am a complete newbie to Zope (I  
prefer to think of it as beginner's mind...).  What I am attempting  
to do is dynamically add items to a dictionary, but Zope complains  
"keyword can't be an expression".  Here's the reduced case of my code:



   
  
   


This kind of construct *seems* perfectly reasonable, yet it doesn't  
work.  Any suggestions?  Other possible ways of doing the same thing?


Thanks!
-Andrew
-
Andrew Hedges, Clearwired Web Services
[EMAIL PROTECTED] / http://clearwired.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] Dynamic dictionary keys?

2006-02-27 Thread Jonathan
- Original Message - 
From: "Andrew Hedges" <[EMAIL PROTECTED]>

To: 
Sent: Monday, February 27, 2006 11:56 AM
Subject: [Zope] Dynamic dictionary keys?


Allow me to preface this by saying I am a complete newbie to Zope (I  
prefer to think of it as beginner's mind...).  What I am attempting  
to do is dynamically add items to a dictionary, but Zope complains  
"keyword can't be an expression".  Here's the reduced case of my code:



   
  
   



It is much easier in python script, but if you really want to use dtml:




hth

Jonathan
___
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] Dynamic dictionary keys?

2006-02-27 Thread Andreas Pakulat
On 27.02.06 09:56:49, Andrew Hedges wrote:
> Allow me to preface this by saying I am a complete newbie to Zope (I prefer 
> to 
> think of it as beginner's mind...).  What I am attempting to do is 
> dynamically 
> add items to a dictionary, but Zope complains "keyword can't be an 
> expression". 
>  Here's the reduced case of my code:
> 
> 
>
>   
>
> 

First let me tell you: Write a python script for things like this, it
really belongs into one.

Second thing: your dtml-call has a serious error, eventsDict[..]=id is
executed but it doesn't produce anything so set is called with no
parameters and this is wrong. set needs 2 parameters, one beeing a
string as the key and a second as the value which can be of any type
python knows.

I also don't get what this snippet should do?

Andreas

-- 
Today is the first day of the rest of your life.
___
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] Dynamic dictionary keys?

2006-02-27 Thread Andrew Hedges

Andreas and Jonathan,

Thanks for the responses!  As I said, I am completely new to Zope/ 
Python, so I appreciate your help.  I'll look into how this could be  
done with a Python script instead of DTML, but this version of our  
product is all DTML, so that's why I'm using this solution for now.   
Next version we're moving to Zope 3, so things should get better!


In any case, Jonathan's solution worked (though he had single quotes  
around 'calstart' which shouldn't have been there.)  What I'm doing  
is setting up a hash table so I can do some branching in a separate  
loop.  I have a feeling I'm building a hash table for something I may  
be able to access directly, but it's working, so I don't want to take  
up more space in peoples' inboxes.  Thanks again for the quick help!


-Andrew

On Feb 27, 2006, at 10:15 AM, Andreas Pakulat wrote:


On 27.02.06 09:56:49, Andrew Hedges wrote:
Allow me to preface this by saying I am a complete newbie to Zope  
(I prefer to
think of it as beginner's mind...).  What I am attempting to do is  
dynamically
add items to a dictionary, but Zope complains "keyword can't be an  
expression".

 Here's the reduced case of my code:


   
  
   



First let me tell you: Write a python script for things like this, it
really belongs into one.

Second thing: your dtml-call has a serious error, eventsDict[..]=id is
executed but it doesn't produce anything so set is called with no
parameters and this is wrong. set needs 2 parameters, one beeing a
string as the key and a second as the value which can be of any type
python knows.

I also don't get what this snippet should do?

Andreas


___
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] Dynamic dictionary keys?

2006-02-27 Thread Jonathan


- Original Message - 
From: "Andrew Hedges" <[EMAIL PROTECTED]>

To: "Jonathan" <[EMAIL PROTECTED]>
Sent: Monday, February 27, 2006 12:14 PM
Subject: Re: [Zope] Dynamic dictionary keys?


Thanks, much, Jonathan!  We're moving to Zope 3 on the next version  of 
our software, but what I'm working on is part of the last version,  which 
is all DTML.  I appreciate your response!  It works, though,  there was a 
small error in what you sent:


   


There are various forms, all of which are correct, and it depends upon what 
you are trying to achieve:




The above format takes two variables, one called calstart and one called id. 
The value contained within the variable calstart is used as the 'key' and 
the contents of id are used as the 'value'




The above format takes one 'hard-coded' key value 'calstart' and one 
variable id for the value




The above format takes a 'hard-coded' key value 'calstart' and a hard-coded 
value 'id'.



None of the above are 'wrong', it just a matter of what you are trying to 
accomplish.



Jonathan






Thanks, again!
-Andrew


On Feb 27, 2006, at 10:05 AM, Jonathan wrote:

- Original Message - From: "Andrew Hedges" 
<[EMAIL PROTECTED]>

To: 
Sent: Monday, February 27, 2006 11:56 AM
Subject: [Zope] Dynamic dictionary keys?


Allow me to preface this by saying I am a complete newbie to Zope  (I 
prefer to think of it as beginner's mind...).  What I am  attempting  to 
do is dynamically add items to a dictionary, but  Zope complains 
"keyword can't be an expression".  Here's the  reduced case of my code:


   
  
   



It is much easier in python script, but if you really want to use  dtml:




hth

Jonathan





___
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] Dynamic dictionary keys?

2006-02-27 Thread Lennart Regebro
On 2/27/06, Andrew Hedges <[EMAIL PROTECTED]> wrote:
> Allow me to preface this by saying I am a complete newbie to Zope (I
> prefer to think of it as beginner's mind...).

Welcome! And let's start with killing off two ideas that most newbies
have (because the documentation gives it to the,):

1. Through-the-web development really isn't such a hot idea. :-)
Granted, it has
it's uses, but most of the time it's a pain in the ass, because:

a. By necessity, the extra security needed means you have
restrictions that are
hard to circumvent.
b. It's really hard to have verisoning and making diffs on things
that reside in a
ZODB.
c. A text field in a browser isn't the most programmer friendly
editor you can
imagine.

   It is therefore quite likely you want to start making disk-bsed
products quite
   quick. See http://zopewiki.org/DiskBasedProduct
   Since TTW development was one of the original ideas with Zope, the
   documentation is very focused on it, but most people notice that
it's actually
   quicker and easier to go the disk-based way. YMMV and so forth.

2. Doing things in the template is not a good idea.

As mentioned above, you want to do any kind of logic in python. That means
either in a disk-based product, or in a Python-script. The Zope
documentation
doesn't say this clearly enough. In fact, it often encourages you to do
complicated things in DTML. Besides, ZPT is a new and better templating
language, you might want to use that instead of DTML. It's largely a matter
of taste, I definitely prefer ZPT, but as long as you keep *all*
logic from the
template it becomes less important.
See also: 
http://blogs.nuxeo.com/sections/blogs/lennart_regebro/2005_04_19_python_statement

--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
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] product security changes from 2.8 to 2.8.5 ?

2006-02-27 Thread Ed Colmar

Hello

I recently moved my zope product developed on a 2.8 server on to a 2.8.5 
server, and all of my python code is no longer being published out.


In the past I had been using a doc string  """ doc """ to make methods 
accessible.  I realize this is not the proper procedure, but it worked.  
Now, on the 2.8.5 server, all of these are refused. 

I've been going through and doing security.declarePublic('methodname') 
on everything I want to be public, but it does not appear to have any 
effect.


Are there any other changes that I need to make to my product in order 
to get back the functionality I had previously?


Am I even looking in the right place?

Thanks for any tips

-e-


___
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] product security changes from 2.8 to 2.8.5 ?

2006-02-27 Thread Andreas Jung



--On 27. Februar 2006 15:20:11 -0800 Ed Colmar <[EMAIL PROTECTED]> wrote:


Hello

I recently moved my zope product developed on a 2.8 server on to a 2.8.5
server, and all of my python code is no longer being published out.

In the past I had been using a doc string  """ doc """ to make methods
accessible.  I realize this is not the proper procedure, but it worked.
Now, on the 2.8.5 server, all of these are refused.
I've been going through and doing security.declarePublic('methodname') on
everything I want to be public, but it does not appear to have any effect.

Are there any other changes that I need to make to my product in order to
get back the functionality I had previously?




Do you call InitializeClass()?
Perhaps VerboseSecurity might help you.

-aj


pgpvwlND0jIHm.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] product security changes from 2.8 to 2.8.5 ?

2006-02-27 Thread Ed Colmar


Hey Andreas, thanks for the reply.

I have Globals.InitializeClass(classname) at the end of my product code 
(outside the class)
I turned on Verbose Security, but hmm...  maybe this is not a security 
issue after all.


I have code that worked within my product before like:

def send_password_reminder(self, email):
"""  blah """

Now I see get a name error when trying to access it.

*Error Type: NameError*
*Error Value: name 'send_password_reminder' is not defined

I thought it was a security problem...  Is this related to something else?

Thanks again!

-e-


*Andreas Jung wrote:




--On 27. Februar 2006 15:20:11 -0800 Ed Colmar <[EMAIL PROTECTED]> 
wrote:



Hello

I recently moved my zope product developed on a 2.8 server on to a 2.8.5
server, and all of my python code is no longer being published out.

In the past I had been using a doc string  """ doc """ to make methods
accessible.  I realize this is not the proper procedure, but it worked.
Now, on the 2.8.5 server, all of these are refused.
I've been going through and doing 
security.declarePublic('methodname') on
everything I want to be public, but it does not appear to have any 
effect.


Are there any other changes that I need to make to my product in 
order to

get back the functionality I had previously?




Do you call InitializeClass()?
Perhaps VerboseSecurity might help you.

-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] Dynamic dictionary keys?

2006-02-27 Thread Jean Jordaan
Hi Andrew

> Allow me to preface this by saying I am a complete newbie to Zope

In that case, please skip DTML and go straight to ZPT. DTML is like
the ghost train in an amusement park, but the ghosts are real. Especially
if you're a newbie.

> 
>
>   
>
> 

Don't code python in a template. Call a Python Script which prepares
your dictionary instead. E.g.
...

-- 
jean
___
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] Packing data.fs programmatically

2006-02-27 Thread Chris Withers

Ron Bickers wrote:

What's
the solution without ZEO and without having to stop Zope?

You use ZEO. Get over it, it should be how a standard Zope instance is
set up, IMNSHO...


So, in other words, there isn't one.  I take it you're a big fan of ZEO. ;-)  
I guess I'll check it out.  I've been using Zope for 7-ish years and just 
never bothered.


Well exactly. ZEO is not only for scaling Zope to multiple app serving 
clients, it's the way that ZODB allows multiple processes to access a 
single database.


Think of it in the same way as you'd thing of something like MySQLDB, 
psycopg or DCOracle2...


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] webdav and PUT_factory

2006-02-27 Thread Chris Withers

Luca Dall'Olio wrote:

According to my past experience in java, this means "cvs" ^_^


For the rest of us, it means svn ;-)

Should I stop using the ZMI? 


Probably. At the very least, take advantage of the webdav you seem to 
have already got working and use a normal text editor for editing your 
scripts and templates!



Should I develop a Zope Product instead?


Probably ;-)


Should I use fsdump instead of webdav to export from zope ?


No..

Should I 
use  webdav when deploying back to Zope?


Not unless you're doing all your editing via WebDAV...


We develop inside locally installed Zope Instances, using the ZMI.


Eep, at least get a text editor going over webdav so you don't have to 
use a browser to edit your scripts and methods!


At the end of the day, we export the work done using webdav, and this 
works for DTML documents, DTML methods and ZSQL methods.


Okay, stop using DTML documents and methods. Use python scripts and ZPT, 
please god! ;-)


After that, we commit inside the source code repository, using the 
update, diff and merge features to synchronize with other developers' work.


Odd...

We need to deploy to a Zope server in order to test the integration of 
developers' code, so I wrote a little PUT_factory to re-create the right 
objects, this is a snippet:


   elif ext == 'zsql':
   from Products.ZSQLMethods.SQL import SQL
   return SQL(name, '', 'daticonvegno', '' ,'')
   elif ext == 'dtml':
   from OFS.DTMLDocument import DTMLDocument
   return DTMLDocument( '', __name__=name )
   elif ext == 'dtmm':
   from OFS.DTMLMethod import DTMLMethod
   return DTMLMethod( '', __name__=name )
   elif major == 'text':
   from OFS.DTMLDocument import DTMLDocument
   return OFS.DTMLDocument.DTMLDocument( '', __name__=name )


Fair enough...

1) you have to use extensions to make it work, otherwise you will have 
trouble at deploy-time


Yup, but extensions are pretty handy ;-)

2) some additional parameters such as the connectionIds for ZSQLMethods 
must be auto-magically chosen by the PUT_factory


Oh, yes, that's silly ;-)

3) what about more complex objects, such as Plone, Archetypes or 
Openflow? should I map them all in the PUT_factory?


Ah, so you're using Plohn. Well, then you should put all you code in 
Filesystem Directory Views, it'll make it all _much_ easier for you!
You can then look to GenericSetup to handle all your workflow configs, 
etc...


Is this the "right way" to do things in Zope? 


Nope, not given the products you're using...

Is there any native 
solution for Source Code Versioning and Team Management?


Not really, the "History" tab is as close as it gets...

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 )


[Zope] Squishdot on Zope 2.9.X with Python 2.4.2

2006-02-27 Thread Dennis Allison

Are there any known compatibilty problems?   -d



-- 

___
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 )