RE: [Zope-dev] Allowing python logging from restricted code

2005-10-11 Thread Tim McLaughlin
We are currently finishing up a debug_log much like the error log that
Python scripts can write too.  We would happily make that source
available if you think it will fit the bill.

Cheers,
Tim

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Chris Withers
Sent: Tuesday, October 11, 2005 2:50 AM
To: [EMAIL PROTECTED]
Cc: zope-dev
Subject: Re: [Zope-dev] Allowing python logging from restricted code

Hi Jim,

Jim Fulton wrote:
 
 I think you need to be very careful with this. 

What's the concern?
I'm, at most, planning on making the getLogger function and the top
level logging constants (eg: logging.INFO, etc) available...

 IMO, this is something
 that should not be turned on by default. OTOH, I have no problem with 
 making this possible to turn on.

zope.conf option?

Also, do you have any comment on the second half of my proposal, which
was to do with making it possible to define more than just event and
access logs in zope.conf?

cheers,

Chris

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

___
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 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] checkPermission and proxy roles

2005-03-16 Thread Tim McLaughlin
Issue #'s 78, 846, 1125 all relate to checkPermission not considering
proxy roles.  #78 was resolved, however, from the looks of the code (and
I haven't tested this), it will fail to Cut/Paste because the 'Delete
objects' perm would be permitted by the proxy role which is not
considered in the checkPermission.  Anyway, the question is this...

Why doesn't checkPermission consider proxy roles?

I found the following discussion in Zope-CMF and it looks like this was
fixed in CMF, but it seems to me like this should be the default
policy behavior in Zope.  We can do the patches if there's no reason for
it being the way it is...

Cheers,
Tim


 begin quote
Dieter Maurer wrote:
 I think, we should have both possibilities:
 
  [1] check whether the real user would have the permission
  (independent of proxy roles)
 
  [2] check whether the current context has the permission
  (dependent on the current proxy roles and other
  execution security aspects (such as ownership))

I'd like to replace utils._checkPermission in CMF HEAD with the attached

code. This would change the behavior of _checkPermission from [1] to 
[2]. (If I didn't make a mistake.)

The way utils._checkPermission is used in CMF implies possibility [2] 
would be the right behavior, the fact it implemented [1] looks like a 
bug to me. I don't know of any code that'll break if we switch to [2].

I can see there might be a need for [1]. But in this case you can use 
Zope's checkPermission method.


If there are no objections I'll soon make a CVS checkin of the attached 
code.


Cheers,
Yuppie
---
--
Tim McLaughlin 
Chief Technology Officer 
Siteworx, Inc. Innovative internet solutions. 
703.964.0300 ext. 208  
___
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] property type

2003-02-06 Thread Tim McLaughlin
According to docs and testing (in the interpreter) I can make a 
read-only calculated attribute using property() (I know that setters do 
not work w/ non-new-style classes).  So I tried the following:

class CMixin:
  def getter(self):
return 'test'
  prop = property(getter)

and when I try to mix in this object w/ a Folder object, the instance 
returns property object at 0x8b45edc for the 'prop' attribute.  Is 
this an issue with pickling or something else?

Cheers,
Tim
--
Tim McLaughlin
Chief Technology Officer
Siteworx, Inc... Set your site on the future!
703.390.5421


msg12579/pgp0.pgp
Description: PGP signature


[Zope-dev] override __of__

2003-02-06 Thread Tim McLaughlin
Is there any way to override __of__ on an object?  I've tried it but for 
whatever reason, Implicit.__of__(self, object) says that self is not an 
Acquirer even though the object is a subclass of Implicit.  I would 
implement in a traverse hook, but attribute access of that object won't 
do traversal. :(

Cheers,
Tim

--
Tim McLaughlin
Chief Technology Officer
Siteworx, Inc... Set your site on the future!
703.390.5421


msg12585/pgp0.pgp
Description: PGP signature


Re: [Zope-dev] get_request() and GlobalRequestPatch

2002-10-27 Thread Tim McLaughlin
Wow, didn't know anything was still dependent on this hack I wrote (kinda scary).  To my knowledge and Stephan's, there was no way around this due the the __getattr__ requirements... but that may be different now.  Stephan?  At the time, ZC wasn't interested in merging it in, but it may be there now, or maybe some committer may want to do it.

Cheers,
Tim

Johan Carlsson [EasyPublisher] wrote:


I just looking in to some products (Localizer/ZBabel) that uses get_request
from the GlobalRequestPatch.

Is this still necessary or are there any more modern solutions to this 
patch
(that is quite old)?

Best Regards,
Johan Carlsson




--
Tim McLaughlin
Chief Technology Officer
Siteworx, Inc... Set your site on the future!
703.390.5421


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


Re: [Zope-dev] How can I find out who visited a URL within my ZopeProduct?

2002-10-08 Thread Tim McLaughlin

Much easier and nicer is to use an Access Rule  (look in the Add drop-down).

Tim

Craeg K Strong wrote:
 Hello:
 
 I would like to log the identity of the authenticated
 user for *every* URL traversal within my Zope Product.
 
 For example, let's say that my forms-based web application contains 50
 screens.  They are all protected such that only authenticated users
 can view them.  Any one of them could be bookmarked, so a user could
 jump in at any point.
 
 I want to record the fact that a user visited a screen, each and every
 time they do so.
 
 A natural place to do this would be in a pre-traversal hook, but I seem
 to be stymied by the lack of authentication information in 
 __bobo_traverse__
 or __before_publishing_traverse__
 
 Can anyone think of a way this could be done?
 
 I suppose I could hack all of my ZPTs to call a registerUser method
 by putting it in an empty span in their shared header, but that seems
 to mix concerns.  Why should my ZPTs have knowledge of this workflow
 requirement?
 
 Thanks in advance!
 
 --Craeg
 
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

-- 
Tim McLaughlin
Chief Technology Officer
Siteworx, Inc... Set your site on the future!
703.390.5421


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



Re: [Zope-dev] I/O Error

2002-09-09 Thread Tim McLaughlin

I get this same problem on our FreeBSD servers w/ Zope 2.5.1 and Python 2.1.1 (from 
ports).  I've haven't found any correlation to anything that might be causing it 
yet... (sort of distressing)  It doesn't happen very often though; I've only seen it 
about 3 times.

Cheers,
Tim

Myroslav Opyr wrote:
 Hi,
 
 When running one of development servers (Zope 2.5.1, Python 
 2.1.3+freebsdPatch) Several times I've got I/O Error exception page 
 when trying to render random ZMI  page. Retrying always succeeds... I 
 was not able to get traceback so far (it is in HTML comments).
 
 Any ideas what that can be?
 
 m.

-- 
Tim McLaughlin
Chief Technology Officer
Siteworx, Inc... Set your site on the future!
703.390.5421


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



[Zope-dev] two hard questions

2002-03-06 Thread Tim McLaughlin

Firstly, I'm trying to return a lazy list to a dtml-in, but it seems 
that the __getitems__ are all called up front  This is the class and 
the print statement shows up in debugging before any debugging output 
from within the dtml-in:

class LazyList:
def __init__(self, root, selections):
self._root = root
self._selections = selections
def __getitem__(self, index):
s = self._selections[index]
print s.getPath()   #  this is executed for all items before 
anythingwithin the dtml-in
o = self._root.restrictedTraverse(s.getPath())
o.setSelection(s)
return o
def __len__(self):
return len(self._selections)

Does this mean that dmtl-in touches all of the objects first for some 
reason?  Or am I missing something?

Second hard ?.  Is there any way to wrap a Folder subclassed 
instance within another class so that I can override some methods on an 
instance by instance basis?  I tried doing a .__class__ replacement, but 
for whatever reason, Zope machinery seems to keep it from taking effect. 
 Any ideas?  I've tried about 5 different approaches to no avail :(

Sincerely,
Tim McLaughlin

-- 
Tim McLaughlin
Iteration ZERO, Inc. - www.iterationzero.com
703.481.3983



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



Re: [Zope-dev] two hard questions

2002-03-06 Thread Tim McLaughlin

Casey Duncan wrote:

On Wednesday 06 March 2002 07:27 am, Tim McLaughlin allegedly wrote:

Firstly, I'm trying to return a lazy list to a dtml-in, but it seems
that the __getitems__ are all called up front  This is the class and
the print statement shows up in debugging before any debugging output
from within the dtml-in:

[snip code]

Does this mean that dmtl-in touches all of the objects first for some
reason?  Or am I missing something?


My guess is that you have a sort attribute on your dtml-in, which would touch 
everything in the sequence up front.

Your are right on with that (doh!)


Second hard ?.  Is there any way to wrap a Folder subclassed
instance within another class so that I can override some methods on an
instance by instance basis?  I tried doing a .__class__ replacement, but
for whatever reason, Zope machinery seems to keep it from taking effect.
 Any ideas?  I've tried about 5 different approaches to no avail :(


I'm not sure how (or why) you would wrap a class around an instance. In order 
to override methods on an instance by instance basis, you would most probably 
need to create a object proxy wrapper that override __getattr__ so that it 
can fire off the right methods.

If these methods are accessed TTW, then you could just use __bobo_traverse__ 
for this too.

Very long and involved explanation, so I'll skip it :)  but since 
you agree with one of the many approaches I took (using a proxy), I'll 
revisit that one and see if morning will make it better.

Thanks for the help,
Tim

-- 
Tim McLaughlin
Iteration ZERO, Inc. - www.iterationzero.com
703.481.3983




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



Re: [Zope-dev] ZClasses and Python

2002-02-19 Thread Tim McLaughlin

Take a look at ZClassEvents

Andre Schubert wrote:

Hi all,

i have a little question on ZCLasses and Python.
Lets Say i have python-base-class foo which is folderish.
I have a zclass bar which has the class foo as base class.
Now i have defined as new propertysheet instance in bar called foobar.

If i change the properties of foobar, then manage_editProperties is
called( i'am right ).

Is there a way to catch the manage_editProperties function(called from
foobar) in my base-class foo 

Thanks as

P.S.: I hope there is someone understanding this :)


-- 
Tim McLaughlin
Iteration ZERO, Inc. - www.iterationzero.com
703.481.3983




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



[Zope-dev] pdf - Files not viewable

2001-11-09 Thread Tim McLaughlin

This used to work, and I'm vexed as to why it doesn't now.  When PDFs
are uploaded as file objects and then viewed, on IE 5.0+ with Acrobat
Reader, they appear as blank when Acrobat Reader pops up to read them. 
I get no errors on the stupid log, and generally haven't any idea what
the deal is since this used to work.  Did something change in 2.4 that
could have caused File objects to function badly?

Thanks,
Tim
-- 
Tim McLaughlin
iterationZERO - www.iterationzero.com
703.481.2233

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



Re: [Zope-dev] Versions (still)

2001-10-23 Thread Tim McLaughlin

Andy McKay wrote:
 
 So there I was in this discussion about Zope versioning (again) and there
 were two features requested that seemed perfectly reasonable at the time,
 
 - to have a list of all the objects changed by a version
 - to be able to individually commit or discard changes in a version on a per
 object basis
 
 This is would be extremely useful for those times when you forget to check
 out of a version and accidentally lock the root folder (This happens quite a
 bit). Simple I thought, but ugh versions go all the way down to FileStorage
 and got into ZODB stuff I didnt understand. I would have thought having a
 little refactoring to give two more methods: getVersionContents and
 commitObject would be possible, but Im scratching my head at FileStorage
 now.
 
 Before I embark down this path is there an easier way?
 
 Cheers.
 --
   Andy McKay.
 

This is something I've been thinking about (and inspecting code with
regard to) for a long time.  And regrettably, the only idea I have come
up with is copying attributes from one version into another, or
disgusting things like that.  I haven't implemented anything because it
sounds too icky, and I keep thinking there's gotta be a better way :)

Cheers,
Tim
-- 
Tim McLaughlin
iterationZERO - www.iterationzero.com
703.481.2233

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



[Zope-dev] Re: International Objects

2001-10-21 Thread Tim McLaughlin

Roger,
I've identified a serious weirdness that causes InternationalObjects not
to work.  It's this...

InternationalObjects -
works on 2.4.0 and 2.4.0 upgraded to 2.4.1
but does not work on clean 2.4.1 install.

This indicates an disconnect between the upgrade and clean install paths
(at least that's my first thought).  Zope-devers, any ideas?  Anybody
know of any __getattr__ changes in the 2.4.0 to 2.4.1 transition?

Cheers,
Tim

Roger Espinosa wrote:
 
 On Wed, 17 Oct 2001, Tim McLaughlin wrote:
 
 
  If so, let me know what you think after you toy with it a bit.  Note
  that it also works with ZClass props :)
 
 
 Still persisting, as the more I dwell on it, the more I like this approach
 --- one of the reasons I'm using Zope is the ease of mixing complicated
 code with simpler code (handy for the education environment), and this
 approach fits that ideal.
 
 At any rate --- I continue to fail if I try the monkeypatch; oddly, if I
 do this bit of code:
 
 x = Item()
 print Item.__getattr__(x, 'DEBUG')
 
 it'll correctly work, but
 
 x.DEBUG
 
 seems to skip it altogether; I even assigned the InternationalObjects
 __getattr__ to an unrelated method (e.g. Item.fetchValueForKey =
 __getattr__) and *that* works, which sure looks like something else is
 hijacking __getattr__.
 
 Except when I just go patch the code into OFS.SimpleItem (I'm already
 hacking get_request, so what the heck :)...it works as hoped. (Which would
 tend to discount the hijacked __getattr__ business.)
 
 Anyway, neat idea :)
 
 Roger

-- 
Tim McLaughlin
iterationZERO - www.iterationzero.com
703.481.2233

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



Re: [Zope-dev] nasty persistence problem

2001-10-12 Thread Tim McLaughlin

Thanks Chris, I'll hold on to that for a rainier day.  I just worked
this one out in a very roundabout way ;)

A product had gotten copied in that moved a Product class from one
module to another even though everything else was the same.  It seems
that ZODB doesn't like that.  So, somehow, that caused all kinds of
unrelated problems.  I put the product back to the way it was, deleted
acl_users through python, restarted, went in and undid the Global
Registry Rebuild and the delete and voila!  It works again.

Thanks,
Tim

Chris McDonough wrote:
 
 do this in the debugger:
 
 import Zope
 app = Zope.app()
 app.fixupZClassDependencies(rebuild=1)
 get_transaction().commit()
 
 exit the debugger and restart, see what happens.
 
 - Original Message -
 From: Tim McLaughlin [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, October 12, 2001 10:29 AM
 Subject: [Zope-dev] nasty persistence problem
 
  I seem to be in a bad spot.  When I restarted Zope after modifying some
  products, I got a Could not load oid.. for all URLs.
 
  Basically, the only way I could even access anything was by doing an
  import Zope in the Python interpreter and deleting acl_users which is
  an instance of LoginManager.  And now I found out (once I was able to
  login to ZMI) that two vital ZClasses are broken also.
 
  So, I'm kinda stuck.  Here's the error:
 
  Error Type: Could not load oid ~, pickled data in traceback info
  may contain clues
  Error Value: None
 
  Here's the traceback if it helps...
 
  Traceback (innermost last):
File /zope/lib/python/ZPublisher/Publish.py, line 223, in
  publish_module
File /zope/lib/python/ZPublisher/Publish.py, line 187, in publish
File /zope/lib/python/Zope/__init__.py, line 226, in
  zpublisher_exception_hook
  (Object: LockableItem)
File /zope/lib/python/ZPublisher/Publish.py, line 171, in publish
File /zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
  (Object: manage_main)
File /zope/lib/python/ZPublisher/Publish.py, line 112, in call_object
  (Object: manage_main)
File /zope/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in
  __call__
  (Object: manage_main)
File /zope/lib/python/Shared/DC/Scripts/Bindings.py, line 354, in
  _bindAndExec
  (Object: manage_main)
File /zope/lib/python/App/special_dtml.py, line 241, in _exec
  (Object: manage_main)
File /zope/lib/python/DocumentTemplate/DT_In.py, line 711, in
  renderwob
  (Object: objectItems)
File /zope/lib/python/DocumentTemplate/DT_In.py, line 839, in
  sort_sequence
  (Object: objectItems)
File /zope/lib/python/ZODB/Connection.py, line 544, in setstate
File /zope/lib/python/ZODB/Connection.py, line 227, in
  _persistent_load
  (Info: ('\x00\x00\x00\x00\x00\x00\x17~',
 
 '(cExtensionClass\nExtensionClass\nq\x01(U\x07Sectionq\x02(cZClasses.ZClass\
 nPersistentClass\nq\x03cZClasses.ObjectManager\nObjectManager\nq\x04cOFS.Sim
 pleItem\nSimpleItem\nq\x05tq\x06}q\x07(U\x04iconq\x08U1Control_Panel/Product
 s/Content/Section/ziconImageq\tU\n_p_changedq\nK\x01U\x07__doc__q\x0bU\x07Se
 ctionq\x0cU\x08positionq\rK\x00U\x14_v_manage_path_rolesq\x0eU\x0fContent/Se
 ctionq\x0fU\x06_p_oidq\x10U\x08\x00\x00\x00\x00\x00\x00\x17~q\x11U\nziconIma
 geq\x12(U\x08\x00\x00\x00\x00\x00\x00\x17\x95q\x13(U\tOFS.Imageq\x14U\x05Ima
 geq\x15ttQU\tmeta_typeq\x16U\x07Sectionq\x17U\nmeta_typesq\x18(}q\x19(U\nper
 missionq\x1aU\x0cAdd
 
 Sectionsq\x1bU\x04nameq\x1cU\x07Sectionq\x1dU\x07productq\x1eU\x07Contentq\x
 1fU\x06actionq
  U)manage_addProduct/Content/Section_factoryq!u}qquot;(h\x1aU\x10Add
  NewsSectionsq#h\x1cU\x0bNewsSectionq$h\x1eh\x1fh
  U-manage_addProduct/Content/NewsSection_factoryq%u}qamp;(h\x1aU\tAdd
  Pagesq\'h\x1cU\x04Pageq(h\x1eU\x07Contentq)h
  Uamp;manage_addProduct/Content/Page_factoryq*u}q+(U\npermissionq,U\x10Add
 
 ItemSectionsq-U\x04nameq.U\x0bItemSectionq/U\x07productq0U\x07Contentq1U\x06
 actionq2U-manage_addProduct/Content/ItemSection_factoryq3u}q4(U\npermissionq
 5U\x13Add
 
 CatalogSectionsq6U\x04nameq7U\x0eCatalogSectionq8U\x07productq9U\x07Contentq
 :U\x06actionq;U0manage_addProduct/Content/CatalogSection_factoryqlt;u}q=(U\
 nvisibilityqgt;U\x06Globalq?U\ninterfacesq@]qA(cInterface.iclass\nInterface
 \nqBoqC}qD(U\x11_Interface__attrsqE}qF(U\nwl_getLockqG(cInterface.Method\nMe
 thod\nqHo}qI(U\x07__doc__qJU6
  Returns the locktoken identified by the locktokenuri
 
 qKU\x08optionalqL}qMU\x08requiredqN(U\tlocktokenqOtU\x08__name__qPU\nwl_getL
 ockqQU\tinterfaceqRU\x12WriteLockInterfaceqSU\x07varargsqTNU\x06kwargsqUNU\n
 positionalqV(hOtubU\rwl_lockValuesqW(hHo}qX(hJU_
  Returns a sequence of locks.  if \'killinvalids\' is true,\n
  invalid locks will be
 
 deletedqYhL}qZU\x0ckillinvalidsq[K\x00shN)hPU\rwl_lockValuesq\\hRhShTNhUNhV(
 h[tubU\nwl_hasLockq](hHo}q^(hJUU
  Returns true if the lock identified by the token is attached\nto
  the object. q_hL}q`h[K\x00shN(U\x05tokenqa
 
  and on and on for a while

Re: [Zope-dev] ZSQL methods lookup vars in REQUEST only (why?)

2001-10-11 Thread Tim McLaughlin

I agree.  However, this is true of all DTML.

I mean, its just as true in DTML methods that might REQUEST.set the args
to the ZSQLMethod.  ie. they could be tricked into REQUEST.set(ing) a
false total etc. because they lookup all of their variables in the
namespace.

Cheers,
Tim

Paul Zwarts wrote:
 
 Hi Tim,
 
 Just to play devil's advocate; It seems this way, that methods pulling
 non-specifically from namespace could allow ways to modify the result if
 someone paid close attention to whats going on... i.e The total price of
 your shopping cart before its sent to the transaction broker. It
 requires the programmer to keep even more close care that all variables
 generated at runtime are first cleaned and wiped so that this same
 REQUEST couldn't just be anticipated by someone who's interested.
 
 Or can you suggest a way around this?
 
 Thanks,
 Paul Zwarts
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf
 Of Tim McLaughlin
 Sent: Thursday, October 11, 2001 1:30 PM
 To: [EMAIL PROTECTED]
 Cc: Micah Martin
 Subject: [Zope-dev] ZSQL methods lookup vars in REQUEST only (why?)
 
 I've been asked too many times now by developers what is wrong when they
 call ZSQL Methods without passing parameters because their parameters
 are in the namespace.  This seems to make sense to all new Zopers (and
 some older ones like myself) because all other DTML lookups are in the
 entire namespace.
 
 Anyway, I propose that ZSQLMethods change and do variable lookups in the
 entire namespace, not just the REQUEST object.  It seems to be a simple
 enough change (at least it looks it) and I can submit the patches, but
 the harder thing is to get people to agree that it is a change for the
 better.
 
 The only argument that I have heard against it is that variables will be
 found mysteriously through the stack and that this is harder to
 understand.  However, that just makes it inconsistent with all other
 DTML and therefore mysterious in its own way.
 
 Consistency is much better for learning and for remembering, and DTML in
 ZSQL should work the same as DTML in DTML Methods, etc.  Please consider
 this and abuse me as appropriate ;)
 
 Regards,
 Tim
 --
 Tim McLaughlin
 iterationZERO - www.iterationzero.com
 703.481.2233
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

-- 
Tim McLaughlin
iterationZERO - www.iterationzero.com
703.481.2233

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



[Zope-dev] ZClass and ZCatalog

2001-07-06 Thread Tim McLaughlin

Marco,

The other option is to use ZClassEvents which will let you write code that
runs when properties are changed.  Then you can index in 1 or 20 catalogs,
and send emails, whatever.  CatalogAwareness, then, is no longer necessary
(since it is limited to one catalog anyway).

Tim

 -Original Message-
 From: Marco Nova [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 05 July 2001 09:47
 To: [EMAIL PROTECTED]
 Subject: [Zope-dev] ZClass and ZCatalog


 Hello Guys,

 I've a problem with a ZClass (JCEvent) I've created and ZCatalog.
 Base classes for JCEvent are: ZObject, JCObject, CatalogAwareBase.
 JCObject is another ZClass whose base class is ZObject.

 Instances of JCEvent are added to a ZCatalog but they are not
 automatically
 indexed by the catalog. The catalog is named 'events'.
 How can I automaticallly index them ?


 Thanks,

 - mn

_
Tim McLaughlin
iterationZERO - www.iterationzero.com
703-481-2233


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



[Zope-dev] security question

2001-06-15 Thread Tim McLaughlin

It seems to me that a User should not get to keep their roles in the
acquired objects which are above the User Folder in which the user is
defined... However, that does not seem to be true according my testing.

This is what happens.  Imagine a tree like this
root-folder1-acl_users
\folder2-object1


root has a role called 'User' with 'View' permissions (anonymous is
disabled) and acl_users has a user called joe.  joe can access objects in
folder2 according to the permissions set on the root by using acquisition
like this:
http://server/folder1/folder2/object1
joe cannot however, access them directly:
http://server/folder2/object1

Does this seem strange to anybody else, or have I just been working too
long?
_
Tim McLaughlin
iterationZERO - www.iterationzero.com
703-481-2233


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



[Zope-dev] symbolic link to another object in the Zope DB

2001-06-14 Thread Tim McLaughlin

Has anybody seen a product that lets you make the equivalent of a symbolic
link in unix in the Zope DB?

Thanks,
Tim

_
Tim McLaughlin
iterationZERO - www.iterationzero.com
703-481-2233


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



Re: [Zope-dev] multiple servers!

2001-06-12 Thread Tim McLaughlin

Stian,
It's probably nicer to use the -P option for z2.py which allows you to
specify a port offset for all ZServer services.

ie. -P 8001 puts http on 8081 and ftp on 8022
or  -P 8002 puts http on 8082 and ftp on 8023

--Tim

PS.  sorry all for the Base64 encoding on the previous message.

_
Tim McLaughlin
Iteration Zero - www.iterationzero.com
703-481-2233


Message: 8
Date: Mon, 11 Jun 2001 12:04:31 +0200 (CEST)
From: Erik Enge [EMAIL PROTECTED]
To: Stian Jenssen [EMAIL PROTECTED]
cc: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Re: [Zope-dev] multiple servers!

On Mon, 11 Jun 2001, Stian Jenssen wrote:

 I wan't to run two webservers on the same machine one, zope/apache an
 one apache.  Can I set it up with 2 ports eg. 8080 and 80 but how do I
 do it?

Edit the z2.py file in your zope/ directory, look for HTTP_PORT and adjust
that to your needs.


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



Re: [Zope-dev] multiple servers!

2001-06-11 Thread Tim McLaughlin

Stian,
It's probably nicer to use the -P option for z2.py which allows you to specify a port 
offset for all ZServer services.

ie. -P 8001 puts http on 8081 and ftp on 8022
or  -P 8002 puts http on 8082 and ftp on 8023

--Tim

_
Tim McLaughlin
Iteration Zero - www.iterationzero.com
703-481-2233


Message: 8
Date: Mon, 11 Jun 2001 12:04:31 +0200 (CEST)
From: Erik Enge [EMAIL PROTECTED]
To: Stian Jenssen [EMAIL PROTECTED]
cc: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Re: [Zope-dev] multiple servers!

On Mon, 11 Jun 2001, Stian Jenssen wrote:

 I wan't to run two webservers on the same machine one, zope/apache an
 one apache.  Can I set it up with 2 ports eg. 8080 and 80 but how do I
 do it?

Edit the z2.py file in your zope/ directory, look for HTTP_PORT and adjust
that to your needs.

¢—ƒzùšŠYb²Öh¥àÞ¿:)zŠà†Ûiÿùb²Û3¢—¨®æj)fjåŠËbú?Ί^uëÍ¡Êè²Êh²Û(¬tÌ-éܡا¥jם–+-²m§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)y©ç¢éÜzm§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)


[Zope-dev] Fwd: Fwd: ZClassEvents

2001-05-24 Thread Tim McLaughlin

Great to see you've got it working!


-Original Message-
From:Magnus Heino [EMAIL PROTECTED]
Sent:Wed, 23 May 2001 22:44:22 +0100
To:  [EMAIL PROTECTED]
Subject: Re: Fwd: ZClassEvents


---
 Magnus,
 Did you get this working?

Yes. Sorry that you didnt get any response. I have successfully used
it in two projects.

I'll write an howto on monday and put up on zope.org

Thanks for a great product and great support!

/Magnus

 
 Tim
 
 -Original Message-
 From:Tim McLaughlin [EMAIL PROTECTED]
 Sent:Fri, 18 May 2001 13:50:06 -0700
 To:  [EMAIL PROTECTED]
 CC:  [EMAIL PROTECTED]
 Subject: Re: ZClassEvents
 
 
 Sorry Magnus, 
 
 the self param is supposed to be bound in (Zope) python scripts.  So
there are actually only the last three (propertysheet_id, changes,
REQUEST) and self is actually the container in a ZClass.  I usually
rebind the container to a variable named self (in a ZClass) just to
make Python scripts a little more like Python.
 
 So in short, get rid of the self parameter as a parameter.  It is
actually the container.  An external method however, would still
require the self param.  Sorry for any confusion.
 
 If you get the hang of ZClassEvents can you write up a Howto?  If
not, I'll do one later.
 
 Cheers,
 --Tim McLaughlin
 
 
 
 -Original Message-
 From:Magnus Heino (Rivermen) [EMAIL PROTECTED]
 Sent:Fri, 18 May 2001 08:35:21 +0200
 To:  [EMAIL PROTECTED]
 Subject: ZClassEvents
 
 
 
 Hi Tim,
 
 I just tried your ZClassEvents and ran into some problems.
 
 I installed it, added a python script like this to an exisitng
ZClass;
 
 onPropertyChange(self, propertysheet_id, changes, REQUEST)
 
   self.reindex_all()
 
 but when I edit the properties of this zclass instance, I get an
error that
 only 3 parameters were passed, not 4 as expected.
 
 I then tried to remove self, and used context.reindex_all, but then
I got an
 error on aq_base
 
 How should it be used?
 
 Thanks!
 
 /Magnus
 
 
 

__
_
 Visit http://www.visto.com/info, your free web-based communications
center.
 Visto.com. Life on the Dot.
 
 
 

__
_
 Visit http://www.visto.com/info, your free web-based communications
center.
 Visto.com. Life on the Dot.
 
--

/Magnus Heino



___
Visit http://www.visto.com/info, your free web-based communications center.
Visto.com. Life on the Dot.


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



[Zope-dev] disable view on method for ZClass

2001-05-17 Thread Tim McLaughlin

OK here's a strange request that I think should be changed on ZClasses (bear
w/ me):

'View' permission should be disablable on a method of a ZClass.  Right now,
it forces 'View' to be mapped to 'View' if one tries to disable it.  The
reason is the event model that I am making available for ZClasses.  One such
event is the onPropertyChange which passes (self, propertysheet_id,
changes, REQUEST) to the ZClass method.  This is all well and good except
that the same method can be called TTW, and thus forged.  Worse yet, the
changes param could be forged so that the method has false params.
Disabling the method for TTW calling cleans everything up nicely.

Anybody have any thoughts?  Also, does anybody have any idea where it is
currently getting the default set... I can't seem to find it.

Thanks,
Tim

___
Tim McLaughlin  BCSwebservices.net
Director, Technical Group   1950 Old Gallows Road
tel:  (703) 790.8081 x111   Suite 201
[EMAIL PROTECTED]  Vienna, VA 22182
www .bcswebservices. net


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



RE: Subject: [Zope-dev] change ownership

2001-05-11 Thread Tim McLaughlin

Magnus,

OK, here goes the evil workaround
It seems that getUser does not return an acquisition wrapped object, so make
your external method this to wrap it (thus giving ownerinfo the ability to
determine the user db):

def setOwner(self, username):
#note: this assumes that the closest User database houses 'username'
user = self.acl_users.getUser(username)
self.changeOwnership(user.__of__(self.acl_users))
return 'done.'

--Tim McLaughlin (tmclaugh)

-Original Message-
From: Magnus Heino (Rivermen)
To: 'Tim McLaughlin'; Magnus Heino (Rivermen)
Sent: 5/11/01 1:20 AM
Subject: SV: Subject: [Zope-dev] change ownership


 could you give me a url, name  pw, and let me take a look at 
 the zclass?

Nope, I'm doing this on my laptop behind a firewall.

But, this is how to reproduce it;


This is my external method:

[magnus@daysleeper Extensions]$ cat Owner.py
def setObjectOwner(self, username):
self.changeOwnership(self.acl_users.getUser(username))
return '%s is now the owner of %s' % (username, self.id)
 
def getObjectOwner(self):
return self.getOwner()
[magnus@daysleeper Extensions]$

Goto Control_Panel/Products. Add a product 'FooProduct'. Enter the
FooProduct and create a ZClass with id and metatype 'FooClass'.

Enter the FooClass and add a External Method. Set Id and Function Name
to
'setObjectOwner'. Module name is 'Owner'.

Go to the Root zope folder. It contains a standard acl_users.

Add a FooClass named 'foo'.

Call the external method on the object like this:

http://192.168.237.105:8080/foo/setObjectOwner?username=magnus

magnus is my username that lives in the acl_users.

You get the Attributeerror on aq_inner. 

Any clues? :-P

Thanks.

/Magnus

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



RE: Subject: [Zope-dev] change ownership

2001-05-10 Thread Tim McLaughlin

I call the external method like this from DTML...

set_owner(restrictedTraverse(path_to_user)),

where path to user is a physical path, but I'm using the ZUserFolder, so I
can use the restrictedTraverse to get to users.  UserFolder has a different
API.  You could do this if your acl_users is a standard UserFolder...

set_owner(acl_users.getUser(user_name))

in DTML or make your external method this...

def set_owner(self, user_name):
  self.changeOwnership(self.acl_users.getUser(user_name))

OK, so that should keep you busy for a while.  Anyway, the point is that the
parameter to changeOwnership is a User _object_.  Good luck.

--Tim

-Original Message-
From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 7:25 AM
To: 'Tim McLaughlin'; '[EMAIL PROTECTED]'; Magnus Heino (Rivermen)
Subject: SV: Subject: [Zope-dev] change ownership



I can get it to work :-/

I get an attributeerror on aq_inner in lib/python/AccessControl/Owned.py,
line 302, in ownerInfo

Seems as if the user i provide isn't of the right type?

How do you use your method? How is it being called?

/Magnus

 Magnus,
 No, changeOwnership is not exposed for TTW calling.  But you 
 can expose it
 through an external method...  I used this one on a ZClass.
 
 def set_owner(self, user):
 self.changeOwnership(user)
 return

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



RE: Subject: [Zope-dev] change ownership

2001-05-10 Thread Tim McLaughlin

What kind of UserFolder are you using... LoginManager or something?

-Original Message-
From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 9:13 AM
To: 'Tim McLaughlin'; Magnus Heino (Rivermen)
Cc: '[EMAIL PROTECTED]'
Subject: SV: Subject: [Zope-dev] change ownership



 def set_owner(self, user_name):
   self.changeOwnership(self.acl_users.getUser(user_name))
 
 OK, so that should keep you busy for a while.  Anyway, the 

Not long enough :-P

 point is that the
 parameter to changeOwnership is a User _object_.  Good luck.

Ive got this external method in a zclass:

def setObjectOwner(self, username):
self.changeOwnership(self.acl_users.getUser(username))

I call it like http://localhost:8080/myobject/setObjectOwner?username=foo
and get this error:



  Zope Error
Zope has encountered an error while publishing this resource.

Error Type: AttributeError
Error Value: aq_inner






Troubleshooting Suggestions

The URL may be incorrect. 
The parameters passed to this resource may be incorrect. 
A resource that this resource relies on may be encountering an error. 
For more detailed information about the error, please refer to the HTML
source for this page. 

If the error persists please contact the site maintainer. Thank you for your
patience. 
 



Traceback (innermost last):
  File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py,
line 223, in publish_module
  File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py,
line 187, in publish
  File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Zope/__init__.py, line
221, in zpublisher_exception_hook
(Object: PLATS_1)
  File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py,
line 171, in publish
  File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/mapply.py,
line 160, in mapply
(Object: setObjectOwner)
  File /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py,
line 112, in call_object
(Object: setObjectOwner)
  File
/usr/home/magnus/www/Zope-2.3.2-src/lib/python/Products/ExternalMethod/Exter
nalMethod.py, line 262, in __call__
(Object: setObjectOwner)
(Info: ((FooObject instance at 873bd78, 'david'), {}, None))
  File /usr/home/magnus/www/Zope-2.3.2-src/Extensions/Owner.py, line 2, in
setObjectOwner
(Object: PLATS_1)
  File
/usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/Owned.py, line
168, in changeOwnership
(Object: PLATS_1)
  File
/usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/Owned.py, line
302, in ownerInfo
AttributeError: (see above)

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



RE: Subject: [Zope-dev] change ownership

2001-05-10 Thread Tim McLaughlin

Do you have multiple acl_users objects in the acquisition context of the
object?  Because if you do and the self.acl_users will acquire (possibly)
the wrong user database.  If that's not the problem, I'm gonna have to let
it cook, and I'll probably come up w/ somethin' later.

--Tim

plug You could also try a ZUserFolder and use restrictedTraverse if you
want. :-) /plug


-Original Message-
From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 9:23 AM
To: 'Tim McLaughlin'; Magnus Heino (Rivermen)
Cc: '[EMAIL PROTECTED]'
Subject: SV: Subject: [Zope-dev] change ownership



The one that comes with Zope.

/Magnus

 -Ursprungligt meddelande-
 Från: Tim McLaughlin [mailto:[EMAIL PROTECTED]]
 Skickat: den 10 maj 2001 15:26
 Till: 'Magnus Heino (Rivermen)'; Tim McLaughlin
 Kopia: '[EMAIL PROTECTED]'
 Ämne: RE: Subject: [Zope-dev] change ownership
 
 
 What kind of UserFolder are you using... LoginManager or something?
 
 -Original Message-
 From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 10, 2001 9:13 AM
 To: 'Tim McLaughlin'; Magnus Heino (Rivermen)
 Cc: '[EMAIL PROTECTED]'
 Subject: SV: Subject: [Zope-dev] change ownership
 
 
 
  def set_owner(self, user_name):
self.changeOwnership(self.acl_users.getUser(user_name))
  
  OK, so that should keep you busy for a while.  Anyway, the 
 
 Not long enough :-P
 
  point is that the
  parameter to changeOwnership is a User _object_.  Good luck.
 
 Ive got this external method in a zclass:
 
 def setObjectOwner(self, username):
 self.changeOwnership(self.acl_users.getUser(username))
 
 I call it like 
 http://localhost:8080/myobject/setObjectOwner?username=foo
 and get this error:
 
 
 
   Zope Error
 Zope has encountered an error while publishing this resource.
 
 Error Type: AttributeError
 Error Value: aq_inner
 
 
 
 --
 --
 
 
 Troubleshooting Suggestions
 
 The URL may be incorrect. 
 The parameters passed to this resource may be incorrect. 
 A resource that this resource relies on may be encountering an error. 
 For more detailed information about the error, please refer 
 to the HTML
 source for this page. 
 
 If the error persists please contact the site maintainer. 
 Thank you for your
 patience. 
  
 
 
 
 Traceback (innermost last):
   File 
 /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py,
 line 223, in publish_module
   File 
 /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py,
 line 187, in publish
   File 
 /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Zope/__init__.py, line
 221, in zpublisher_exception_hook
 (Object: PLATS_1)
   File 
 /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py,
 line 171, in publish
   File 
 /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/mapply.py,
 line 160, in mapply
 (Object: setObjectOwner)
   File 
 /usr/home/magnus/www/Zope-2.3.2-src/lib/python/ZPublisher/Publish.py,
 line 112, in call_object
 (Object: setObjectOwner)
   File
 /usr/home/magnus/www/Zope-2.3.2-src/lib/python/Products/Extern
 alMethod/Exter
 nalMethod.py, line 262, in __call__
 (Object: setObjectOwner)
 (Info: ((FooObject instance at 873bd78, 'david'), {}, None))
   File 
 /usr/home/magnus/www/Zope-2.3.2-src/Extensions/Owner.py, line 2, in
 setObjectOwner
 (Object: PLATS_1)
   File
 /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/O
 wned.py, line
 168, in changeOwnership
 (Object: PLATS_1)
   File
 /usr/home/magnus/www/Zope-2.3.2-src/lib/python/AccessControl/O
 wned.py, line
 302, in ownerInfo
 AttributeError: (see above)
 

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



Subject: [Zope-dev] change ownership

2001-05-09 Thread Tim McLaughlin

Magnus,
No, changeOwnership is not exposed for TTW calling.  But you can expose it
through an external method...  I used this one on a ZClass.

def set_owner(self, user):
self.changeOwnership(user)
return

--Tim


Message: 6
From: Magnus Heino (Rivermen) [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Date: Wed, 9 May 2001 16:12:53 +0200 
Subject: [Zope-dev] change ownership


Is it not possible to change ownership of an object?

I can only find methods to take ownership...

/Magnus



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



RE: [Zope-dev] Zope Server hanging :-(

2001-05-03 Thread Tim McLaughlin

Sorry, Chris M, didn't mean to get you stuck in the documentation torture
chamber ;-)

Cheers,
Tim

-Original Message-
From: Michel Pelletier [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 11:58 PM
To: Chris McDonough
Cc: Tim McLaughlin; Chris Withers; [EMAIL PROTECTED]
Subject: Re: [Zope-dev] Zope Server hanging :-(


On Wed, 2 May 2001, Chris McDonough wrote:

 The docs (available via the --help switch) go into some of this detail,
but
 I agree that a narrative explaining how to approach it from a functional
 perspective would be a good thing.

This should go in the debuggin and testing chapter of the dev guide.
Wanna take a stab?

-Michel

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



RE: [Zope-dev] Zope Server hanging :-(

2001-05-02 Thread Tim McLaughlin

Nice info.  This could be useful for many, many things.  you oughtta put
this in a how-to (if you haven't already).  thanks Chris.

I'll use it if we have any more issues.  Currently, as I told ChrisW, the
issues have stopped. But I'm still keeping my eye on it.

-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 12:00 PM
To: Chris Withers
Cc: Tim McLaughlin; [EMAIL PROTECTED]
Subject: Re: [Zope-dev] Zope Server hanging :-(


One of the more important bits is the active count when using
the --detailed option to requestprofiler.  This tells you how many *other*
requests were unfinished at the end of a particular request.

So for instance, if you run requestprofiler like this:

  python requestprofiler.py log.file.name --detailed

And you see a profile line like (header added for reference):

startwin wout wend tot S   osize  code act url
2001-04-19T01:19:420   120  12 E   26024  2005
/Catalog/checkrep?P

This means that:

 - this request started at 2001-04-19 1:19:42 UTC (start)

 - zserver waited 0 secs for input from the client (win)

 - zserver waited 12 secs for output from the publisher (wend)

 - the total time from start to end for the request was 12 secs (tot)

 - the request reached the end (E) stage (S, one of E, A, I, B)

 - the output size in bytes was 26024 (osize)

 - the http code was 200 (code)

 - the number of pending requests at the end of this request was 5
(active)

 - the URL of the request (url)

Hangs are also interesting.

Use detailed reporting to sort by end stage:

  requestprofiler.py your.log.file --detailed --sort=endstage

Any requests that don't show a stage of E for their endstage were hung
requests.

You can also use cumulative reporting to sort by hangs:

  requestprofiler.py your.log.file --cumulative --sort=hangs

This will show the methods that hung most frequently.  Much of the time,
you can find problems this way by seeing methods that enter an infinte loop
or cause a segfault.

Total time is also interesting:

  requestprofiler.py your.log.file --detailed --sort=total

  Shows you individual calls to methods that took a long time.

  - AND -

  requestprofiler.py your.log.file --cumulative --sort=total

   Shows you where most of the request time is spent.

The goal is to indentify methods or requests that take a long time, don't
return, or are accessed frequently.  If you can match this data up with
specific problems you've experienced (possibly by way of times/dates), it
becomes easier to form postulations about what is happening to Zope under
load.  Then investigate those postulations by refactoring code or by doing
more detailed logging in the places where you think the problems are.

- C





 Hmmm, not really sure what I should be looking for :-S

 What ways should I look to run it and what should I do with the output?

 cheers,

 Chris


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



[Zope-dev] Re: a plea for help (again) (tav)

2001-04-27 Thread Tim McLaughlin

Tav,

I don't see why you need to reimplement __repr__ in the first place.  I
believe that what yours is trying to do is the default implementation on a
class.  (somebody tell me if I am wrong)  But this probably is not the
fundamental issue.

TIm

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



[Zope-dev] Zope Server hanging :-(

2001-04-27 Thread Tim McLaughlin

Chris (and all),

We seem to be having similar crashing issues.  And interestingly enough,
they don't seem to show up on any of our servers except the 2.3.0 upgraded
to 2.3.1.

1.  Hangs on anything from Pythonscript or dtml
2.  top shows no significant mem or cpu usage
3.  threads are all unresponsive
4.  restart usually yields a .trX file (an aborted transaction I suppose)

Any ideas?   Maybe it was something fixed in 2.3.1?  The causes seem to be
somewhat different except that they all modify the ZODB

Tim

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



[Zope-dev] why is this more efficient

2001-04-23 Thread Tim McLaughlin

Found this in the constructor for the File Product and I don't understand
why it is more efficient.  (I want to subclass a File, so this does have
some purpose ;-))  Anybody got any ideas?

# First, we create the file without data:
self._setObject(id, File(id,title,'',content_type, precondition))

# Now we upload the data.  By doing this in two steps, we
# can use a database trick to make the upload more efficient.
self._getOb(id).manage_upload(file)

___
Tim McLaughlin  BCSwebservices.net
Director, Technical Group   1950 Old Gallows Road
tel:  (703) 790.8081 x111   Suite 201
[EMAIL PROTECTED]  Vienna, VA 22182
www .bcswebservices. net


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



RE: [Zope-dev] un-own an object

2001-04-16 Thread Tim McLaughlin

Maybe you should into them more.  I think that they are underappreciated in
the Zope world.  Very rapid dev (although slower performance).  A large part
of the Python dev that I am doing is geared to making ZClasses more
powerful.  take a look at some of my proposals.  The events in particular
make ZClasses much more powerful.  http://www.zope.org/Members/tmclaugh
We've been using the event model for ZClass dev very effectively here at
BCS.  I'll be posting the event code soon.

Tim

-Original Message-
From: Chris Withers [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 9:37 AM
To: Tim McLaughlin
Subject: Re: [Zope-dev] un-own an object


Ah well :-S Never been much fo a ZClass fan myself, anyway :-S

good luck,

Chris

Tim McLaughlin wrote:
 
 except for in my case the user itself is an instance of a ZClass  (see
 ZUserFolder).  so it seems an impasse.  I can do a goofy cut and paste and
 that will work, but it's definitely on the wacked side.
 
 thanks,
 Tim
 
 -Original Message-
 From: Chris Withers [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 13, 2001 5:30 PM
 To: Tim McLaughlin; 'R. David Murray'
 Cc: [EMAIL PROTECTED]
 Subject: Re: [Zope-dev] un-own an object
 
  I meant create an instance of a ZClass owned by a user who no longer
 exists
  (if my 'construct' word made no sense - haven't had coffee yet ;-) ).
 
 Well, the other option is that you can create a user with the same name
and
 the manager role...
 
 cheers,
 
 Chris

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



RE: [Zope-dev] un-own an object

2001-04-13 Thread Tim McLaughlin

I meant create an instance of a ZClass owned by a user who no longer exists
(if my 'construct' word made no sense - haven't had coffee yet ;-) ).

-Original Message-
From: Tim McLaughlin 
Sent: Friday, April 13, 2001 7:31 AM
To: 'Chris Withers'; R. David Murray
Cc: Tim McLaughlin; '[EMAIL PROTECTED]'
Subject: RE: [Zope-dev] un-own an object


you can always do a copy and delete to take ownership... (albeit that may
cause other probs...)

my problem is that I need to be able to construct a zclass built by a user
who no longer exists.  My suspicion is that "nobody" does not have those
privileges, and so it seems that I may be SOL  :-(

-Original Message-
From: Chris Withers [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 13, 2001 5:50 AM
To: R. David Murray
Cc: Tim McLaughlin; '[EMAIL PROTECTED]'
Subject: Re: [Zope-dev] un-own an object


"R. David Murray" wrote:
 
 Like I said (and the docs say), it is the interesection of the two
 sets of privileges, so it is effectively just the permissions of
 user nobody.

This isn't very useful though ;-)

I ended up re-creating a whole folder tree just because I wanted to delete
the
user who created them, and Zope 2.2.4 doesn't appear to have a 'Take
Ownership'
button :-(

*grumbling*

Chris :-)

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



[Zope-dev] turn off proxying TTW

2001-04-12 Thread Tim McLaughlin

How in the heck do I do this?  (also, does anybody know how to make an owned
object "unowned").  It seems that once I select a proxy role, I can't turn
it off...

TIA,
Tim

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



[Zope-dev] un-own an object

2001-04-12 Thread Tim McLaughlin

Ok, so imagine a DTML method has an owner, and as the docs say the method
can do no more than the authenticated user and the owner's permissions
combined.  So, now delete the owner.

The DTML method will no longer be functional, since the owner does not
exist, and has no permissions.  I found this to be true with ZClass
constructors at least.  I believe that the method should take the
permissions of the authenticated_user only in this scenario, but it does
not.

Any ideas?
___
Tim McLaughlin  BCSwebservices.net
Director, Technical Group   1950 Old Gallows Road
tel:  (703) 790.8081 x111   Suite 201
[EMAIL PROTECTED]  Vienna, VA 22182
www .bcswebservices. net


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



Re: [Zope-dev] ZODBCA questions...

2001-04-10 Thread Tim McLaughlin

Andy-
We've had no probs with ZODBCDA  connected to SQL Server (7 and 2000).  What
leads you to think it's a prob with the DA?

Tim

Message: 2
From: "Andy McKay" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Mon, 9 Apr 2001 10:45:55 -0700
Subject: [Zope-dev] ZODBCA questions...

Im getting some performance issues with my sites, im connecting Zope to a
SQL Server (not using ZEO). I've got suspicion, but no proof, that its
ZODBCA that is the problem. Does anyone have experiences with this on large
sites and / or a suggestion to replace it?

Cheers.
--
  Andy McKay.

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



RE: [Zope-dev] ZODBCA questions...

2001-04-10 Thread Tim McLaughlin

actually, our SQL Server sites are using 2.2.X, so it could be something 2.3
related.  were there any aqueduct or other RDB changes done between those
versions?  (I don't know of any, but I haven't looked)

pertaining to MySQL, definitely use the native DA since ODBC will simply put
an unnecessary layer in between Zope and the db.

Tim

-Original Message-
From: Schmidt, Allen J. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 8:29 AM
To: 'Tim McLaughlin'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: RE: [Zope-dev] ZODBCA questions...


We too are having problems connecting to Access2000 with ZODBCDA. Seemed to
be working fine (and I guess it still does) but it is slowing our whole site
down. all our parts were playing together very well until (we think) about
the 2.3.x introduction.

Our site grinds to a halt and is very slow in every aspect; usually in the
morning but on and off throughout the day. We tried some caching in various
places which seemed to help for a while but it is slowing back down again.

Access2000 on Win2000 with ODBC connection to Zope with ZODBCDA. Could it be
the single threadedness of either the DA or Win2K ODBC driver or Access2000
itself?? We think we have narrowed it down to the database causing the
slowdown.

Considered a move to MySQL as it is installed. Would the ZODBCDA to MySQL
cause similar problems? Better to use the native My SQL DA?

Anyone else running into same problems? Have any options to try? Thanks

Allen
-Original Message-
From: Tim McLaughlin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 7:51 AM
To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: Re: [Zope-dev] ZODBCA questions...


Andy-
We've had no probs with ZODBCDA  connected to SQL Server (7 and 2000).  What
leads you to think it's a prob with the DA?

Tim

Message: 2
From: "Andy McKay" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Mon, 9 Apr 2001 10:45:55 -0700
Subject: [Zope-dev] ZODBCA questions...

Im getting some performance issues with my sites, im connecting Zope to a
SQL Server (not using ZEO). I've got suspicion, but no proof, that its
ZODBCA that is the problem. Does anyone have experiences with this on large
sites and / or a suggestion to replace it?

Cheers.
--
  Andy McKay.

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

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



[Zope-dev] ZUserFolder usage and development

2001-04-09 Thread Tim McLaughlin

Dave,
1.  I say sync because UserFolder keeps its objects in an attribute called
"data" (list of Users) whereas ObjectManager does not.  The 'name' attribute
is no longer necessary because I usee the id of the object and allowing it
to be specified presents potential discord.

2.  Correct, you're supposed to check for that in your constructor, but this
is a new Product and could obviously be changed.  In fact, I'm thinking of
eliminating the constructor params altogether and allowing them to be set
later.  manage_editUser does check that password and confirm match since in
fact it calls the Super.

3.  I'm gonna pitch this out.  say it all to the benefit of all.

Incidentally, great working with you on this.  Excellent feedback, and your
catchin' on quickly (hooray!  another infected by the Zope bug).

Tim

-Original Message-
From: David Hassalevris
To: Tim McLaughlin
Sent: 4/9/01 4:20 PM
Subject: Re: More progress - ignore last message

Tim,
(1)
I notice that in zUserBase you omit "name" from 

def __init__   Your comment says
# name parameter allows for id and name to unsync
# so it is no longer

Can you clarify this?
Note: I noticed that the standard acl-user folder throws an error if
duplicate name is added.  Wouldnt that "default" behavior protect the
linkage (or sync) between your class and its related user object?  

(2) I also notice that while I can sucessfully add a new user via z User
Folder ... it omits password and confirmation checking.  Is this me or
is this in your code?

(3) Trying to solved problems like this raises alot of interesting Zope
questions.
Do you mind if I throw some of the issues that occur to me out to the
zope list?  
Best,
David

Tim McLaughlin wrote:
 
 cool.  I was just about to form some vague conjectures as to what your
 problem was... but good luck and lemme know if issues come up.
 
 incidentally, don't use 'name', 'roles', 'domains', or 'authenticate'
as
 property names or methods (clash with base class).
 
 Thanks,
 Tim
 
 -Original Message-
 From: David Hassalevris [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, April 08, 2001 1:21 PM
 To: Tim McLaughlin
 Subject: More progress - ignore last message
 
 Tim,
 It finally occured to me that in order to obtain User attributes not
 stored in a "property sheet" I simply had to use things like
 "getUserName()"
 Ring! methods from the base classes are available!
 
 Ill update you as things progress.
 David
 
 Tim McLaughlin wrote:
 
  David,
 
  Try it again if you have previously (0.8.0).  Includes more
instructions
  (thanks to some testing of my collegues) and fixes.
 

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



[Zope-dev] make an object unowned

2001-04-05 Thread Tim McLaughlin

Does anybody know how to make an object unowned, programmatically or through
the interface?

Thanks,
Tim

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



[Zope-dev] call pythonscript from python

2001-03-21 Thread Tim McLaughlin

Anybody know how I can call  a pythonscript from python?  Currently I can
call it, but I seem to have no context or security context, because it
either will not let me access anything or fail with an attribute error in
the context.  What are the params that I NEED to pass in so that it can do
its bindings (and if you know how to get them automagically, that would be
incredible)?

Tim

___
Tim McLaughlin  BCSwebservices.net
Director, Technical Group   1950 Old Gallows Road
tel:  (703) 790.8081 x111   Suite 201
[EMAIL PROTECTED]  Vienna, VA 22182
www .bcswebservices. net


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



RE: [Zope-dev] call pythonscript from python

2001-03-21 Thread Tim McLaughlin

I was trying to call a PythonScript from a __getstate__ method of the
object.  That seems impossible since the object appears to be already
unwrapped.  Know of any ways to get back the wrapper after it has been
disposed of?

I'm trying to add a manage_afterPropertyChanged hook, and I think I've found
another way to do it.

Thanks for the help,
Tim

-Original Message-
From: Evan Simpson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 21, 2001 10:41 AM
To: Tim McLaughlin; [EMAIL PROTECTED]
Subject: Re: [Zope-dev] call pythonscript from python


From: "Tim McLaughlin" [EMAIL PROTECTED]
 Anybody know how I can call  a pythonscript from python?  Currently I can
 call it, but I seem to have no context or security context, because it
 either will not let me access anything or fail with an attribute error in
 the context.  What are the params that I NEED to pass in so that it can do
 its bindings (and if you know how to get them automagically, that would be
 incredible)?

How does the Python code get executed (External Method? Product?) and how
does it get access to the Script?  Calling a Script should indeed
automagically give it context from its acquisition wrapper.

Cheers,

Evan @ digicool

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



[Zope-dev] get_request() idea

2001-03-15 Thread Tim McLaughlin

I'm making some mod's to the property sheets to allow them to fire an event
(call a hook) when they change on an instance.  Anyway, it looks like I'm
gonna have to hand the REQUEST object all around, so I can get the data out
of it that I need (as well as allow other inspection in the future).

Anyway, I propose that we could make Zope internals many times simpler by
having the REQUEST object available in all places Python simply by calling
get_request() (a __built_in__ method much like get_transaction).

This may even speed up Zope since in fact, no stack space will have to be
managed for the REQUEST object to be passed to methods that might or might
not need it.

Cheers,
Tim

Please don't kill me if this is a _really_stupid_idea_.

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



[Zope-dev] is there a hook for before the transaction is committed

2001-03-05 Thread Tim McLaughlin

Is there a hook for before the transaction is committed for objects which
subclass Persistent?  I found __inform_commit__ for a "registered" object,
but I can't seem to get that to work as I thought it did.  I also tried
subclassing TM like a DA, but to no avail.

TIA,
Tim

_______
Tim McLaughlin  BCSwebservices.net
Director, Technical Group   1950 Old Gallows Road
tel:  (703) 790.8081 x111   Suite 201
[EMAIL PROTECTED]  Vienna, VA 22182
www .bcswebservices. net


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



RE: [Zope-dev] is there a hook for before the transaction is committed

2001-03-05 Thread Tim McLaughlin

I want to be able to raise an event from the property sheets to the product
if a property changes.  I'm calling it manage_afterChange.  I want it only
to fire once per transaction so that multiple changes are aggregated.
Here's the declaration I have in mind.

manage_afterChange(oldItems, newItems)
oldItems: dict of id - values before modifications
newItems: dict of new values at end of transaction

This would allow an elegant "reindex" or notification system for objects.
It would also allow for validation (ie. raise error if you don't like
newItems).  Anyway, that's it.  I'm halfway there, just can't get a method
to be called on my object _just_ before commit.

Cheers,
Tim

ps.  I'm not so sure that __getstate__ will do this for me, but that's
probably cause I have no idea what __getstate__ does.  It just doesn't sound
right  ;-)

-Original Message-
From: Toby Dickenson [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 12:08 PM
To: Tim McLaughlin
Cc: '[EMAIL PROTECTED]'
Subject: Re: [Zope-dev] is there a hook for before the transaction is
committed


On Mon, 5 Mar 2001 10:56:38 -0500, Tim McLaughlin
[EMAIL PROTECTED] wrote:

Is there a hook for before the transaction is committed for objects which
subclass Persistent?

__getstate__ ?

But why would you want that?



Toby Dickenson
[EMAIL PROTECTED]

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



RE: [Zope-dev] is there a hook for before the transaction is committed

2001-03-05 Thread Tim McLaughlin

In what respect are the _v_* attribs gonna cause problems.  My guestimate
was that they disappeared upon transaction commit/abort.  I'm also not sure
as to why I would need subtrans since I'm only messing with properties of
the object.  To my knowledge, subtrans are only necessary to conserve
resources.  Anyway, what you gave me works!  Thanks.  It seems I need to
override the _vote method (since it is only called once and allows
exceptions).  As to the other stuff, I'm sure you can enlighten me further
as to why.  I appreciate the help.

Cheers.
Tim

-Original Message-
From: John D. Heintz [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 12:45 PM
To: Tim McLaughlin
Cc: '[EMAIL PROTECTED]'
Subject: Re: [Zope-dev] is there a hook for before the transaction is
committed


Hi Tim,

I have two suggestions, I hope one of them helps.

1) Attached is a TM.py file that I wrote based on the one you mention 
below.  I've tried to make it more obvious and better documented.

2) Don't use this kind of functionality, but rather use sub-transaction 
commits.

The first suggestion has more overhead than what I assume you would 
need, but the second one won't work for all situations.

A Fishbowl proposal of mine, HashingSupport, was going to use the same 
kind of hook you are asking about.  In this case though, using 
sub-transaction commits made a lot more sense.

In general though, I think that _v_* attributes pose a non-trivial 
problem that probably requires a hook on abort() if not commit() as well.

John

Tim McLaughlin wrote:

 Is there a hook for before the transaction is committed for objects which
 subclass Persistent?  I found __inform_commit__ for a "registered" object,
 but I can't seem to get that to work as I thought it did.  I also tried
 subclassing TM like a DA, but to no avail.
 
 TIA,
 Tim
 
 _______
 Tim McLaughlinBCSwebservices.net
 Director, Technical Group 1950 Old Gallows Road
 tel:  (703) 790.8081 x111 Suite 201
 [EMAIL PROTECTED]Vienna, VA 22182
 www .bcswebservices. net
 
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )



-- 
. . . . . . . . . . . . . . . . . . . . . . . .

John D. Heintz | Senior Engineer

1016 La Posada Dr. | Suite 240 | Austin TX 78752
T 512.633.1198 | [EMAIL PROTECTED]

w w w . d a t a c h a n n e l . c o m

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



[Zope-dev] catalog object owners?

2001-02-26 Thread Tim McLaughlin

Anybody know how to catalog the object "owner"?  I can't seem to find a
property to catalog the value of getUserName().  (of course I could always
kludge it with a property in the constructor, but I would prefer use what is
already there).

_______
Tim McLaughlin  BCSwebservices.net
Director, Technical Group   1950 Old Gallows Road
tel:  (703) 790.8081 x111   Suite 201
[EMAIL PROTECTED]  Vienna, VA 22182
www .bcswebservices. net


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



RE: [Zope-dev] catalog object owners?

2001-02-26 Thread Tim McLaughlin

how?  I can't seem to do it.  (I'm sure that I'm just being daft though).  I
tried both "title_and_id" and "title_and_id()" to no avail.

-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 4:51 PM
To: Tim McLaughlin; Morten W. Petersen
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope-dev] catalog object owners?


 I'll second that, the ability to catalog values returned by method calls
 would be sweet..

Not sure what you mean, this works now.

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



RE: [Zope-dev] catalog object owners?

2001-02-26 Thread Tim McLaughlin

never mind.  dumb mistake.

Thanks.

-Original Message-
From: Tim McLaughlin 
Sent: Monday, February 26, 2001 4:37 PM
To: 'Chris McDonough'; Tim McLaughlin; Morten W. Petersen
Cc: [EMAIL PROTECTED]
Subject: RE: [Zope-dev] catalog object owners?


how?  I can't seem to do it.  (I'm sure that I'm just being daft though).  I
tried both "title_and_id" and "title_and_id()" to no avail.

-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 4:51 PM
To: Tim McLaughlin; Morten W. Petersen
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope-dev] catalog object owners?


 I'll second that, the ability to catalog values returned by method calls
 would be sweet..

Not sure what you mean, this works now.

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



[Zope-dev] 2gb ZODB size limit

2001-02-15 Thread Tim McLaughlin

Is this true on windows too?  I saw some mention of this limit be lifted,
but if so, in what version?

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



[Zope-dev] http headers

2001-02-12 Thread Tim McLaughlin

Anyone know how I can log or view the http headers that Zope sends when it
responds to a http request?

Tim McLaughlin

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



[Zope-dev] zpopyda problems with typecasting

2001-02-12 Thread Tim McLaughlin

Timestamp columns do not seem to be converted to DateTime objects in Zope
when used with 2.2.4 and PoPy 1.4.1 and ZPoPyDA 1.0.1. It returns a string
object which will not convert to a DateTime without some help. The string
returned is this '2001-01-24 21:52:19-05' which does not convert because of
the -05 zone at the end. Also note, numerics do not seem to be converted to
floats either (they are returned as strings but _.float() successfully). Am
I just missing something?

Tim

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



[Zope-dev] strange problem with LoginManager

2001-02-08 Thread Tim McLaughlin

I am using LoginManager as specified by by dlpierson's HOWTO and everything
works fine unless somebody connects via ATT Worldnet (using a dialup).  In
this case, the browser displays a 404 error when the login page should be
shown.  Same machine connected through a LAN works fine, but again connected
through Worldnet is a no go.  I suspect this has something (maybe) to do
with Worldnet's proxies (if they have them) not handling the headers which
zope may (or may not) send.  Ok, so it's a guess please help.

Thanks.
Tim McLaughlin

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



[Zope-dev] Rowcount not available?

2001-01-17 Thread Tim McLaughlin

Is there a reason the rowcount property of the cursor object was not made
available throught the DA (ideally as an optional parameter of the __call__
method)?

Am I missing it somewhere else?

Cheers,
Tim McLaughlin

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




[Zope-dev] Product dev

2001-01-04 Thread Tim McLaughlin

I'm building a Product in Python and seem to be having some issues with the
new registerClass method of Product registering.  If I build it all fine as
noted in Shane's recent HowTo, the product does not show up in the control
panel.  Then after much other chasing, I make a purposeful syntax error in
the code, and the Product shows up to reflect its brokenness and shows me
the syntax error.  Then when I try to fix the error, and do a restart, the
error still shows as if I had not changed the code.  I checked _many, many_
times, and now the code is different, but Zope seems not to recognize the
changed code in spite of my deletion of the pyc files.

TYA,
Tim

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




[Zope-dev] ghost product

2001-01-04 Thread Tim McLaughlin

In fact (to clarify my preceding problem), when I removed the product
folder, Zope still shows the product and error after restarting.  Am I being
stupid?  I must be missing something

Thanks

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




RE: [Zope-dev] ghost product

2001-01-04 Thread Tim McLaughlin


Thanks for the delete issue, however that puts me at ground 0 again.  THis
product will not show up in the products list... here's the __init__.py

import ZSQLTable

def initialize(context):
"""Initialize the ZSQLTable product.
"""
context.registerClass(
ZSQLTable.ZSQLTable,
permission='Add Z SQL Tables',
constructors = (ZSQLTable.manage_addZSQLTableForm,
ZSQLTable.manage_addZSQLTable),
icon = 'zsqltable.gif')

anything look strange?, anything?

TYA

-Original Message-
From: Chris McDonough [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 04, 2001 3:38 PM
To: Tim McLaughlin; [EMAIL PROTECTED]
Subject: Re: [Zope-dev] ghost product


Delete the product from the Control Panel management interface.
- Original Message -
From: "Tim McLaughlin" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 04, 2001 3:10 PM
Subject: [Zope-dev] ghost product


 In fact (to clarify my preceding problem), when I removed the product
 folder, Zope still shows the product and error after restarting.  Am I
being
 stupid?  I must be missing something

 Thanks

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



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




[Zope-dev] regex (or re) modules

2000-12-19 Thread Tim McLaughlin

Does anybody know why these modules aren't available for DTML and Python
Methods?
(I already hacked my server, just wanna know what I'm riskin)

Thanks,
Tim

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