Re: [Zope-dev] skinscript and URL traversal question

2001-01-21 Thread Aaron Payne

Hi all,

A solution has been found.  woohoo.  A not found error was produced with 
direct URL traversal.

Steve Spicklemire sent this solution off list.

The process is split into two steps:

Do the query to 'load the object on traversal':
WITH QUERY searchBy_Name(name=self.id) COMPUTE name

Do the query to 'load the attributes needed for rendering a particular 
document':
WITH QUERY searchByNameCheck(self.id) COMPUTE 
username,coupon_text,categorylist,categoryheader,expirationdate,status,couponterms

During traversal AUTHENTICATED_USER is not yet defined, so it's no good trying
to get to it. However, once authentication has happened (after Zope has sorted
out what object you're after an imposed security on the object..) then it 
should
be OK. Since the Storage tab uses 'name' to load the object, we can't access
AUTHENTICATED_USER before loading 'name', but the other attributes are OK.

-Aaron



___
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] Specialist/Rack scalability

2001-01-21 Thread Michael Bernstein

After comsidering the fedback I got from the previous
'Massive scalability thread, I decided to split my queries
into two areas: Rack scalability and ZCatalog scalability.
This email deals with the former.

It seems clear that indexing and searching are more of a
botleneck than storage/retreival. Nevertheless, so far I
have not heard of anyone trying to store more than 60,000
objects in a rack. I need to know if there is any reason to
suspect that storage (in the ZODB) or retreival performance
would suffer if the number of objects was in the hundreds of
thousands or even millions.

Does anyone have anectodal or benchmark data that would
suggest what happens with that many objects?

Thanks,

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 )




[Zope-dev] ZCatalog scalability

2001-01-21 Thread Michael Bernstein

After comsidering the feedback I got from the previous
'Massive scalability' thread, I decided to split my queries
into two areas: Rack scalability and ZCatalog scalability.
This email deals with the latter.

Partial match (wildcard) searches have already been
identified as a resource hog, depending on the size of the
result list. I am more than willing to give up wildcards in
my application for performance.

What I am interested in for my application are two things:

- ZTopics populated using one or more keyword indexes

- Full text search on a single computed attribute that
concatenates several fields including the aforementioned
keyword index fields and a few simple string attributes
(title, caption, description, etc.)

I need to know how far the ZCatalog will scale using this
indexing and search strategy. Does anyone have anectodal or
benchmark data to suggest if (and when) I will hit a 'wall'
regarding the number of objects being indexed and searched?
Some anectodal data suggests that single field indexing will
scale easily to 60,000 objects, what about hundreds of
thousands or even millions of objects?

Also, is there a way to disable wildcards in full text
searches?

Thanks,

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 )




Re: [Zope-dev] Specialist/Rack scalability

2001-01-21 Thread Steve Alexander

Hi Michael,

Michael Bernstein wrote:


 It seems clear that indexing and searching are more of a
 botleneck than storage/retreival. Nevertheless, so far I
 have not heard of anyone trying to store more than 60,000
 objects in a rack. I need to know if there is any reason to
 suspect that storage (in the ZODB) or retreival performance
 would suffer if the number of objects was in the hundreds of
 thousands or even millions.

I can't answer your question; however, I may be able to help clarify the 
question.

The ZODB is really just a transaction manager, and an interface and 
contract of behaviour, for an object database.

You can plug a variety of Storages into the ZODB. The default storage 
the Zope comes with is FileStorage -- Data.fs.

There are also BerkeleyStorage, OracleStorage, DBMStorage, and others, 
in varying states of finishedness.

So, storing things in a Rack happens in a number of stages:

   Your application interacts with the Rack
   The Rack (perhaps) stores the object persistently in its BTree
   The BTree is a collection of persistent ZODB objects
   The ZODB objects are stored as Python Pickles in a FileStorage

We can consider what the effect of storing 60 000 objects is at each of 
these interfaces.

The Rack shouldn't have a problem with 60 000 objects.

I doubt a BTree would have a problem.

The ZODB might not like accessing many large objects during a single 
transaction, as all those objects need to be in memory at once.

A FileStorage should have no problem reading 60 000 stored objects. 
However, if these objects are changing much, your Data.fs will grow 
fast. In any case, you may find undo and history screens take a long 
time to appear.

However, if you are using a Rack, you have a lot of choice about where 
you put your data. You can put frequently changed aspects of your data 
on the filesystem, and the rest in FileStorage for 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] ZCatalog scalability

2001-01-21 Thread Steve Alexander

Michael Bernstein wrote:


 Also, is there a way to disable wildcards in full text
 searches?

Do not allow direct queries to search the catalog. Instead, make 
searches go through an external method (or a PythonScript with Proxy 
permissions) that uses string.replace to change '*' and '?' to ''.

--
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] ZCatalog scalability

2001-01-21 Thread Michael Bernstein

Steve Alexander wrote:
 
 Michael Bernstein wrote:
 
  Also, is there a way to disable wildcards in full text
  searches?
 
 Do not allow direct queries to search the catalog. Instead, make
 searches go through an external method (or a PythonScript with Proxy
 permissions) that uses string.replace to change '*' and '?' to ''.

A *very* handy suggestion. You might want to add that as a
Tip to Zope.org.

Thanks,

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 )




Re: [Zope-dev] ZCatalog scalability

2001-01-21 Thread Michael Bernstein

Erik Enge wrote:
 
 [Michael Bernstein]
 
 | I need to know how far the ZCatalog will scale using this indexing
 | and search strategy. Does anyone have anectodal or benchmark data to
 | suggest if (and when) I will hit a 'wall' regarding the number of
 | objects being indexed and searched?
 
 I'm going to try to stuff 27 million objects into ZODB sometime in the
 next week or the week after that (all post addresses in England).  I
 haven't got a clue as to whether this will work or just... well not
 work.  I haven't come up with a strategy for segmenting the data, but
 that shouldn't be a problem at all.  This isn't actually much data, so
 I don't expect the Data.fs file to more than 500 MB.
 
 I'm quite confident that ZODB, ZCatalog and BTree will scale very
 nicely for this.  I have a plan ;).
 
 I'll let you know how it goes.  (And please, do poke at me if it takes
 too long.

Will do, Thanks!

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 )




Re: [Zope-dev] Specialist/Rack scalability

2001-01-21 Thread Michael Bernstein

Steve Alexander wrote:
 
 Hi Michael,
 
 Michael Bernstein wrote:
 
 
  It seems clear that indexing and searching are more of a
  botleneck than storage/retreival. Nevertheless, so far I
  have not heard of anyone trying to store more than 60,000
  objects in a rack. I need to know if there is any reason to
  suspect that storage (in the ZODB) or retreival performance
  would suffer if the number of objects was in the hundreds of
  thousands or even millions.
 
 [snip]

 So, storing things in a Rack happens in a number of stages:
 
Your application interacts with the Rack
The Rack (perhaps) stores the object persistently in its BTree
The BTree is a collection of persistent ZODB objects
The ZODB objects are stored as Python Pickles in a FileStorage
 
 We can consider what the effect of storing 60 000 objects is at each of
 these interfaces.

Are there any differences if you scale the number of objects
up to the hundreds of thousands or even into the millions?

 The Rack shouldn't have a problem with 60 000 objects.
 
 I doubt a BTree would have a problem.
 
 The ZODB might not like accessing many large objects during a single
 transaction, as all those objects need to be in memory at once.

Neither of my applications require batch adds to the DB,
however, one of them (the image archive) has objects
(Photos) with several images as attributes. This results in
a fairly large object. There is some question in my mind if
accessing any attribute (such as the thumbnail version)
causes all attributes to be loaded into memory. If so,
displaying a list of images with thumbnails may result in
many large objects being loaded into memory.

 A FileStorage should have no problem reading 60 000 stored objects.
 However, if these objects are changing much, your Data.fs will grow
 fast. In any case, you may find undo and history screens take a long
 time to appear.

No. Once added, I don't expect the data to change
frequently.

Thanks for the feedback.

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 )




Re: [Zope-dev] Specialist/Rack scalability

2001-01-21 Thread Steve Alexander

Michael Bernstein wrote:


 There is some question in my mind if
 accessing any attribute (such as the thumbnail version)
 causes all attributes to be loaded into memory. If so,
 displaying a list of images with thumbnails may result in
 many large objects being loaded into memory.

Make sure that each large attribute is an instance of a class that 
derives from Persistent.

Of course, if this is a ZPatterns application, you'd probably want to 
have the images in their own Rack, and use an Attribute Provider on your 
Photo objects that gets the images for a Photo as needed. The Photo 
(with meta-data) and the images are entirely different objects, accessed 
via different Racks, via different Specialists.

--
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] ZCatalog scalability

2001-01-21 Thread Erik Enge

[Michael Bernstein]

| I need to know how far the ZCatalog will scale using this indexing
| and search strategy. Does anyone have anectodal or benchmark data to
| suggest if (and when) I will hit a 'wall' regarding the number of
| objects being indexed and searched?

I'm going to try to stuff 27 million objects into ZODB sometime in the
next week or the week after that (all post addresses in England).  I
haven't got a clue as to whether this will work or just... well not
work.  I haven't come up with a strategy for segmenting the data, but
that shouldn't be a problem at all.  This isn't actually much data, so
I don't expect the Data.fs file to more than 500 MB.

I'm quite confident that ZODB, ZCatalog and BTree will scale very
nicely for this.  I have a plan ;).

I'll let you know how it goes.  (And please, do poke at me if it takes
too long.)


___
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] Specialist/Rack scalability

2001-01-21 Thread Michael Bernstein

Steve Alexander wrote:
 
 Michael Bernstein wrote:
 
  There is some question in my mind if
  accessing any attribute (such as the thumbnail version)
  causes all attributes to be loaded into memory. If so,
  displaying a list of images with thumbnails may result in
  many large objects being loaded into memory.
 
 Make sure that each large attribute is an instance of a class that
 derives from Persistent.

Ok, I'll give that a try. Since Photo is a Python Product,
what will happen to current instances if I make this (and
only this) change?

 Of course, if this is a ZPatterns application, you'd probably want to
 have the images in their own Rack, and use an Attribute Provider on your
 Photo objects that gets the images for a Photo as needed. The Photo
 (with meta-data) and the images are entirely different objects, accessed
 via different Racks, via different Specialists.

I'm not certain that that makes sense, since the Images are
really cached 'views' of the Photo object. When a new image
is uploded to replace an existing one, *all* versions
(thumbnails, small, medium, large, etc) are regenerated.

But assuming that I went so far as to break out the Images
to their own Rack, would you reccomend that each image size
have a dedicated Rack, or would you suggest that all images
be stored in the same Rack?

Thanks,

Michael.

___
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] Specialist/Rack scalability

2001-01-21 Thread Steve Alexander

Michael Bernstein wrote:
 

 Make sure that each large attribute is an instance of a class that
 derives from Persistent.
 
 Ok, I'll give that a try. Since Photo is a Python Product,
 what will happen to current instances if I make this (and
 only this) change?

I don't know. I can think of reasons that it might be ok. I can also 
rationalize why it would cause badness. :-)

 
 [[ put images in their own specialist ]


 I'm not certain that that makes sense, since the Images are
 really cached 'views' of the Photo object. When a new image
 is uploded to replace an existing one, *all* versions
 (thumbnails, small, medium, large, etc) are regenerated.

Makes sense to me. You're not generating them on the fly; you're storing 
them persistently.

If you put them in their own Specialist and Rack or Racks, you get to

say how they are stored entirely independently of how the Photo objects
are stored.

I would have just one Images specialist, and then probably store them in 
different racks, but expose them to the rest of the application as all 
being of the same class of Image, but with a different image_size 
attribute; either "thumbnail", "small", "medium" or "large".
That way, I could make the small rack generate thumbnails from the 
medium rack if, for example, the small size was rarely requested.

There are many ways to design that though, and it depends on how you 
want things to work. (Obviously :-) )

 But assuming that I went so far as to break out the Images
 to their own Rack, would you reccomend that each image size
 have a dedicated Rack, or would you suggest that all images
 be stored in the same Rack?

There are advantages and disadvantages to each approach. However, you 
should be hiding the details of what Racks exist behind the facade of 
the Specialist.

The Specialist will have a getItem method, which will get an Image from 
the appropriate rack, and probably some methods like 
listImagesFor(photo) and getImageFor(image_type, photo) so you can get 
all the images for a particular photo.

Perhaps also storeImageFor(photo, original_image), which would end up 
processing and storing images derived from the original image.

--
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] CSS file serving

2001-01-21 Thread richard

Casey Duncan wrote:
 [EMAIL PROTECTED] wrote:
 
  I've ended up hacking a version of special_dtml / ClassicHTMLFile that
  serves up CSS. Has anyone got a better way of doing it (that detects
  changes in the file and serves it up with the correct Content-Type)?
 
 Check out:
 
 http://www.zope.org/Members/haqa/ZStyleSheet

   Hrm - that's a little heavy for what I want - which is just an analog of
HTMLFile but for CSS files. That is, something I can add to my Python
product as an attribute. Definitely no management or other sorts of
trickiness required.



Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

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

2001-01-21 Thread Chris Withers

 Michael Bernstein wrote:


  Also, is there a way to disable wildcards in full text
  searches?

 Do not allow direct queries to search the catalog. Instead, make
 searches go through an external method (or a PythonScript with Proxy
 permissions) that uses string.replace to change '*' and '?' to ''.

Wouldn't using a normal vocabulary as opposed to a globbing vocabulary
prevent this as well?

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] ZCatalog scalability

2001-01-21 Thread Steve Alexander

Chris Withers wrote:

 
 Wouldn't using a normal vocabulary as opposed to a globbing vocabulary
 prevent this as well?

That would stop globbing searches for everyone.

While I might want to stop users of a site making wildcard searches, I 
still want to keep that facility for myself :-)

--
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] dtml-in batching

2001-01-21 Thread richard

The dtml-in batching mechanisms are quite difficult to debug - the DTML
documentation I have has examples which break it and there's no indication
of why. It turns out the DT_In renderwb() code gobbles all exceptions from
the rendering of the previous and next blocks. I've hacked my code so that
there's no try/except clause any more. I'm not sure what exception it's
trying to catch, but could it perhaps be made a little more picky?


Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
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] dtml-in batching

2001-01-21 Thread richard

[EMAIL PROTECTED] wrote:
 
 The dtml-in batching mechanisms are quite difficult to debug - the DTML
 documentation I have has examples which break it and there's no indication
 of why. It turns out the DT_In renderwb() code gobbles all exceptions from
 the rendering of the previous and next blocks. I've hacked my code so that
 there's no try/except clause any more. I'm not sure what exception it's
 trying to catch, but could it perhaps be made a little more picky?

   Re-glancing at the code shows me that this is only the case for the next
block. Sorry about that.

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
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] dtml-in batching

2001-01-21 Thread richard

[EMAIL PROTECTED] wrote:
 
 The dtml-in batching mechanisms are quite difficult to debug - the DTML
 documentation I have has examples which break it and there's no indication
 of why. It turns out the DT_In renderwb() code gobbles all exceptions from
 the rendering of the previous and next blocks. I've hacked my code so that
 there's no try/except clause any more. I'm not sure what exception it's
 trying to catch, but could it perhaps be made a little more picky?

And here's a diff - I'm pretty sure this was the intended behaviour...


*** /tmp/DT_In.py.orig  Mon Jan 22 12:00:53 2001
--- DT_In.pyMon Jan 22 12:00:58 2001
***
*** 561,566 
--- 561,570 
  # there are more items, without actually
  # computing a length:
  sequence[end]
+ except IndexError:
+ if self.elses: result=render(self.elses, md)
+ else: result=''
+ else:
  pstart,pend,psize=opt(end+1-overlap,0,
sz,orphan,sequence)
  kw['next-sequence']=1
***
*** 568,576 
  kw['next-sequence-end-index']=pend-1
  kw['next-sequence-size']=pend+1-pstart
  result=render(section,md)
- except:
- if self.elses: result=render(self.elses, md)
- else: result=''
  else:
  result = []
  append=result.append
--- 572,577 


-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
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] Specialist/Rack scalability

2001-01-21 Thread Phillip J. Eby

At 07:12 PM 1/21/01 +, Steve Alexander wrote:

So, storing things in a Rack happens in a number of stages:

   Your application interacts with the Rack
   The Rack (perhaps) stores the object persistently in its BTree
   The BTree is a collection of persistent ZODB objects
   The ZODB objects are stored as Python Pickles in a FileStorage

We can consider what the effect of storing 60 000 objects is at each of 
these interfaces.

The Rack shouldn't have a problem with 60 000 objects.

I doubt a BTree would have a problem.

The ZODB might not like accessing many large objects during a single 
transaction, as all those objects need to be in memory at once.

A FileStorage should have no problem reading 60 000 stored objects. 
However, if these objects are changing much, your Data.fs will grow 
fast. In any case, you may find undo and history screens take a long 
time to appear.

However, if you are using a Rack, you have a lot of choice about where 
you put your data. You can put frequently changed aspects of your data 
on the filesystem, and the rest in FileStorage for example.

Just to expand a little on the abov...  Racks should scale at least as
well, if not larger than a ZCatalog, given the same storage backing for the
ZODB.  This is because ZCatalog has to manage a minimum of one forward and
reverse BTree for *each* index, plus another few BTrees for overall storage
and housekeeping.  Also, keyword and full text indexes store multiple BTree
entries per object, so that's a factor as well.

So don't worry about the Rack.  If you're using a Rack, you can store the
data anywhere, and you can index it in an RDBMS, LDAP directory, ZCatalog,
or some combination thereof, using triggers to keep the data in sync.


___
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] SQL query result set - what data structure how to access [(elements)]?

2001-01-21 Thread Andrew Kenneth Milton

+---[ Lee ]--
| Hi,
| 
| I'm using a python method to query my database as follows, where I need
| to use the result set to generate some HTML. I'm interested in result[0]
| and result[1] as listed below;
| 
| * return result[0] gives me:
| [{'name': 'PRACTICALS', 'type': 's', 'null': None, 'width': None},
| {'name': 'TUTORIALS', 'type': 's', 'null': None, 'width': None},
| {'name': 'ASSIGNMENTS', 'type': 's', 'null': None, 'width': None},
| {'name': 'BONUS', 'type': 's', 'null': None, 'width': None}]
| 
| * return result[1] (or just 'return result') gives me:
| [(1, 16, 9, 1)]
| 
| What kind of data structure is this? First impressions suggest that it's
| a tuple but why the extra brackets?. I need to access each element but
| how do I do this? I've tried all sort of tuple/list
| conversions/operations and have had no success.
| 
| If the result is [(1, 16, 9, 1)] how can I assign...
| 
| a=1st element i.e. 1
| b=2nd element i.e 16..?
| 

Ok try this... you're getting a ResultSet back, here's some code to
iterate over them.

These are little gems I've gleaned from various places, so I take
no credit (or responsibility) for this code :-)

add these to your .py file


from string import upper, lower
import Missing
mt=type(Missing.Value)

def typeconv(val):
if type(val)==mt:
return ''
return val

def sqlattr(ob, attr):
name=attr
if hasattr(ob, attr):
return typeconv(getattr(ob, attr))
attr=upper(attr)
if hasattr(ob, attr):
return typeconv(getattr(ob, attr))
attr=lower(attr)
if hasattr(ob, attr):
return typeconv(getattr(ob, attr))
raise NameError, name


Then as an example of how it works;
in the same .py file.

def parseResultSet(self):
userList={}
myResults=self.sqlGetAllCustomers()
for cust in myResults:
customername=sqlattr(cust,'customername')
username=sqlattr(cust,'username')
userList[username]=customername
return userList

myResults represents any result set... so it should 'just work', YMMV

-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd  |  F:+61 7 3870 4477   | 
ACN: 082 081 472 ABN: 83 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068|[EMAIL PROTECTED]| 

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




Re: [Zope] MySQL connection string.

2001-01-21 Thread Joachim Werner

Indra Gunawan wrote:

 Hello,
 could anyone tell me how to make connection string to MySQL in Linux?
 I use Zope 2.3 and I've tried the 
 
 database@[host] username password

This should work. Your problem is probably somewhere else. Are you sure 
that the database adapter, database etc. are all set up correctly?

Joachim.


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




Re: [Zope] RE: Workflow and document management system in Zope

2001-01-21 Thread Hannu Krosing

Nicolas Pettiaux wrote:
 
 I am looking for a workflow (WF) linked to a electronic document management
 (EDM) system and a groupware email based (I have just happened to come
 accross aethera from the Kompany) that would be free software and preferably
 in Zope + Python. The WF+DEM system I am looking for need to be usable with
 only a browser (to be independant from the client ... that could be
 proprietary !), store its data into a postgresql database.

You could check out Amphora which should do most of what you suggest. 
And it is based on Zope+Postgres.

the main info page is at http://www.amphora.ee/  (unfortunately in
estonian only ;)

but you can check out demo which is either in english or estonian
(depending on 
your browser language settings) at
https://demo.amphora.ee/amphora/classic/
password:demo and username:demo 

It is not completely opensource though but is available with development 
license.

-
Hannu

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




[Zope] Index out of range

2001-01-21 Thread Tim Cook


Error Type: IndexError
Error Value: list index out of range

I am importing a text file via an external method. I did my
testing with a file that contained 18 records.
All went fine. Stepped up the testing to a file with 550 records.
The real thing will have over 30,000. Now it doesn't work. :-)
It's not a memory issue or anything that you would expect with an
increase i records. 

Anyway, here's the link to where I can the results. I also added
a method to display the dictionary contents (raw mode) for
testing. I don't see anything wrong with it.

I have a ZClass that I will be creating instances of, when I get
the code right. :-)

http://www.freepm.org:8080/tkfpm/Drugs/multum_update

Here's the HTML method:
--
dtml-var standard_html_header

table border="3" cellspacing="5" cellpadding="5" 

...(table headers removed for bandwith's sake)

dtml-let drugs="importmultum()"
dtml-in "drugs.keys()"
dtml-if sequence-even
  tr bgcolor="#77ccbb"
dtml-else
  tr bgcolor="#cc6600"
/dtml-if
dtml-let dictkey=sequence-item
  tddtml-var sequence-number/td
  tddtml-var dictkey/td
  tddtml-var "drugs[dictkey][0]"/td
  tddtml-var "drugs[dictkey][1]"/td
  tddtml-var "drugs[dictkey][2]"/td
  tddtml-var "drugs[dictkey][3]"/td
  tddtml-var "drugs[dictkey][4]"/td
  tddtml-var "drugs[dictkey][5]"/td
  tddtml-var "drugs[dictkey][6]"/td
  tddtml-var "drugs[dictkey][7]"/td
 tddtml-var "drugs[dictkey][8]"/td
 tddtml-var "drugs[dictkey][9]"/td
 tddtml-var "drugs[dictkey][10]"/td
 tddtml-var "drugs[dictkey][11]"/td
 tddtml-var "drugs[dictkey][12]"/td
 tddtml-var "drugs[dictkey][13]"/td
 tddtml-var "drugs[dictkey][14]"/td
 tddtml-var "drugs[dictkey][15]"/td
 tddtml-var "drugs[dictkey][16]"/td
 tddtml-var "drugs[dictkey][17]"/td
 tddtml-var "drugs[dictkey][18]"/td
 tddtml-var "drugs[dictkey][19]"/td
 tddtml-var "drugs[dictkey][20]"/td
 tddtml-var "drugs[dictkey][21]"/td
 tddtml-var "drugs[dictkey][22]"/td
 tddtml-var "drugs[dictkey][23]"/td
 tddtml-var "drugs[dictkey][24]"/td
 tddtml-var "drugs[dictkey][25]"/td
 tddtml-var "drugs[dictkey][26]"/td
 tddtml-var "drugs[dictkey][27]"/td
 tddtml-var "drugs[dictkey][28]"/td
 tddtml-var "drugs[dictkey][29]"/td
 tddtml-var "drugs[dictkey][30]"/td
 tddtml-var "drugs[dictkey][31]"/td
 tddtml-var "drugs[dictkey][32]"/td
 tddtml-var "drugs[dictkey][33]"/td
 tddtml-var "drugs[dictkey][34]"/td
 tddtml-var "drugs[dictkey][35]"/td

/dtml-let
  /tr
/dtml-in
/dtml-let
/table
dtml-var standard_html_footer
-
The RAW dictionary dump method:

dtml-var standard_html_header

pre
dtml-let drugs="importmultum()"
bNumber of items:/b dtml-var "_.len(drugs.keys())"br

p
dtml-in "drugs.keys()"
dtml-let dictkey=sequence-item
 dtml-var sequence-number nbsp; dtml-var sequence-item
nbsp;bLength:/b dtml-var "_.len(drugs[dictkey])"
nbsp;dtml-var "drugs[dictkey]"br
 /dtml-let
/dtml-in
/dtml-let
/pre
dtml-var standard_html_footer
-


I found that if I just include the first element of the list
(tddtml-var "drugs[dictkey][0]"/td) the HTML table renders.
When I add the second list element is when it dies.

I have looked at the source file to see if there are any
incorrect (non-printables etc) didn't find any.


THanks for any help/suggestions,

-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Nearly everyone will lie to you given the  right
circumstances."  
- Bill Clinton

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




[Zope] Re: Index out of range

2001-01-21 Thread Tim Cook

Tim Cook wrote:
 
 Error Type: IndexError
 Error Value: list index out of range
 

OOPS! forgot the control panel info:

Zope version: Zope 2.2.5b1 (binary release, python 1.5.2,
linux2-x86) 
Python version: 1.5.2 (#10, Dec 6 1999, 12:16:27) [GCC 2.7.2.3] 
System Platform: linux2 
Process ID: 32347 (3076) 
Running for: 24 days 9 hours 37 min 39 sec 





-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Nearly everyone will lie to you given the  right
circumstances."  
- Bill Clinton

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




[Zope] ZOPE and PHP - possible or not ?

2001-01-21 Thread Greg Nowak

Hi!

How do I combine the PHP code with ZOPE ?

How to tell Apache to parse the PHP code ?
Where do I find info ?

Best regards,
Greg



-- 
BEZPLATNE konto e-mail o adresie [EMAIL PROTECTED] i NIELIMITOWANEJ pojemnosci 
Tylko w POLAND.COM ! www.poland.com

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




Re: [Zope] RE: Workflow and document management system in Zope

2001-01-21 Thread Nicolas Pettiaux

Dear Mr Krosing,

Thank you VERY much for the information.

This application looks really neat, this is really going in the direction I 
want, and has indeed a lot of the features I am looking for.

This IS the application I want to start with. 

My estonian is really poor (not to say, I don't understand a word), but the 
English help is good enough.

I shall go on tomorrow morning, but for what I noticed, it matches a lot of 
our requirements.

I shall go on with some questions and statements, to knwo more about the 
system.

Le Dimanche 21 Janvier 2001 13:28, Hannu Krosing a écrit :
  I am looking for a workflow (WF) linked to a electronic document
  management (EDM) system and a groupware email based (I have just happened
  to come accross aethera from the Kompany) that would be free software and
  preferably in Zope + Python. The WF+DEM system I am looking for need to
  be usable with only a browser (to be independant from the client ... that
  could be proprietary !), store its data into a postgresql database.

 You could check out Amphora which should do most of what you suggest.
 And it is based on Zope+Postgres.

 the main info page is at http://www.amphora.ee/  (unfortunately in
 estonian only ;)

 but you can check out demo which is either in english or estonian
 (depending on
 your browser language settings) at
 https://demo.amphora.ee/amphora/classic/
 password:demo and username:demo

I did. Working good. I appreciate the fact that it is certified.

 It is not completely opensource though but is available with development
 license.

Q1/ What is not open-source ?

Q2/ What could be done to have the system open-sourced ? (We are ready to pay 
for such a system)

Q3/ What is a developpement license ?

Q4/ Which parts are proprietary ? I would understand if the "special" clients 
related to (I quote)
"Special software exists for easy synchronisation with MS Outlook and MS 
Windows file system." and
"The special Windows client is built using Borland Delphi, uses PGP for 
encryption/decryption and integrates Mozilla toolkit for electronic 
signatures. " would be proprietary, provided their protocol be open and fully 
described." be proprietary.
We could pay for such licenses ... if the cost of the system is comparable to 
other similar systems.

Q5/ Would you be ready for a contract to improve and further develop the 
system, as well as provide a maintenance for 3 to 5 years ?

Q6/ I need to have a setup ready and if possible in English (and French and 
Dutch if possible but I have the translatros from English) within a week. 
Could this be possible ?

Q7/ How do I have to proceed to set the system up (I can have local help with 
Zope + Postgresql + python if I do not succeed personnally, but I need a 
"procedure") = do this and this to install and configure the system, as well 
as some fake data.

Q8/ What is your isntalled base ? (which are your clients) Are there any 
public institution your client (governments, large companies ...)

Q9/ What kind of company are you ? 
How many people ? 
Which specific competences ? 
What is you financial backing (please understand that I would need to go 
through a public market, for which I would need answers to these questions 
plus many other !)

Q10/ How many simultaneous client does the system stand ?

Q11/ What is a reasonable system (I mean hardware) to run the system on, 
knowing that we could have about 50 users to start with in about 2 to 3 
months, plus 200 users in about 6 months and about 500 in a year). We are 
ready to start with a small system and upgrade the hardware later on. 

Q12/ The system works with OUtlook. Does it also work with Outlook Express ? 
(that has less features than outlook, for example NO calendar as far as I 
know)

Q13/ Are all the protocols, formats, file formats ... open and fully descibed 
(there is a law proposal that is supposed to get through very soon in Belgium 
that make it compulsory for public administration to use open format and 
protocols, that is formats and protocols that are 100 % described in public 
understandable document, for which a free implementation can be made, and 
that are deposited by a public institution)

Q14/ As an open-source system (you say nearly) is it easily extendible in 
Zope and Python ?

Q15/ Can it easily be linked with a LDAP directory service to provide the 
contacts coordinates ? (There is a ZOPE to LDAP system)

Q16/ Can the project management system be extended to provide PERT and GANTT 
chart ? 

Q17/ How can a standard flow for a process be described and checked : I mean 
a way to trace for a project that a standard acceptation process has been 
followed for example ?

Q18/ What about signatures and authentications of actions by specific people ?

Q19/ Could you do as much as possible to let me set up a demonstration ?

Q20/ Does the system run on Debian Potato ? THis is the server we run on, 
because we find debian management is the easiest and that tests are better 
done on 

[Zope] Bug Export Product and inheritance (2). Any more description about XML export format?

2001-01-21 Thread Thierry Nabeth

Hello,

I am still struggling to find a way to solve the bug (even manualy)
relate to exporting a package in which a class inherits from a class
of another package.

Do you have any more details about the Import XML format ?
I want to see if I can edit manually this file in order to solve
the fact that I lost inheritance from one class to another class
that is defined in another package.




For instance in the file
.../OFS/XMLExportImport.py

we have:

def save_record(parser, tag, data):
file=parser.file
write=file.write
pos=file.tell()
file.seek(pos)
a=data[1]
if a.has_key('id'): oid=a['id']
oid=ppml.p64(string.atoi(oid))
v=''
for x in data[2:]:
v=v+x
l=ppml.p64(len(v))
v=oid+l+v
return v

def importXML(jar, file, clue=''):
import Shared.DC.xml.pyexpat.pyexpat
pyexpat=Shared.DC.xml.pyexpat.pyexpat
if type(file) is StringType:
file=open(file)
outfile=TemporaryFile()
data=file.read()
F=ppml.xmlPickler()
F.end_handlers['record'] = save_record
F.end_handlers['ZopeData'] = save_zopedata
F.start_handlers['ZopeData'] = start_zopedata
F.binary=1
F.file=outfile
p=pyexpat.ParserCreate()
p.CharacterDataHandler=F.handle_data
p.StartElementHandler=F.unknown_starttag
p.EndElementHandler=F.unknown_endtag
r=p.Parse(data)
outfile.seek(0)
return jar.importFile(outfile,clue)


Would it be possible to have a couple of lines of comments ?

Thank you


Thierry Nabeth
INSEAD CALT
http://www.insead.edu/CALT/



Note:
This BUG makes almost impossible all serious reuse of package
in Zope. (if you want to use inheritance, since you can not
get newer version of the package you reuse).
I am very surprised that nobody did not give any comment to my previous
message !!!


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




Re: [Zope] Re: Index out of range

2001-01-21 Thread Tim Cook

Tim Cook wrote:
 
 Tim Cook wrote:
 
  Error Type: IndexError
  Error Value: list index out of range
 

Well, DUH me. I forgot the last two lines of the text file (it's
a dump from a database sent to me from someone else). One only
had the number of rows and the other an EOF.

Sorry to waste your bandwidth. 
My external method now checks the length of the list before
putting it intothe dictionary. :-)


-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Nearly everyone will lie to you given the  right
circumstances."  
- Bill Clinton

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




[Zope] TCPWatch... and closing sockets..

2001-01-21 Thread Steve Spicklemire


I'm going to try to make a long story short... and the story isn't even
over... but I'm getting close. One of our clients is a 'multimedia'
company and we're working with a group there that consists mostly
of artists and designers who use tools like photoshop and 
macromedia director. They came to us recently with a project
for which they were *going* to use Macromedia Multiuser Server
but the complexity of their application is significant.. 

long story short... I've sold them on the concept of using Zope as the
'media/personality server' for this application.  They will use
Director (which can post stuff to an URL and can also parse
XML). So.. I'm building a framework that permits them to use their
favorite tools, but I get to use *my* favorite tool too. ;-) The
problem: Director is not a browser. There is no 'view source'. But (I
think to myself) this is a great chance to use tcpwatch, which I've
never used before. It's a little tricky since my favorite client
machine is a Macintosh, and well.. lets just say that Tkinter for the
mac is not perfect... not to mention there is no thread module..  but
I do have a workaround that's useful (since I run Zope on a FreeBSD
server, I just use tcpwatch on FreeBSD and either MI/X, or VirtualPC
with Linux for my X server.. ). I noticed however that when I did a
'POST' the URL encoded arguments were lost. I found that the
proxy_receiver handle_close method was never called.. so that anything
in a 'last line' that didn't end in '\n' was lost. I added the
following patch that shows this... but why is handle_close not called?
I can only guess that the socket is not being properly closed
somehow. I use lib/python/ZPublisher/Client.py to test calls to Zope
and it works fine, but the asyncore/asynchat stuff never calls
handle_close for proxy_receiver.

Anyway... here's the patch: Comments welcome!

*** ./tcpwatch_orig.py Sat Jan 20 16:55:43 2001
--- ./tcpwatch.py   Sun Jan 21 16:52:11 2001
***
*** 130,135 
--- 130,137 
  pos = pos + 1
  else:
  # Last line, may be incomplete.
+ line = "Partial line? " + data[oldpos:] + '\r\n'
+ self.watch_output(line, byClient)
  return data[oldpos:]
  
  def cleanupRefs(self):

take care,
-steve

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




[Zope] patch for python configure for freeBSD and Zope

2001-01-21 Thread matt

Hi, I'm using  freeBSD 4.2-RELEASE and just tried to install python-1.5.2 and
Zope.  If you are trying to do the same and tun into the following error when
trying to start zope, then apply this patch to the configure script of python
and rebuild it.

ImportError: ./ExtensionClass.so: Undefined symbol "PyMethod_Type"

have fun
Matt

2249c2249
   FreeBSD*/4*) LDSHARED="gcc -shared";;
---
   FreeBSD*/3*) LDSHARED="gcc -shared";;
2295c2295
   FreeBSD/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
---
   FreeBSD/3*) LINKFORSHARED="-Xlinker -export-dynamic";;



[Zope] Object DB versus Relational DB

2001-01-21 Thread Tom Deprez

Hi,

Can somebody provide me informational links of documents which present the
benefits and non-benefits of both DB? eg. When to use one and when not to
use one?

Thanks,
Tom.


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




[Zope] ZSQL Methods in ZClasses...

2001-01-21 Thread Curtis Maloney


Green things,

Am I missing something, or should I just simply not be using ZSQL methods in 
my ZClass?  If I try to add one, I get an error about there not being a DB 
connection object (which makes sense) and won't let me add the object.

I was planning on making the constructor find all available DB connections, 
and make the user select one.

Have a better one,
Curtis Maloney

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




[Zope] Re: patch for python configure for freeBSD and Zope

2001-01-21 Thread Chris Watson

 Hi, I'm using  freeBSD 4.2-RELEASE and just tried to install python-1.5.2 and
 Zope.  If you are trying to do the same and tun into the following error when
 trying to start zope, then apply this patch to the configure script of python
 and rebuild it.
 
 ImportError: ./ExtensionClass.so: Undefined symbol "PyMethod_Type"

Matt,

Is this an error in the port itself of python? Python 2.0 is in
ports as well as zope. If there is a problem with either port can you give
more detail so the apropriate maintainer can be notified. Thanks!   

--
=
-Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
Home:  [EMAIL PROTECTED] | http://open-systems.net
=
WINDOWS: "Where do you want to go today?"
LINUX: "Where do you want to go tomorrow?"
BSD: "Are you guys coming or what?"
=
GNU = Gnu's Non-portable  Unstable
irc.openprojects.net #FreeBSD -Join the revolution!
ICQ: 20016186


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




[Zope] Re: patch for python configure for freeBSD and Zope

2001-01-21 Thread matt

On Mon, 22 Jan 2001, Chris Watson wrote:
  Hi, I'm using  freeBSD 4.2-RELEASE and just tried to install python-1.5.2 and
  Zope.  If you are trying to do the same and tun into the following error when
  trying to start zope, then apply this patch to the configure script of python
  and rebuild it.
  
  ImportError: ./ExtensionClass.so: Undefined symbol "PyMethod_Type"
 
 Matt,
 
   Is this an error in the port itself of python? Python 2.0 is in
 ports as well as zope. If there is a problem with either port can you give
 more detail so the apropriate maintainer can be notified. Thanks! 


Sorry, to be more explicit :
I built python 1.5.2 and Zope 2.2.2 from source, although the most recent
stable release of Zope also gave the same error.

I did not use the ports distribution of python or zope, so I don't know if
the same default configure script is used by them too.

Is that what you wanted to know?

Matt



 
 --
 =
 -Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
 Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
 Home:  [EMAIL PROTECTED] | http://open-systems.net
 =
 WINDOWS: "Where do you want to go today?"
 LINUX: "Where do you want to go tomorrow?"
 BSD: "Are you guys coming or what?"
 =
 GNU = Gnu's Non-portable  Unstable
 irc.openprojects.net #FreeBSD -Join the revolution!
 ICQ: 20016186
-- 

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




[Zope] Re: patch for python configure for freeBSD and Zope

2001-01-21 Thread Chris Watson

 Sorry, to be more explicit :
 I built python 1.5.2 and Zope 2.2.2 from source, although the most recent
 stable release of Zope also gave the same error.
 
 I did not use the ports distribution of python or zope, so I don't know if
 the same default configure script is used by them too.
 
 Is that what you wanted to know?


Yes. That answers what I wanted to know. Is there a specific
reason you didnt want to use the ports? Since the ports work just fine im
assuming there is. I would like to know if its because the ports are
lacking a feature you need so they can be fixed? If not why not just
use the ports?

--
=
-Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
Home:  [EMAIL PROTECTED] | http://open-systems.net
=
WINDOWS: "Where do you want to go today?"
LINUX: "Where do you want to go tomorrow?"
BSD: "Are you guys coming or what?"
=
GNU = Gnu's Non-portable  Unstable
irc.openprojects.net #FreeBSD -Join the revolution!
ICQ: 20016186


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




[Zope] Re: patch for python configure for freeBSD and Zope

2001-01-21 Thread matt

On Mon, 22 Jan 2001, Chris Watson wrote:
  Sorry, to be more explicit :
  I built python 1.5.2 and Zope 2.2.2 from source, although the most recent
  stable release of Zope also gave the same error.
  
  I did not use the ports distribution of python or zope, so I don't know if
  the same default configure script is used by them too.
  
  Is that what you wanted to know?
 
 
   Yes. That answers what I wanted to know. Is there a specific
 reason you didnt want to use the ports? Since the ports work just fine im
 assuming there is. I would like to know if its because the ports are
 lacking a feature you need so they can be fixed? If not why not just
 use the ports?



No reason except that I have an install script for python, zope, and modules
(including configuration) for both that I "know" form a stable environment on
our production servers, whether linux, or freeBSD.  I should try the ports
distribution and run my unit tests to perhaps build a more likely to be
stable freeBSD installer for our work.

Matt


   
 --
 =
 -Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
 Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
 Home:  [EMAIL PROTECTED] | http://open-systems.net
 =
 WINDOWS: "Where do you want to go today?"
 LINUX: "Where do you want to go tomorrow?"
 BSD: "Are you guys coming or what?"
 =
 GNU = Gnu's Non-portable  Unstable
 irc.openprojects.net #FreeBSD -Join the revolution!
 ICQ: 20016186

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




[Zope] LoginManager disrupts access to protected object above it

2001-01-21 Thread Itai Tavor

Hi,

This problem started with failure to access Control_Panel, which I 
thought was due to a SiteAccess problem... but I now tracked it to a 
problem with an instance of LoginManager.

I have the following setup:

Zope 2.3.0b2
ZPatterns 0.4.3b2
LoginManager 0.8.8b1

Zope/
 test1 (PythonScript) requires Manager to view
 folder/
 test2 (PythonScript) Manager proxy role
 acl_users (LoginManager)

test1:
 return 'spam'

test2:
 return container.test1

Calling test2 results in the traceback attached below. If I remove 
acl_users, test2 works. The LoginManager is a bit tricky, as it uses 
a virtual UserSource loading user objects from an external 
Specialist, but it seems to work in every other way. I have no idea 
if this problem is due to a bug in my LoginManager implementation or 
a general LoginManager bug.

Can anyone explain this or suggest a way to find out what is going wrong?

TIA


   AttributeError

   test1

Traceback (innermost last):
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 222, in publish_module
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 187, in publish
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/Zope/__init__.py, line 
221, in zpublisher_exception_hook
 (Object: Traversable)
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 171, in publish
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/mapply.py, 
line 160, in mapply
 (Object: test2)
   File /opt/Zope-2.3.0b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 112, in call_object
 (Object: test2)
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Shared/DC/Scripts/Bindings.py, 
line 325, in __call__
 (Object: test2)
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Shared/DC/Scripts/Bindings.py, 
line 354, in _bindAndExec
 (Object: test2)
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Products/PythonScripts/PythonScript.py, 
line 330, in _exec
 (Object: test2)
 (Info: ({'script': PythonScript instance at 8894938, 'context': 
Folder instance at 88096c8, 'container': Folder instance at 
88096c8, 'traverse_subpath': []}, (), {}, None))
   File Script (Python), line 2, in test2
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Products/PythonScripts/Guarded.py, 
line 273, in __getattr__
   File 
/opt/Zope-2.3.0b2-linux2-x86/lib/python/Products/PythonScripts/Guarded.py, 
line 143, in __careful_getattr__
 (Object: Traversable)
AttributeError: (see above)
-- 
Itai Tavor"Je sautille, donc je suis."
C3Works[EMAIL PROTECTED]  - Kermit the Frog

"If you haven't got your health, you haven't got anything"


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




[Zope] Re: patch for python configure for freeBSD and Zope

2001-01-21 Thread Chris Watson


 No reason except that I have an install script for python, zope, and modules
 (including configuration) for both that I "know" form a stable environment on
 our production servers, whether linux, or freeBSD.  I should try the ports
 distribution and run my unit tests to perhaps build a more likely to be
 stable freeBSD installer for our work.

That would be a good idea. Try that and let me know if your tests
work. People go to alot of trouble to make a port. It makes little sense
to re-invent the wheel especially with ports. If your tests fail let me
know where and how and I will see about getting the maintainer of the
offending port to ensure it works with your tests and application.

--
=
-Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
Work:  [EMAIL PROTECTED] | Open Systems Inc., Wellington, Kansas
Home:  [EMAIL PROTECTED] | http://open-systems.net
=
WINDOWS: "Where do you want to go today?"
LINUX: "Where do you want to go tomorrow?"
BSD: "Are you guys coming or what?"
=
GNU = Gnu's Non-portable  Unstable
irc.openprojects.net #FreeBSD -Join the revolution!
ICQ: 20016186


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




[Zope] Source to www.zope.org

2001-01-21 Thread Gerald Gutierrez


Is the source code to www.zope.org available somewhere?

It would certainly be an interesting example of how to build a large web 
site with Zope.


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




[Zope] Login Form / User Registration Code Snippets

2001-01-21 Thread Gerald Gutierrez


I remember that someone, somewhere, has a document with code snippets to do 
authentication and registration of users through forms, much like how 
www.zope.org does it. Does anyone know where this is?

Thanks


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




Re: [Zope] Source to www.zope.org

2001-01-21 Thread Timothy Wilson

On Sun, 21 Jan 2001, Gerald Gutierrez wrote:

 Is the source code to www.zope.org available somewhere?

At the bottom of the page there's a link called "View Source" which will
give you the original DTML. You can tack 'view_source' onto the end of any
www.zope.org URL to see how it was built.

You're right. It's very handy.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


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




[Zope] [python] creating variable names by adding 2 strings?

2001-01-21 Thread Lee

Hi there,

I'm creating variables in python but I am having trouble creating them
when they're *named* using other variables. Here's an example;

while (p!=0):
p+`p`= string.replace(component[control], ",", "") 
# e.g. I want 'p1 = string.replace.blah...'
p=p-1
control=control+1

== SyntaxError: can't assign to operator :(

I've tried various things but I cannot find a solution. I've got a nasty
feeling that it's not possible...

If someone could confirm this or hopefully, tell me how to do it I would
be_extremely_grateful.

Thanks,

Lee (crossing his fingers)


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




Re: [Zope] Source to www.zope.org

2001-01-21 Thread J. Atwood

Also check out the About Zope.org link on the home page.

http://www.zope.org/About

There is a lot of good stuff there!

J

At 4:39 PM -0800 1/21/01, Gerald Gutierrez wrote:
Is the source code to www.zope.org available somewhere?

It would certainly be an interesting example of how to build a large 
web site with Zope.


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


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




Re: [Zope] ZOPE and PHP - possible or not ?

2001-01-21 Thread J. Atwood

A lot came up with you just put 'PHP' in the Zope.org search box. 
Here are the best.

http://www.zope.org/Members/Mamey/PHP

http://www.zope.org/Members/Ioan/PHPObject

J



At 7:18 PM +0100 1/21/01, Greg Nowak wrote:
Hi!

How do I combine the PHP code with ZOPE ?

How to tell Apache to parse the PHP code ?
Where do I find info ?

Best regards,
Greg



--
BEZPLATNE konto e-mail o adresie [EMAIL PROTECTED] i NIELIMITOWANEJ pojemnosci
Tylko w POLAND.COM ! www.poland.com

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


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




Re: [Zope] Adding to an XMLDocument through web forms

2001-01-21 Thread J. Cameron Cooper

 I`m looking for a way to give a user the ability to add new data to an
 XMLDocument through web forms, does anyone have experience of this or would
 be able to point me in the direction of an example or howto?

I tried to do this before, and it never worked, so I'm probably not of all
that much help, but...

take a look at the Zope Quick Reference, which has the API for XMLDocument.
You should be able to find the methods that add nodes to it. (Presumably the
regular old object methods would work too, but I can't verify that.) If you've
already done that and still don't have it working (like me), perhaps knocking
about the XMLDocument code would help. Last resort, contact the XMLDocument
maintainer: certainly there are test cases for this somewhere if it's
possible.

--jcc
--
"Hwaet! We Gar-Dena   in gear-dagum,
theod-cyninga,   thyrm gefrunon,
hu tha aethelingas   ellen fremedon!"
http://jccooper.brown.rice.edu/



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




Re: [Zope] [python] creating variable names by adding 2 strings?

2001-01-21 Thread Steve Spicklemire


Hi Lee,

   You could use a dictionary for this:

vars = {}

while (p!=0):
vars['p'+`p`] = string.replace(component[control], ",", "") 
p=p-1
control=control+1

then 'vars' will contain keys (e.g., 'p1', 'p2' etc.. ) and corresponding values.

If that's totally not what you want.. a little more context would help. 

;-)

-steve

--

Hi there,

I'm creating variables in python but I am having trouble creating them
when they're *named* using other variables. Here's an example;

while (p!=0):
p+`p`= string.replace(component[control], ",", "") 
# e.g. I want 'p1 = string.replace.blah...'
p=p-1
control=control+1

== SyntaxError: can't assign to operator :(

I've tried various things but I cannot find a solution. I've got a nasty
feeling that it's not possible...

If someone could confirm this or hopefully, tell me how to do it I would
be_extremely_grateful.

Thanks,

Lee (crossing his fingers)


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


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




Re: [Zope] Source to www.zope.org

2001-01-21 Thread Gerald Gutierrez



At the bottom of the page there's a link called "View Source" which will
give you the original DTML. You can tack 'view_source' onto the end of any
www.zope.org URL to see how it was built.

Hi Tim. Yes, I've looked at those sources, but unfortunately, they don't 
provide some of the backend stuff that's not exposed through the browser. 
I'm more interested in those areas. jatwood mentioned www.zope.org/About, 
which is indeed very cool and describes the architecture for www.zope.org, 
but again it doesn't go into the backend code.

I thought that it would be very useful to see how this "demonstrative" web 
site does things.


Gerald.


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




[Zope] dictionaries in python *methods* :-o

2001-01-21 Thread Lee

Thanks, Steve. This'll do nicely ;-) BUT...

For some strange reason the following doesn't work in my Python *method*:

dict = {}
dict["Lee"] = 1

Error:

 Error Type: Python Method Error
 Error Value: Forbidden operation STORE_SUBSCR at line 3! -- ?

Which seems very strange. No matter what I try and store I get the same error.

dic = {'two': 2, 'three': 3}
return dic['two']

The above works fine but when I try and add to it I get the same error. If this is a
simple mistake I'm making then I plead stupidity!!! Can someone tell me how to do
this in my python method? I've tested all my code in IDLE and it works fine - why not
in Zope?

Answers on a postcard to the usual address!

Thanks very much, guys.

- Best regards,

Lee

Steve Spicklemire wrote:

 Hi Lee,

You could use a dictionary for this:

 vars = {}

 while (p!=0):
 vars['p'+`p`] = string.replace(component[control], ",", "")
 p=p-1
 control=control+1

 then 'vars' will contain keys (e.g., 'p1', 'p2' etc.. ) and corresponding values.

 If that's totally not what you want.. a little more context would help.

 ;-)

 -steve





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




[Zope] Re: dictionaries in python *methods* :-o

2001-01-21 Thread Lee

Okay, I figured it out.

- Silly Lee


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