Re: [Zope] Zope Debugger lets WingDbg fail to connect toclient

2005-10-17 Thread Chris Withers

Wingware Support wrote:
Just a couple notes on this:  We monkey patch only while the debugger 
is active 


Does this mean When WingDbg is installed or is there more to it than that?


Also, someone mentioned changing the monkey patch to call inherited.


Not sure what you mean by that...

However, what would make the most sense (to me) is to get the 
co_filename setting part of the patch into Zope as a real change to 
the code (this adds no overhead, and it's entirely reasonable to set 
file name or url of some type here when available) and leave any other 
stuff like line cache stuffing to zdb or other debugger.


I guess I agree, but we need to come up with a standard for it then ;-)


Anybody understand what the sticking point with that is?  Is it the
change from removing/adding ##'ed header so it's not stripped before
making the code object (so line numbers match source)?


Don't see what any commented block stuff has to do with it, what would 
that have to do with co_filename? I don't see any real sticking point 
other than that both CMF and Zope need the changes...


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] zope.conf read-only settings

2005-10-17 Thread Chris Withers

S.Hayles wrote:


AFAICS the directives zserver-read-only-mode and read-only-database 
just set the environment value ZOPE_READ_ONLY and no change in ZOPE's 
operation results. Am I right? This is ZOPE 2.7.7



Not really sure what you're asking?
Did you try these and find they made no difference?


Yes, and I've looked at the code and can't see any way they can make a 
difference.


Well, the obviously make some difference, or you wouldn't get errors 
from Formulator ;-)


Wondered whether anyone else knew anything about these directives (old 
or future functionality?) and whether I was right in thinking they 
didn't do anything. If they really don't and are never intended to do 
anything, then they should at least have comments to that effect, and 
ideally be removed.


The best place to ask is [EMAIL PROTECTED]

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] Need for advice ...

2005-10-17 Thread Chris Withers

Enrique Arizón wrote:

 By desire of the gods and the ebays lords a bargain
Sun Enterprise 250 arrived to my hands this week.

 The machine is equiped with 6x50GBytes SCSI HDs that
can be setup in RAID 0, 1, 5 and 01 combinations and
two Sparc 64bits CPUs with Solaris 10. The idea is to
use it mainly for Zope/ZEO/Plone hostings.

 Anyone has experience or knows of sources of
documentation for tunning a simmilar system to take
the most of Zope (ZODB tricks, ZEO setup,...)?


Having seen several senior ZC and ex-ZC employees openly laugh when it
was explained that the storage servers for a large project were running
on Slowlaris, I'm not sure how much joy you'll have ;-)

cheers,

Chris - ever wondered why they were on eBay in the first place?

--
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] selected in select lists

2005-10-17 Thread Chris Withers

Garry Saddington wrote:

This code does not work;-).


That, in itself, as an argument for using ZPT. The reason it doesn't 
work is probably because of some subtlety in name lookup of your DTML 
method.


Showing DTML to other people, say, on a mailing list, is much harder to 
grok than a ZPT, where at least you can be asked what is context in 
this scenario? container? etc.


Tino also hit the nail on the head: if your ZPT seems complexm you're 
trying to do too much in your presentation layer. Since all DTML is butt 
ugly and overly complex, you don't get much help with this ;-)


If I always work in the ZMI and do not 
collaborate with designers on database web applications where the data
is more important than the presentation, can you give me a good reason 
for not using DTML. 


Wow, only a true DTML user could come up with a sentence that convoluted ;-)

the namespace magic thing it is not that bad. The ZPT code above seems 
to me more complex and it has defined two new variables, 


Explicit is better than implicit. Try explaining what dtml 
sequence-item means to me, and why it should work ;-)


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] Need for advice ...

2005-10-17 Thread Chris Withers

Enrique Arizón wrote:

 By desire of the gods and the ebays lords a bargain
Sun Enterprise 250 arrived to my hands this week.

 The machine is equiped with 6x50GBytes SCSI HDs that
can be setup in RAID 0, 1, 5 and 01 combinations and
two Sparc 64bits CPUs with Solaris 10. The idea is to
use it mainly for Zope/ZEO/Plone hostings.

 Anyone has experience or knows of sources of
documentation for tunning a simmilar system to take
the most of Zope (ZODB tricks, ZEO setup,...)?


Having seen several senior ZC and ex-ZC employees openly laugh when it
was explained that the storage servers for a large project were running
on Slowlaris, I'm not sure how much joy you'll have ;-)

cheers,

Chris - ever wondered why they were on eBay in the first place?

--
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] apache open proxy configuration problem

2005-10-17 Thread Chris Withers

Kanealii, Priam Mr KRS wrote:

RewriteRule ^/p_(.*)
http://127.0.0.1:8080/VirtualHostBase/http/%{HTTP_HOST}/VirtualHostRoot/p_$1
[L,P]


I'm pretty sure that P there means it's still using mod_proxy ;-)

cheers,

Chris

PS: Ed: you can't stop people firing requests at your server, hence the 
log entries, you just need to make sure you're only responding o the 
opnes you want to!


--
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] Deleting objects from an external method

2005-10-17 Thread Chris Withers

Nikko Wolf wrote:


I'm trying to allow users to delete objects that have been accidentally 
created.  I have criteria for what that means, but since I *DO NOT* want 
them to delete object except by this method, I want to avoid granting 
Delete objects to them (non-Managers).


Have the delete process done in a python script or external method.
Only give view permission to that method to people who you want to be 
able to delete objects.


If it's a python script, give it a Proxy role that has the Delete 
objects permission mapped, and you'll be fine :-)


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] selected in select lists

2005-10-17 Thread Chris Withers

Garry Saddington wrote:
The comparison is dynamic. 


Ah, so thisgroupabrev comes from the request? See? I could never have 
known that from JUST reading the DTML.


In ZPT, it would have been request/thisgroupabrev and all would have 
been clear.


The user selects an option, that option is 
passed to a formhandler and hence back to the referring method.  How 
could I not do the comparison in this method?


In your ZSQL method, you have access to the REQUEST, so you can build 
your SQL using a dtml-if, and you love dtml right? ;-)


imho such a problem as selected in selects should have a well documented 
solution as many developers will need it and why should each one have to 
find the solution for themselves?


There's probably a How-To somewhere on this...

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] zope.conf read-only settings

2005-10-17 Thread S.Hayles



On Mon, 17 Oct 2005, Chris Withers wrote:


S.Hayles wrote:


AFAICS the directives zserver-read-only-mode and read-only-database just 
set the environment value ZOPE_READ_ONLY and no change in ZOPE's 
operation results. Am I right? This is ZOPE 2.7.7



Not really sure what you're asking?
Did you try these and find they made no difference?


Yes, and I've looked at the code and can't see any way they can make a 
difference.


Well, the obviously make some difference, or you wouldn't get errors from 
Formulator ;-)


In fact, it was setting read only in the storage configuration that caused 
the Formulator error, not setting zserver-read-only-mode or 
read-only-database.


I'll try asking on the dev list.

Thanks

Steven

___
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] Re: Error on starting and stopping Zope 2.8.2

2005-10-17 Thread Maik Ihde

 Aside from a security audit what problems have been reported using 
 Python 2.4.X?   Those of use who run Python 2.4.X do it becasue we want 
 access to the language features and performance.  If there are stability 
 issues attributed to that choice, we'd like to know what they are.  

Just one example: I tried running Zope 2.8.1 with Python 2.4.1 on a FreeBSD box
and CalendarX barfed with some errors in the templates. Changing to Python 2.3.5
made these disappear. You will surely find more using google or gmane...

Regards
Maik




___
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 i call a pyhton module's function from with in Page Temmplates?

2005-10-17 Thread Thomas G. Apostolou
Αρχικό μήνυμα από  Chris Withers [EMAIL PROTECTED]:

 Thomas Apostolou wrote:
  i saw that from within a DTML Method one is able to
  call a fuction of a python module in the file system.
 
 I don't think so...

Well, you are right. I do not directly call the modules's function from
the file system.
I call an External Method that wraps the module's function and then i
call that External Method from my DTML Method. Here is the example:

dtml-in expr=GetData(sysDSN=sysDSN, usr=usr, mypass=mypass,
sTable=sTable, sFields=sFields)
  dtml-if sequence-even
tr class=even
  dtml-else
tr class=odd
  /dtml-if
  dtml-in sequence-item
tddtml-var sequence-item /td
  /dtml-in
  /tr
/dtml-in


GetData is the name of the External Method i call with the parameters of
the module's function as you can see.



 
  Now i want to get the funtion's results from within a
  Page Template.
 
 Which function? Give us an example of what you've tried...
 
  Is the right way to make a Script(Python) that calls
  this module's function and then call this
  Script(Python) from within my Page Template?
 
 You should be able to make the call direct from the ZPT, but you'll
 have 
 to tell us what you're trying to do...
 
 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 )
 
 


Thomas G. Apostolou
Software Engineer
Θωμάς Γ. Αποστόλου
Μηχανικός Λογισμικού
___
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 i call a pyhton module's function from with in Page Temmplates?

2005-10-17 Thread Tino Wildenhain

Thomas G. Apostolou schrieb:

Αρχικό μήνυμα από  Chris Withers [EMAIL PROTECTED]:



Thomas Apostolou wrote:


i saw that from within a DTML Method one is able to
call a fuction of a python module in the file system.


I don't think so...



Well, you are right. I do not directly call the modules's function from
the file system.
I call an External Method that wraps the module's function and then i
call that External Method from my DTML Method. Here is the example:

dtml-in expr=GetData(sysDSN=sysDSN, usr=usr, mypass=mypass,
sTable=sTable, sFields=sFields)
  dtml-if sequence-even
tr class=even
  dtml-else
tr class=odd
  /dtml-if
  dtml-in sequence-item
tddtml-var sequence-item /td
  /dtml-in
  /tr
/dtml-in


GetData is the name of the External Method i call with the parameters of
the module's function as you can see.



Dont do that. Use a Database adaptor instead - any maybe issue
the query there if you dont want the ZSQL-Resultset-wrapping.
The reason is, ZDAs take care of pooling and so on and you avoid
a per thread reconnection.

___
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] Re: zope.conf read-only settings

2005-10-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

S.Hayles wrote:
 
 On Fri, 14 Oct 2005, Chris Withers wrote:
 
 Steven Hayles wrote:


 AFAICS the directives zserver-read-only-mode and read-only-database
 just set the environment value ZOPE_READ_ONLY and no change in ZOPE's
 operation results. Am I right? This is ZOPE 2.7.7


 Not really sure what you're asking?
 Did you try these and find they made no difference?
 
 
 Yes, and I've looked at the code and can't see any way they can make a
 difference.
 
 Wondered whether anyone else knew anything about these directives (old
 or future functionality?) and whether I was right in thinking they
 didn't do anything. If they really don't and are never intended to do
 anything, then they should at least have comments to that effect, and
 ideally be removed.

Setting the environment variable no longer has any effect, but the
presence of the configuration is checked by the code which sets up
zservers:  if set, those servers to not create / write log or PID files.

The environment variable *is* a fossil, whose former effects are now
spelled out via configuration directives for the storage itself.  We
should remove the code which sets the environment variable, and update
any docs which pretend that it is still effective.  Please file a
collector issue for this.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDU5TD+gerLs4ltQ4RAjLCAJwPXEbmEWXBUDJxUsXP7pHVlpoTUQCdEf3c
6WksK6zsqLpeh18+kXUrb/o=
=ZaL2
-END 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 )


[Zope] ZSQLiteDA 0.3.3 probs on zope 2.7.6? Upg. to 2.7.8.

2005-10-17 Thread Petri Savolainen

Just a report  workaround fyi for anyone running into the same problem:

I created a db consisting of a single, fairly small table (4 fields of 
short strings  a few floats) and imported a large amount of data into 
it (over a million records). Added a few indexes. The db size is about 
440MB.


Upon trying to access the data, my sql methods puked - got some memory 
errors sometimes, sometimes there was something wrong with a query 
variable or something. I did not dig deep on those. Alas, upgrade to 
Zope 2.7.8 seems to have solved the problem. And there was much joy.


Cheers,

 Petri

___
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] access rule and authentication

2005-10-17 Thread Krzysztof Kubacki



Hi,

Python Script which is set as "Access Rule" for 
some Folder is execute before authentication is done.
This way the following code won't work

if 
context.portal_membership.getAuthenticatedUser().getId() == "admin":  
  return "dog" return "cat" 

I will always get "cat". So does somebody know how 
to resolve it?


Regards
Krzychula

___
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] NTUserFolder still useful?

2005-10-17 Thread Sean Dunn








Im running Zope on WindowsXP with plans to run it on
server 2003. Instead of creating user accounts Id like to leverage NT
authentication.. And NTUserFolder looks like it might be what I want, except
that it looks like a dead product. Besides a note that it works on Win2k under
certain constraints, Im not sure if I should try using it. Have people
had success installing this on WinXP/S2003?



Thank you,

Sean



-

Sean Dunn

Tools Programmer

Troublemaker Digital








___
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] NTUserFolder still useful?

2005-10-17 Thread Chris McDonough
Proably easier and faster to try it than to wait for a response. ;-)

On Mon, 2005-10-17 at 12:46 -0500, Sean Dunn wrote:
 I’m running Zope on WindowsXP with plans to run it on server 2003.
 Instead of creating user accounts I’d like to leverage NT
 authentication.. And NTUserFolder looks like it might be what I want,
 except that it looks like a dead product. Besides a note that it works
 on Win2k under certain constraints, I’m not sure if I should try using
 it. Have people had success installing this on WinXP/S2003?
 
  
 
 Thank you,
 
 Sean
 
  
 
 -
 
 Sean Dunn
 
 Tools Programmer
 
 Troublemaker Digital
 
  
 
 
 ___
 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] NTUserFolder still useful?

2005-10-17 Thread Philip Kilner
Hi Sean,

Sean Dunn wrote:
 I’m running Zope on WindowsXP with plans to run it on server 2003.
 Instead of creating user accounts I’d like to leverage NT
 authentication.. And NTUserFolder looks like it might be what I want,
 except that it looks like a dead product. Besides a note that it works
 on Win2k under certain constraints, I’m not sure if I should try using
 it. Have people had success installing this on WinXP/S2003?
 

Can't speak for XP/S2K3, but we use it in production under S2K in an
S2K3 environment, and I can vouch for it's usefulness.

When we set our system up, there were some issues with AD LDAP support
that I couldn't overcome - NTUserFolder provides authentication to the
Intranet using Windows credentials, which was all we needed.

There was some issue with crypto on the 2K3 Server, but this was just a
case of some silly default settings (same sort of stuff that would cause
Same /et al/ issues).

Let me know if you need more details...


-- 

Regards,

PhilK

Email: [EMAIL PROTECTED]
PGP Public key: http://www.xfr.co.uk
Voicemail  Facsimile: 07092 070518

You'll find that one part's sweet and one part's tart:
say where the sweetness and the sourness start.
- Tony Harrison
___
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] Re: access rule and authentication

2005-10-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Krzysztof Kubacki wrote:
 Hi,
 
 Python Script which is set as Access Rule for some Folder is
 execute before authentication is done.
 This way the following code won't work
 if context.portal_membership.getAuthenticatedUser().getId() == admin: 
   return dog 
 return cat 
 
 I will always get cat. So does somebody know how to resolve it?

AcceseRules run during path traversal, before any authentication is done
(Zope2 does inside out authentication starting at the published
objectd).  You might be able to force user validation to be attempted
earlier, e.g. by calling 'validate' directly on the user folder.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDU/ka+gerLs4ltQ4RAtJtAKDYknRJMxX3kShfmQuEvs+UX0uYgwCeM2WR
ygDsqyOWKuoWWiJgUVWlvSo=
=3Pn+
-END 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] Deleting objects from an external method

2005-10-17 Thread Nikko Wolf




Dieter Maurer wrote:

  Nikko Wolf wrote at 2005-10-14 15:37 -0600:
  
  
I'm trying to allow users to delete objects that have been accidentally 
created.  I have criteria for what that means, but since I *DO NOT* want 
them to delete object except by this method, I want to avoid granting 
"Delete objects" to them (non-Managers).

Can this even be done?  At the base level, "Delete objects" is a 
hard-coded requirement of the ObjectManager.manage_delObjects() function.

  
  
Usually, an "External Method" is not restricted by Zope's
security.

Unless "manage_delObjects" does not perform an additional
internal check (I think, it does not), your "External Method"
can use it to delete objects.
  

My question stemmed from the fact that (for reasons I cannot not
duplicate), I was repeatedly getting Unauthorized exceptions using the
manage_delObjects() function. Thus, I moved the functionality into an
External Method, intending to avoid the restrictions.

But even there, throughout changes too numerous to remember now, the
Unauthorized problem persisted. Then, after snooping around I found
code in zope/lib/python/OFS/ObjectManager.py that set
__ac_permissions__ with an entry:
 ('Delete objects', ('manage_delObjects',))

... hence my thought was that the ObjectManager class had the
requirement builtin at the source code level. Even trying new
security context (created from within the External Method) did not work.

After many hours of effort and debugging, I find that it works in a
"Script (Python)" with precisely the same code that I (thought I) used
originally. Obviously, something is different, but unless it was a
subtle typo that compiled correctly and worked (but not as desired) I
cannot fathom what has changed.

  
BTW: Often, it is more faster simply to try something than
to post a question to the mailing list and wait for the answer.
Your question above is such a case ...
  

Indeed, I know that well. I *had* tried a multitude of variations
before sending; and I'd originally included details in the first
posting, but deleted it before I sent it since the question seemed to
stand on its own.

Thanks anyway,
Nikko



___
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] COREBlog 1.2.1 on Zope 2.7.5 year_created problem

2005-10-17 Thread Allen Schmidt
New COREBlog 1.2.1 install on Zope 2.7.5 on RHE3 Linux. 


I can add an instance of a blog and create categories and change settings. 
Adding an entry gives a name error:

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 App.special_dtml, line 62, in __call__
   * Module DocumentTemplate.DT_String, line 474, in __call__
   * Module OFS.DTMLMethod, line 137, in __call__
 DTMLMethod instance at b51c8350
 URL: http:///blog/entry_html/manage_main
 Physical Path:/blog/entry_html
   * Module DocumentTemplate.DT_String, line 474, in __call__
   * Module OFS.DTMLMethod, line 137, in __call__
 DTMLMethod instance at b51c82f0
 URL: http://xx/blog/entry_body/manage_main
 Physical Path:/blog/entry_body
   * Module DocumentTemplate.DT_String, line 474, in __call__
   * Module DocumentTemplate.DT_Util, line 198, in eval
 __traceback_info__: month_created
   * Module string, line 0, in ?

NameError: name 'year_created' is not defined


Just curious if anyone else has seen this?

Thanks

Allen

___
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] DateTime again.

2005-10-17 Thread Fernando Lujan
Is it possible to informe the DateTime module about the date format
without changing the zope.conf file?

Format: dd/mm/

When I try the dtml-var DateTime(12/11/2005) it returns 2005/12/11
instead of 2005/11/12.

Thanks in Advance.

Fernando Lujan
___
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] DateTime again.

2005-10-17 Thread Peter Bengtsson
Try:
dtml-var DateTime('12/11/2005').strftime('%Y/%m/%d')

2005/10/17, Fernando Lujan [EMAIL PROTECTED]:
 Is it possible to informe the DateTime module about the date format
 without changing the zope.conf file?

 Format: dd/mm/

 When I try the dtml-var DateTime(12/11/2005) it returns 2005/12/11
 instead of 2005/11/12.

 Thanks in Advance.

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



--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.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] Deleting objects from an external method

2005-10-17 Thread Nikko Wolf

Chris Withers wrote:


Nikko Wolf wrote:



I'm trying to allow users to delete objects that have been 
accidentally created.  I have criteria for what that means, but since 
I *DO NOT* want them to delete object except by this method, I want 
to avoid granting Delete objects to them (non-Managers).



Have the delete process done in a python script or external method.
Only give view permission to that method to people who you want to 
be able to delete objects.


If it's a python script, give it a Proxy role that has the Delete 
objects permission mapped, and you'll be fine :-)



That was my expectation too, but alas -- it does not work for me.   Have 
you specifically tried this?


 Set up:
 - Plone Site with Delete objects permission granted only to Manager 
(not inheriting privs)
 - (Plone) Folder abc with an object xyz under the Plone Site 
(inheriting privs)
 - The following Script (Python) named nuke and with Manager 
proxy role.

 - Non Manager user
 - Load URL:  {plone-root}/abc/xyz/nuke

 Browser shows: 
Insufficient Privileges


You do not have sufficient privileges to view this page. If you believe 
you are receiving this message in error, please send an e-mail to


 The events.log shows:
2005-10-17T16:16:34 ERROR(200) SiteError 
http://localhost:8080/PloneRoot/abc/xyz/nuke

Traceback (most recent call last):
 File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 101, in 
publish

   request, bind=1)
 File /usr/local/zope/lib/python/ZPublisher/mapply.py, line 88, in mapply
   if debug is not None: return debug(object,args,context)
 File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 39, in 
call_object

   result=apply(object,args) # Type scr to step into published object.
 File /usr/local/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 
306, in __call__

   return self._bindAndExec(args, kw, None)
 File /usr/local/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 
343, in _bindAndExec

   return self._exec(bound_data, args, kw)
 File 
/usr/local/zope/lib/python/Products/PythonScripts/PythonScript.py, 
line 324, in _exec

   result = f(*args, **kw)
 File Script (Python), line 16, in mlt
 File /usr/local/zinstance/Products/CMFPlone/PloneFolder.py, line 
306, in manage_delObjects

   raise Unauthorized, (
Unauthorized: Do not have permissions to remove this object

 The script is:
## Script (Python) nuke
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=My Test Script
##
from Products.PythonScripts.standard import html_quote

objid  = context.getId()
folder = context.aq_inner.aq_parent
mylog  = folder.plone_log

#
## DELETION CRITERIA CHECKS OMITTED


# So, now we delete it...
member = context.portal_membership.getAuthenticatedMember()
mylog( %s deletes (%s) from (%s) %\
 (member.id, context.absolute_url(), folder.absolute_url()))

resp = folder.manage_delObjects( [objid] )

mylog( folder.{%s}.manage_delObjects(['%s'] = {%s}\nCTX=%s %
  (folder.absolute_url(), objid,
  folder.dumpIt( resp ), folder.absolute_url()))
mylog( Remaining:  + str(folder.objectIds()) )

# Set 'text' for the portal_status_message
text = No exceptions deleting '%s' % objid
if objid in folder.objectIds():
   text +=  / ID is still there
else:
   text +=  / ID is gone
if context in folder.objectValues():
   text +=  / OBJECT is still there
else:
   text +=  / OBJECT is gone

context.REQUEST.RESPONSE.redirect( folder.absolute_url() +
  '?portal_status_message=' +
  html_quote(text))

___
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] DateTime again.

2005-10-17 Thread Andreas Jung

Look at the DateTime API (strftime()).

-aj

--On 17. Oktober 2005 18:33:31 -0200 Fernando Lujan [EMAIL PROTECTED] 
wrote:



Is it possible to informe the DateTime module about the date format
without changing the zope.conf file?

Format: dd/mm/

When I try the dtml-var DateTime(12/11/2005) it returns 2005/12/11
instead of 2005/11/12.

Thanks in Advance.

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






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