Re: [Zope-dev] Bugs in Zope Membership Component 0.8.0b1

2001-02-23 Thread Bill Anderson

Dirksen wrote:

 Hi Bill,
 
 All PythonScripts in ZMC 0.8.0b1 look like a direct port from Python Methods, so I 
found
 some bugs due to the incompatibility between these two version of scripts.
 
 1. In 'passwordForm', 'import string' should be added.\

for those watching, it is actually genPasswordForm  :)

 2. In 'passwordPolicy', 'self' should be ommited in the parameters list.
yup

 3. 'register', I think, should be proxy to 'Manager', like the original version.

done

 
 There's another bug: anonymous user can access account's manageMe method! Say if 
there's
 an account 'dummy', anyone can open 'www.dumy.com/test/acl_users/dummy/manageMe'. I 
think
 the permission to view 'manageMe' should be hooked up to that of viewing management
 screen. I see that you have made some special arrangements in the 'Define 
Permission' tab
 of 'Portal Member' ZClass definition, but that doesn't seem to protect its instance,
 which is a puzzle to me: what's the use to define permissions in ZClass definition or
 products?

Even better, changing the permissions on the method in the ZClass don't seem to 
propogate to existing entries, 
but do to new ones ...ohh, wait, damned browser caching ... 
 Ugh, must get some sleep.

Bill



___
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] ZPatterns feature patch: kickTriggers

2001-02-23 Thread Steve Alexander

I've patched DataSkins.py to add this method:


 def kickTriggers(self,_v_status_=_v_status_,_v_dm_=_v_dm_):
 """Cause triggers to be set off at the end of this
transaction, without needing to set any attributes."""
 self = self._canonicalForm()
 if self._v_status_ is not ChangedStatus:
 d=self.__dict__
 d[_v_dm_]._objectChanging(self)
 d[_v_status_] = ChangedStatus


I often want triggers to fire on a DataSkin because some other 
specialist knows about a change that will affect that Dataskin's 
computed attributes. I don't need to change the DataSkin; I just want 
the triggers to fire at the end of the transaction.

My current hack for causing triggers to fire without needing to actually 
change an attribute has recently stopped working.

   object.propertysheets.Basic.
   manage_changeProperties(bogus_property_to_prime_triggers=1)

This is due to recent optimisations in OFS/PropertySheets.py in Zope 2.3 
from CVS -- now, an object only gets changed when you alter a property 
that actually exists. This is a good thing, as it reduces bloat in the ZODB.

I'd welcome suggestions on a better name for the method than 
"kickTriggers". :-)

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.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 )



[Zope-dev] Python Script

2001-02-23 Thread Cyril Elkaim


   Hi All,

I must say that I have very hard time with both Scripts and Zclass.
My problem is the context and the container proprties of a script inside a Zclass.

If I understand well the context is an URL point of view, the object accessed
through the web.

The container is fixed, it's the object in the database, OK?

Now what is the container in the case of a Zclass _instance_. When I test
a script inside the zclass _definition_ the container.objectItems() returns
correctly all the other methods of the definition. When I run the script
inside an _instance_ of that zclass it returns nothing.

So is an instance the same container of its zclass definition or something
else?

What I should want to do is to access the images inside a zclass definition
from the script running in an _instance_ 'context' of that zclass.

BTW some pointers explaining the hierarchy in both the URL point of view
and the database point of view would be very welcomed :-)

Thanks in advance,
Cyril



___
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] Python Script

2001-02-23 Thread Steve Alexander

Cyril Elkaim wrote:

Hi All,
 
 I must say that I have very hard time with both Scripts and Zclass.
 My problem is the context and the container proprties of a script inside a Zclass.
 
 If I understand well the context is an URL point of view, the object accessed
 through the web.
 
 The container is fixed, it's the object in the database, OK?
 
 Now what is the container in the case of a Zclass _instance_. 

In this case, container is the ZClass instance.

This is consistent with the object-oriented way of defining methods in a class 
definition, and using them bound to an instance of that class.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.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] Python Script

2001-02-23 Thread Cyril Elkaim

   Thanks Steve,

 In this case, container is the ZClass instance.

Understood, that was my conclusion and it's logical.

One more question please :-)

How can I access the methods definitions of the zclass from an instance ?

I don't talk about calling them but getting an 'attribute' of the zclass
knowing only its name at _runtime_ not _compile_ time?

Thanks,
Cyril

___
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] ZPatterns feature patch: kickTriggers

2001-02-23 Thread Steve Spicklemire


Hmmm... 

tripTriggers(...)

pullTriggers(...)

fireTriggers(...)

;-)

dunno... kickTriggers works for me... 

-steve

 "SA" == Steve Alexander [EMAIL PROTECTED] writes:

SA I've patched DataSkins.py to add this method:
...

SA I'd welcome suggestions on a better name for the method than
SA "kickTriggers". :-)

SA -- Steve Alexander Software Engineer Cat-Box limited
SA http://www.cat-box.net



SA ___ Zope-Dev
SA maillist - [EMAIL PROTECTED]
SA http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
SA posts or HTML encoding!  ** (Related lists -
SA http://lists.zope.org/mailman/listinfo/zope-announce
SA 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 )



Re: [Zope-dev] Python Script

2001-02-23 Thread Steve Alexander

Cyril Elkaim wrote:


 How can I access the methods definitions of the zclass from an instance ?
 
 I don't talk about calling them but getting an 'attribute' of the zclass
 knowing only its name at _runtime_ not _compile_ time?

I don't entirely understand what you want to do.

Calling a method on a ZClass instance involves getting the attribute 
that represents that method, then calling it. Get the object that 
represents the method, and do what you want with it.

Can you give me a concrete example?

-- 
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.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] Python Script

2001-02-23 Thread Cyril Elkaim

   Hi Steve,

In the zclass definition I have a bunch of Image objects together with the
following script.

SCRIPT s_center(width, height, image):

import string

result = None

for item in container.objectItems():
  if string.strip(item[0]) == image:
image_width = int(item[1].getProperty("width"))
image_height = int(item[1].getProperty("height"))

left = (int(width) - image_width) / 2
top = (int(height) - image_height) /2

result = "left:" + str(left) + "px; top:" + str(top) + "px"

return result

/END_SCRIPT

This script works fine if I test it inside the test tabs of the zclass. But
if I run it from an instance 'container.objectItems()' returns nothing. I 
understand why but my problem is how to get access of the images from
the instance.

What I need is something giving a reference to the zclass definition from
one of its instance. I think I can use the DOM model and walk through until
I find it but it should be better to have a direct access from the instance
itself, wrong?

Thanks,

Cyril

___
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] Python Script

2001-02-23 Thread Steve Alexander

Cyril Elkaim wrote:
 

 This script works fine if I test it inside the test tabs of the zclass. But
 if I run it from an instance 'container.objectItems()' returns nothing. I 
 understand why but my problem is how to get access of the images from
 the instance.
 
 What I need is something giving a reference to the zclass definition from
 one of its instance. I think I can use the DOM model and walk through until
 I find it but it should be better to have a direct access from the instance
 itself, wrong?

From an external method, you can do

  dir(self.__class__)

or

  dir(type(self))

to get the attributes of your class.


 From a PythonScript, you can use something like

   container.Control_Panel.Products.product_name.class_name

to get a reference to the ZClass definition.

You should also be able to use this:

   container.manage_addProduct['product_name'].class_name

I suggest you make a PythonScript or external method in your ZClass 
definition called list_attributes, that returns a list of the attributes 
of the ZClass definiton. Your other methods can call that.
That way, if you change the Product of your ZClass in the future, you 
only have one thing to alter (should you choose the PythonScript).

I advise against using an external method for this, as (if you're not 
careful) it may return unwrapped objects, which is a security hazard.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.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 )



[Zope-dev] Zope and persistence in product dev.

2001-02-23 Thread Jan Murre

Hi all,

I have the following question about Persistence in Zope.

I am developing a Product. This product is using some classes internally.
These classes are non Zope classes. I found out in one of the How-To's that
the Zope persistence machinery can be triggered with the expression:
_p_changed = 1, so I am able to make my non Zope classes persistent.

I use the following setup:

class ZopishClass:

def __init__ (self, id):
self.id = id
self.listOfNonZopeClass2 = []

class NonZopeClass1:

def __init__ (self, id):
self.id = id
self.subListOfNonZopeClass2 = []

class NonZopeClass2:

In the subListOfNonZopeClass2 I store a subset of the instances of
NonZopeClass2 that are in listOfNonZopeClass2. Now my question is:
Should is store id's in the subListOfNonZopeClass2, or should I store 'real'
instances.

According to the "Programming Python" book the pickling process takes care
or storing objects only once, but it seems that this is not true for Zope
persistence.

Anybody that can help me out?

Regards,

Jan Murre


___
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] ZCatalog madness. (Must log in as emergencyuser.)

2001-02-23 Thread Erik Enge

On Thu, 22 Feb 2001, Chris McDonough wrote:

 I'm not sure why this isn't in 2.3.1b1, but yes, the code in getobject was
 changed to use unrestrictedTraverse for this very reason.

On closer inspection, I can see that it is actually changed in
2.3.1b1.  It does say unrestrictedTraverse (line 457, I belive).  I
grepped for restrictedTraverse, but couldn't find any occurances
(lib/python/Products/ZCatalog).  Why am I still being asked to log in as
emergencyuser to be able to do this, if I'm not using
restrictedTraverse.  And is there a way to actuall give access to
restrictedTraverse (or, probably more corretly, to let it traverse)?


___
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] Python Script

2001-02-23 Thread Cyril Elkaim

Steve Alexander wrote:
   for name,object in container.objectItems():
 if string.strip(name) == image:
   image_width = int(object.getProperty("width"))
   image_height = int(object.getProperty("height"))

Thanks again :-), I passed too much time with Javascript and not enough
with Python, but that will changed soon :-)

Cyril

___
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] Python Script

2001-02-23 Thread Cyril Elkaim

   Thanks Steve, I will try...

   Cyril

___
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] ZCatalog madness. (Must log in as emergencyuser.)

2001-02-23 Thread Chris McDonough

No... what are you getobjecting?  Does it happen only with certain kinds of
objects?  Are they ZClass objects or Product-based objects?

- Original Message -
From: "Erik Enge" [EMAIL PROTECTED]
To: "Chris McDonough" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, February 23, 2001 9:23 AM
Subject: Re: [Zope-dev] ZCatalog madness. (Must log in as emergencyuser.)


 On Thu, 22 Feb 2001, Chris McDonough wrote:

  I'm not sure why this isn't in 2.3.1b1, but yes, the code in getobject
was
  changed to use unrestrictedTraverse for this very reason.

 On closer inspection, I can see that it is actually changed in
 2.3.1b1.  It does say unrestrictedTraverse (line 457, I belive).  I
 grepped for restrictedTraverse, but couldn't find any occurances
 (lib/python/Products/ZCatalog).  Why am I still being asked to log in as
 emergencyuser to be able to do this, if I'm not using
 restrictedTraverse.  And is there a way to actuall give access to
 restrictedTraverse (or, probably more corretly, to let it traverse)?




___
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] ZCatalog madness. (Must log in as emergencyuser.)

2001-02-23 Thread Erik Enge

On Fri, 23 Feb 2001, Chris McDonough wrote:

 No...

"No" to which question?

 what are you getobjecting?  Does it happen only with certain kinds of
 objects?  Are they ZClass objects or Product-based objects?

It happens with all kinds of objects I have in my index.  All my objects
in the index are from Python-based products.


___
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] Minor typos/changes to ZCatalog.

2001-02-23 Thread Erik Enge

On Fri, 23 Feb 2001, Michael R. Bernstein wrote:

 On the subject of numbers, I was wondering how to index
 alphanumeric values like ISBN numbers.

Why can't you use FieldIndexes?


___
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] Traceback strangeness and default width/height (and those funnyPython Methods)

2001-02-23 Thread Erik Enge

Is it just me, or has the tracebacks provided by Zope when an Exception is
raced gotten "worse"?  In Zope 2.3.1b1 it usually says file: DT_In (or one
of them), and doesn't even mention the file which the Exception was raised
from.

Also, When I set the default width/height with the new ZMI and bring up a
Python Method window, it doesn't follow the default values I've put
in.  Maybe this is related to something else, because using the + and - on
width doesn't work very well either..  Maybe it is this old crappy version
of IE I'm running...

And another thing about those Python Methods.  When an Exception is raised
and it gives me the line number it seems to miss the correct line by
one.  Ie. if I raise an Exception on the first line in a Python Method, it
tells me that it was raised on line 2.


___
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] ZCatalog distinct in SQL

2001-02-23 Thread Casey Duncan

--- Valérie Aulnette [EMAIL PROTECTED] wrote:
 Hi, 
 
 I am using PTK and it does work with ZCatalog.
 I need to do the list of values that are in the
 catalog  but I need do do like a "select distinct"
 in
 SQL to have each value only once.
 Do you know how to do that in ZCatalog ?
 
 Thanks.
 Valerie.
 


For fieldindexes there is a catalog method
uniqueValuesFor(name) which when passed the name of
the index returns the unique values within it.

hth,

=
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`-

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/

___
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] AttributeError validate using the Visitor pattern

2001-02-23 Thread R. David Murray

On Mon, 19 Feb 2001, Itai Tavor wrote:
 You posted your questions 3 days ago, so maybe you found a solution 
 by now... but this might still be useful to you.

I just unwrapped the visitor pattern into an psuedo-case statement grin.

 - I'm passing _ explicitly instead of relying on binding. I vaguely 
 recall reading something about a problem binding the namespace. It 
 might be fixed in the latest Python Scripts, I haven't tried the CVS 
 version yet.

This appeared to be the key.  I changed my 'accept(me)' call to
read 'accept(me,_=_)', and everything started working.  Thanks
very much!

 - visitLineItem is called in the context of an OrderLineItem, so no 
 dtml-with item is needed.

I had actually tried that and gotten an even less intelligable error
message.  So now I've reverted to that form and it works great.

 - If you wanted the visitor to implement looping over the items 
 (which is how the GoF do it) you could easily make something like:
 
  Order.displayItemsVisitor.displayItems (DTML Method):
  dtml-in line_items
tr
  dtml-var "_['sequence-item'].accept(container, _)"
/tr
  /dtml-in

Yeah, that's more or less what I do.  My display dtml-method gets passed the
list of objects, and it does the loop (implementing the batching logic
for dtml-in) calling accept on the items in the list.  I need to rename
my folder to make it's purpose clearer, though grin.

 BTW, I never thought of using a visitor for this until you brought it 
 up, so thanks! What I really like about it is that the same 'accept' 
 method can be used by multiple visitors, each one implementing a 
 different view of the object. So I can have displayItemsVisitor, 
 displayItemsCompactVisitor, and displayItemsEditableVisitor, all 

Yeah, exactly.  displayItemsEditableVisitor is why I chose to
implement the visitor pattern.  I've wound up doing it another
way (checking the auth of the logged in user and putting in a button),
but I suspect I'll have another Visitor before I'm through with the
project.

Thanks again for your help.

--RDM


___
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] ZPatterns feature patch: kickTriggers

2001-02-23 Thread R. David Murray

On Fri, 23 Feb 2001, Steve Alexander wrote:
 I'd welcome suggestions on a better name for the method than 
 "kickTriggers". :-)

armTriggers

--RDM


___
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] ZCatalog madness. (Must log in as emergencyuser.)

2001-02-23 Thread Chris McDonough


 "No" to which question?

No to the question "And is there a way to actuall give access to
restrictedTraverse (or, probably more corretly, to let it traverse)?"

  what are you getobjecting?  Does it happen only with certain kinds of
  objects?  Are they ZClass objects or Product-based objects?

 It happens with all kinds of objects I have in my index.  All my objects
 in the index are from Python-based products.

Are they all of one type?  unrestrictedTraverse uses the security policy
code to determine user access to an object, which is at this point
(unfortunately) different than the way that publishing traversal security
works.  Can you replicate the behavior across many different kinds of
objects, or is this problem only with a single type of object?


___
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] Minor typos/changes to ZCatalog.

2001-02-23 Thread Chris McDonough

  Probably.  Keyword indexes work too.

 Yeah, that was what I was getting at :)

Yes.

  This is the number of objects indexed by the index.  If it's not
working,
  that's a bug.

 Then it looks like a bug.  Lucky us, I don't have time to analyze this in
 a week or so.

Sorry.  I'd like to help.

  No.  ;-)  This is one of the things I'd like to get done soon.

 Great!  When you get around to do it, maybe you could poke at Amos to
 update his ZCatalogHowTo also?  It's quite out of date.

It should perhaps be removed in light of the fact that the Zope Book has a
catalog chapter.

 Maybe a "This How-To covers product such-and-such version x.x" is in
 order as a standard feature of the How-To?

This is a good idea.  It would be an even better idea to allow folks to add
comments to howto pages, so that if the original author did not maintain it
well, well-placed comments could prevent folks from taking wild goose
chases.



___
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] REQUEST acting up and misplacing form elements in other

2001-02-23 Thread Morten W. Petersen

Hi zopers,

I've been wondering what may be causing the REQUEST object to
store form values in the other dictionary.  Is this a new
feature or simply a bug?

Cheers,

Morten

___
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] Minor typos/changes to ZCatalog.

2001-02-23 Thread Erik Enge

On Fri, 23 Feb 2001, Chris McDonough wrote:

  Maybe a "This How-To covers product such-and-such version x.x" is in
  order as a standard feature of the How-To?
 
 This is a good idea.  It would be an even better idea to allow folks to add
 comments to howto pages, so that if the original author did not maintain it
 well, well-placed comments could prevent folks from taking wild goose
 chases.

Yes, maybe like the way the ACS lets you?  That would work very
nicely.  Great suggestion! :)


___
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] ZCatalog madness. (Must log in as emergencyuser.)

2001-02-23 Thread Chris McDonough

different python classes.  Do they inherit from a common base class?  Did
you make these objects or are they from another Product or are they standard
Zope objects (like DTML methods, etc.)?

- Original Message -
From: "Erik Enge" [EMAIL PROTECTED]
To: "Chris McDonough" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, February 23, 2001 1:55 PM
Subject: Re: [Zope-dev] ZCatalog madness. (Must log in as emergencyuser.)


 On Fri, 23 Feb 2001, Chris McDonough wrote:

   It happens with all kinds of objects I have in my index.  All my
objects
   in the index are from Python-based products.
 
  Are they all of one type?

 The same type (as in, they are all Python based), but with different
 meta_types.

  Can you replicate the behavior across many different kinds of
  objects, or is this problem only with a single type of object?

 Different kinds of meta_types or ZClass/Python classes?


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



Re: [Zope-dev] ZCatalog madness. (Must log in as emergencyuser.)

2001-02-23 Thread Erik Enge

On Fri, 23 Feb 2001, Chris McDonough wrote:

  It happens with all kinds of objects I have in my index.  All my objects
  in the index are from Python-based products.
 
 Are they all of one type? 

The same type (as in, they are all Python based), but with different
meta_types.

 Can you replicate the behavior across many different kinds of
 objects, or is this problem only with a single type of object?

Different kinds of meta_types or ZClass/Python classes?


___
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 browser information from HTTP_USER_AGENT..

2001-02-23 Thread Pattreeya Tanisaro

Hello!
I would like to get the information about user's browser but when I
add these following tags in my dtml header, the result from the third 
condition is always true.  (I checked with netscape and konqueror and the 
results were the same, Your browser is neither IE nor Netscape. ) 

Thank you so much in advance for any suggestion.

dtml-if "_.string.find(_['HTTP_USER_AGENT'], 'MSIE')   -1"
link href="dtml-var "msie_css.absolute_url()"" rel="stylesheet" 
type="text/css"
Your browser is IE.
dtml-elif "_.string.find(_['HTTP_USER_AGENT'], 'NETSCAPE')  -1"
link href="dtml-var "netscape_css.absolute_url()"" rel="stylesheet" 
type="text/css"
Your browser is Netscape.
dtml-else
link href="dtml-var "lw_global_css.absolute_url()"" rel="stylesheet" 
type="text/css"
Your browser is neither IE nor netscape.
/dtml-if

___
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] ZCatalog madness. (Must log in as emergencyuser.)

2001-02-23 Thread Chris McDonough

  And any access to getobject with any data_record_id_ returns
unauthorized
  for any user besides emergency user?

 Hm...  No, not entirely correct.  If I don't get any hits, I don't get the
 unauthorized, but that is probably because I don't even try the
 getobject.  The point I'm making is that I might be able to call getobject
 with a bogus data_record_id_ (although I highly doubt it).

It wouldn't return unauthorized if you passed it a bogus data_record_id_, it
would fail differently.

I meant to narrow down the problem domain in cases where you do call
getobject... cases where you aren't calling getobject are not relevant.

It would be helpful to find out for which objects getobject fails and for
which it succeeds under your setup.  I suspect that it's a __roles__ problem
with a type of object being retrieved.  These kind of problems are
notoriously difficult to debug.  :-(

 Steve Alexander suggested that I try the ZCatalog from CVS.  The problem
 is fixed there, isn't it?

You can try it, but I don't think there's any significant difference between
the ZCatalog in CVS and the one in Zope 2.3b1 if you see
"unrestrictedTraverse" in your 2.3b1's ZCatalog.py's getobject method.

Narrowing the problem down to a set of objects for which getobject *always*
fails is probably the first step.  Then maybe I can reproduce it here if you
can give me the code for these objects.



___
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 alert and hotfix release...

2001-02-23 Thread Brian Lloyd

Hello All,

  Casey Duncan uncovered a potential security issue today that
  necessitated a hotfix release.

  This hotfix addresses an important security issue that affects Zope
  versions up to and including Zope 2.3.1 b1.

  The issue is related to ZClasses in that a user with through-the-web
  scripting capabilities on a Zope site can view and assign class attributes
  to ZClasses, possibly allowing them to make inappropriate changes to
ZClass
  instances.

  This patch also fixes problems in the ObjectManager, PropertyManager, and
  PropertySheet classes related to mutability of method return values which
  could be perceived as a security problem.

  We *highly* recommend that any Zope site running versions of
  Zope up to and including 2.3.1 b1 have this hotfix product installed
  to mitigate these issues if the site is accessible by untrusted users
  who have through-the-web scripting privileges.

- http://www.zope.org/Products/Zope/Hotfix_2001-02-23/README.txt

-
http://www.zope.org/Products/Zope/Hotfix_2001-02-23/Hotfix_2001-02-23.tgz



Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909
Digital Creations  http://www.digicool.com




___
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] ZCatalog madness. (Must log in as emergencyuser.)

2001-02-23 Thread Erik Enge

On Fri, 23 Feb 2001, Chris McDonough wrote:

 I meant to narrow down the problem domain in cases where you do call
 getobject... cases where you aren't calling getobject are not relevant.

Ok.  I see.
 
 It would be helpful to find out for which objects getobject fails and for
 which it succeeds under your setup.  I suspect that it's a __roles__ problem
 with a type of object being retrieved.

Interessting...

 Narrowing the problem down to a set of objects for which getobject *always*
 fails is probably the first step.  Then maybe I can reproduce it here if you
 can give me the code for these objects.

I'll see if I don't have the time to do this bright and early in the
morning, but - as I've said - I suspect it is true for all kinds of
objects and meta_types.

Feedback and debug information coming your way as soon as possible :)


___
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 book now in public CVS

2001-02-23 Thread Michel Pelletier


Greetings!

The Zope book is now available in raw (structured text) format in a
sourceforge CVS repository.  We are also using SF's bug tracking and other
tools to allow you better report problems to us than just email.  If you'd
like to check the book out of CVS, follow the instructions on this page
under 'Anonymous CVS Access':

http://sourceforge.net/cvs/?group_id=21038

What does this do for you?  Well, first off, if you see problems in the
book and you'd like to fix them, you can submit a patch to us instead of
an email "describing" your suggested fix in prose.  This is much more
accurate for us to see the problem you point out.  Tracking patches also
gives us a nice mechanism for making sure we give patch-submitters
honorable mention in the book!

Also, some people may want to distribute the book (in accordance with the
OPL license, or course) in some format we don't support yet, like LaTeX or
Word (yes, PDF is coming, we're working on it!).  With "the source" you
are free to go about converting the content into whatever format you'd
like.

Lastly, although we try to keep the site as in-sync as possible with the
CVS, the latest and greatest bug changes to the book may be found in CVS,
where the web-site may lag a few days behind.

So check it out, and enjoy.

-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] Minor typos/changes to ZCatalog.

2001-02-23 Thread Michael R. Bernstein

"R. David Murray" wrote:
 
 On Fri, 23 Feb 2001, Michael R. Bernstein wrote:
  As you can see by the second example, an ISBN can have
  letters as well as numbers in it, so it cannot be
  represented by an integer. Text indexes seem to ignore
  'words' that contain numbers, though.
 
  Any suggestions?
 
 A field or keyword index would work.  Or you can make a very small
 change to splitter.c to stop it from ignoring numbers.
 
 Which is something I'd like to see as a standard feature of Catalog,
 actually.  I can't think of any instances of using a text index
 where I did *not* want words with numbers indexed, and have a number
 of instances where I *do* want words with numbers indexed.  Actually,
 the same applies to pure numbers, as well.

Hmm. this seems like there ought to be a checkbox next to
the 'Add Index' form field labeled 'index numbers?'. Or
maybe a 'Text and Numbers' index as an additional index
type.

What change needs to be made to splitter.c? Do I have to
recompile Zope afterwards, or will a restart do it?

Michael Bernstein.

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