Re: [Zope-dev] Playing with DateTime

2001-03-16 Thread Juan David Ibáñez Palomar



Hello Stefano,

I used mxDateTime about two years ago, when I worked with Bobo, the
move to Zope brought lots of advantages, the only thing I missed was
mxDateTime.

The discussion about DateTime comes to the mailing lists between time
to time, you can look what has already been said about it in the
archives, for example:

  http://lists.zope.org/pipermail/zope/2000-May/108798.html
  http://lists.zope.org/pipermail/zope/2000-September/118269.html

Yes, switching to mxDateTime would require a lot of work in Zope and
also would break lots of products and web sites, while patching DateTime
is a more quick(dirty) solution.

IMHO there're no good arguments against reusing a so good piece of code,
in the long term at least; mxDateTime is the standard in the python
community, only zopers use something else; and it's free software: if
the original developer does not support it anymore others can do it.

But I understant that if you only want to fix something it's more
quick to patch DateTime.


best regards,
jdavid

___
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] Ri:Zope-Dev digest, Vol 1 #990 - 15 msgs

2001-03-16 Thread [EMAIL PROTECTED]

Hello Juan

well, the idea behind me was to do something that anybody can use actually.if I 
crack the DateTime module for a quick and dirty, then nobody will benefit from it, and 
I will have to take care of it in future releases. I was however thinking on two 
possible solutions:

- creating a DateTime class preserving the actual interface while wrapping around 
mxDateTime
- pathing the actual one.

I will study mxDateTime and think about it.

Somebody would like to help me, by the way?

Regards
Stefano

 Message: 15
 Subject: Re: [Zope-dev] Playing with DateTime
 To: [EMAIL PROTECTED]
 Date: Fri, 16 Mar 2001 10:43:57 +0100 (MET)
 From: [EMAIL PROTECTED] (Juan David Ibáñez Palomar)



 Hello Stefano,

 I used mxDateTime about two years ago, when I worked with Bobo, the
 move to Zope brought lots of advantages, the only thing I missed was
 mxDateTime.

 The discussion about DateTime comes to the mailing lists between time
 to time, you can look what has already been said about it in the
 archives, for example:

   http://lists.zope.org/pipermail/zope/2000-May/108798.html
   http://lists.zope.org/pipermail/zope/2000-September/118269.html

 Yes, switching to mxDateTime would require a lot of work in Zope and
 also would break lots of products and web sites, while patching DateTime
 is a more quick(dirty) solution.

 IMHO there're no good arguments against reusing a so good piece of code,
 in the long term at least; mxDateTime is the standard in the python
 community, only zopers use something else; and it's free software: if
 the original developer does not support it anymore others can do it.

 But I understant that if you only want to fix something it's more
 quick to patch DateTime.


 best regards,
 jdavid



 --__--__--

 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev

 (To receive general Zope announcements, see:
 http://lists.zope.org/mailman/listinfo/zope-announce

 For non-developer, user-level issues,
 [EMAIL PROTECTED], http://lists.zope.org/mailman/listinfo/zope )

 End of Zope-Dev Digest



___
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] getPhysicalPath?

2001-03-16 Thread Tom Jenkins

 
 Is there a simple method like getAcquistionPath() that tells me how I was
 required without having to do some sub optimal REQUEST variable hacking /
 string matching?
 

I don't know of any (but that doesn't mean there isn't one).  But 
couldn't you walk up the aq_parent?

-- 
Tom Jenkins
devIS - Development Infostructure
http://www.devis.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 )



[Zope-dev] ZCatalog Bug?

2001-03-16 Thread Edmund Goppelt

The bug collector doesn't appear to be working, so I apologize if this
issue has already been raised.

ZCatalog is failing for me when I attempt to reindex the catalog after
adding a keyword index.  Zope complains of a name error for Except
on line 118 of UnKeywordIndex.py.  Here's the code in question:

# First we need to see if there's anything interesting to look at
# self.id is the name of the index, which is also the name of the
# attribute we're interested in.  If the attribute is callable,
# we'll do so.
try:
newKeywords = getattr(obj, self.id)
if callable(newKeywords):
newKeywords = newKeywords()
except Except:   #  Line 118
newKeywords = MV

Could the author have meant to write 'Exception' here instead of 'Except'?

I am running Zope 2.3.0 stable.  

-- 

Ed Goppelt

___
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 Bug?

2001-03-16 Thread Toby Dickenson

On Fri, 16 Mar 2001 08:48:09 -0500, Edmund Goppelt
[EMAIL PROTECTED] wrote:

Could the author have meant to write 'Exception' here instead of 'Except'?

I am running Zope 2.3.0 stable.  

The current cvs has this changed to 'except AttributeError'


Toby Dickenson
[EMAIL PROTECTED]

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



RE: [Zope-dev] getPhysicalPath?

2001-03-16 Thread Brian Lloyd

  Is there a simple method like getAcquistionPath() that tells 
 me how I was
  required without having to do some sub optimal REQUEST 
 variable hacking /
  string matching?
  
 
 I don't know of any (but that doesn't mean there isn't one).  But 
 couldn't you walk up the aq_parent?

Acquisition tip-o-the-day: you can use:

print object.aq_chain

The aq_chain attribute (computed at time of access) provides 
a list (in reverse order) of the objects in the acquisition 
path.

Hope this helps!


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 )



[Zope-dev] (no subject)

2001-03-16 Thread Menno Brandsen


I have a question regarding images in a MySQL Database

I'm trying to insert (and retrieve) images into a mysql database I use a
standard upload form and a normal insert statement in the sql.
The output i get is this : ZPublisher.HTTPRequest.FileUpload instance at
86550c8 which is clearly not the correct data

Can someone help me out with this, i need to get the data from the image in
some sort of way, but i dont know how to do this !


Friendly greetings,
Menno Brandsen



0-o
| M. Brandsen |
| Parkstraat 20   |
| 2517 JK |
| Den Haag|
| +31(0)70-3108950 0-o
| [EMAIL PROTECTED]   | |
|  | Your mouse has moved.   |
0--|   Windows has to reboot for |
   | changes to take effect. |
   | |
   | [ OK ]  |
   | |
   0-0



___
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] Playing with DateTime

2001-03-16 Thread Casey Duncan

"[EMAIL PROTECTED]" wrote:
 
 Hello
 
 I am playing around with the DateTime module in order to adapt it to other formats 
than the American one. However, I would like not to start a work that someone is 
already doing or that is already done. I have found a little patch that solves 
temporarily the problem, but I would like to do something more definitive.
 
 However, I need to be careful due to the large use that is done internally by Zope. 
To whom can I get in touch regarding this issue?
 
 Best regards
 Stefano Vedovelli
 

IMHO, the best approach would be to make mxDateTime available separately
from DateTime in the _ variable. That would avoid breaking any code, but
allow anyone who wanted to use mxDateTime that option from within Zope.

I think a product that adds mxDateTime to the _ variable would be your
best bet.

My $.02
-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`--

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



[Zope-dev] ZPT trials and tribulations

2001-03-16 Thread Phil Harris

All,

I'm in the process of trying out the ZPT stuff(thanks to Duncan Booth for
the win32 stuff).

Anyway up, It's all going according to plan but I have a few issues, maybe
someone has a better idea than me what's wrong here.

code starts here

?xml version="1.0" ?
html xmlns:tal="http://xml.zope.org/namespaces/tal"
  xmlns:metal="http://xml.zope.org/namespaces/metal"
  head
title tal:insert="here/title"The title/title
  /head
  body
h2 tal:insert="here/title_or_id"the title/h2
div tal:define="ui python:container.userInfo()"
  b tal:replace="python:ui['dn']"crap/b
  b tal:replace="python:ui['sn']"crap/b
  b tal:replace="python:ui['cn']"crap/b
/div
hr /
a href="index_html"click here to refresh/a

  /body
/html

/code ends here

The problem is that I'm getting a traceback (I won't bore you with the
details unless I have to) to the effect of 'ui' being unknown.

If I replace the 'div' in the code above with:

b tal:replace="python:container.userInfo()['dn']"crap/b
b tal:replace="python:container.userInfo()['sn']"crap/b
b tal:replace="python:container.userInfo()['cn']"crap/b

then all works according to design, but with a lot more overhead.

btw, the userInfo method returns a dictionary of LDAP information, it works
in all other contexts, so I don't think the problem is there.

Anyone got any ideas?

Phil
[EMAIL PROTECTED]




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



Re: [Zope-dev] ZPT trials and tribulations

2001-03-16 Thread Evan Simpson

From: "Phil Harris" [EMAIL PROTECTED]
 The problem is that I'm getting a traceback (I won't bore you with the
 details unless I have to) to the effect of 'ui' being unknown.

Mmph.  That release has a problem with exposing TAL variables to Python
code.  There will be a *much* better one Real Soon Now.

Cheers,

Evan @ digicool


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



Re: [Zope-dev] getPhysicalPath?

2001-03-16 Thread Christian Scholz

Hi!

 Ahh... thanks Brian. Thats a new one to me :)

To me, aswell. Is this documented somewhere? ;-)

And can someone explain to us where the differences between
aq_chain and getPhysicalPath() are? Actually getPhysicalPath()
seems also to walk up aq_parent. Or am I missing something?

regards,
  Christian
  

 
  The aq_chain attribute (computed at time of access) provides 
  a list (in reverse order) of the objects in the acquisition 
  path.
  
  Hope this helps!
  
  
  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 )
  
 
 
 
 ___
 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 )

-- 
COM.lounge  http://comlounge.net/
communication  design [EMAIL PROTECTED]

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



Re: [Zope-dev] Playing with DateTime

2001-03-16 Thread Christian Scholz

Hi!

 IMHO, the best approach would be to make mxDateTime available separately
 from DateTime in the _ variable. That would avoid breaking any code, but
 allow anyone who wanted to use mxDateTime that option from within Zope.
 
 I think a product that adds mxDateTime to the _ variable would be your
 best bet.

Well, my opinion, too. On the long run this might get the preferred way of
dealing with time stuff so that the use of DateTime gets depreceated. But
I guess DC needs to decide this.. I also dunno if there are any problems
with mxDateTime being used (e.g. security concerns, whatever) as I havent't
looked to closely at this.

-- christian

--
COM.lounge  http://comlounge.net/
communication  design [EMAIL PROTECTED]


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



RE: [Zope-dev] Playing with DateTime

2001-03-16 Thread Brian Lloyd

  IMHO, the best approach would be to make mxDateTime available separately
  from DateTime in the _ variable. That would avoid breaking any code, but
  allow anyone who wanted to use mxDateTime that option from within Zope.
 
  I think a product that adds mxDateTime to the _ variable would be your
  best bet.

 Well, my opinion, too. On the long run this might get the preferred way of
 dealing with time stuff so that the use of DateTime gets depreceated. But
 I guess DC needs to decide this.. I also dunno if there are any problems
 with mxDateTime being used (e.g. security concerns, whatever) as
 I havent't
 looked to closely at this.

Note the "DC needs to decide..." only applies to what we
decide to integrate (and thus sign up to maintain, at some
level) into the core. One of the key goals of our long-term
strategy of becoming much more component-oriented is that
the "marketplace" (aka the community) decides what the best
component is for a given task.

And we do not have to wait for the full component story to
land for this to happen; as noted, I'm sure someone could
come up with a product that "componentizes" mxDateTime in
some way so that people who prefer it can use it easily.

Time and de facto usage would then tell whether we (DC) should
consider some sort of transition - and we can learn whether
that would be a good idea without inconveniencing those who
prefer to continue using the built-in DateTime in the meantime.



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 )



[Zope-dev] ZODB Couldn't load state (Berkeley DB 2..7.7)

2001-03-16 Thread Ping Lau

I have been using Berkeley DB 2.7.7 as main Zope Storage for about 3 months
now.  I am running Zope 2.2.4.  Everything was fine yesterday.  This morning
I tried to access a ZClass (base class ZObjectManager), which contains about
2,000 objects, I got

ERROR(200) ZODB Couldn't load state for '\000\000\000\000\000\000\026\351'
Traceback (innermost last):
File /usr/local/zope/2-2/lib/python/ZODB/Connection.py, line 448, in
setstate cPickle.UnpicklingError: invalid load key, ''.

Other than this ZClass, I can access other objects just fine.  I tried Ty's
tranalyzer.  But it gave me "error: Not a .fs file (at least, not a kind I
know about)".

How can I recover the 2,000 objects?

Regards,
Ping


___
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] getPhysicalPath?

2001-03-16 Thread Brian Lloyd

 To me, aswell. Is this documented somewhere? ;-)

It's not in the Acquisition.stx in the ExtensionClass docs - 
probably they were never updated when it was added. I think 
that aq_chain is most useful as a debugging aid rather than 
something one would use in an application (which is not to 
say that it shouldn't be documented). It would be a good idea 
to add this to the Collector as a documentation issue.


 And can someone explain to us where the differences between
 aq_chain and getPhysicalPath() are? Actually getPhysicalPath()
 seems also to walk up aq_parent. Or am I missing something?

The sequence returned by aq_chain is the actual chain of 
'acquisition contexts', or the 'access path' rather than 
the actual containment path. For example, given the object 
hierarchy:

app
  FolderA
index_html
  FolderB

If you say: ob = app.FolderA.FolderB.FolderA.index_html
then the aq_chain will be:

[index_html, FolderA, FolderB, FolderA, app]

This list is created by basically taking the 'aq_parent' of 
each object from 'ob' on up until there are no more aq_parents.

The actual *containment* path is different; in our example 
the containment path would be: 

[index_html, FolderA, app]

To derive the containment path, instead of just walking up 
the aq_parents you have to take the aq_inner (to get the 
innermost wrapping of the object) for each object and then 
take the aq_parent of that. For example (not tested, but 
should work):

def containment_chain(object):
  # return a list similar to aq_chain, but consisting
  # only of the actual containment path.
  result = []
  result.append(object)
  while hasattr(object, 'aq_inner'):
  innermost_wrapping = object.aq_inner
  true_parent = innermost_wrapping.aq_parent
  result.append(true_parent)
  object = true_parent
  return result

Hope this helps!

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] getPhysicalPath?

2001-03-16 Thread Evan Simpson

From: "Christian Scholz" [EMAIL PROTECTED]
 And can someone explain to us where the differences between
 aq_chain and getPhysicalPath() are? Actually getPhysicalPath()
 seems also to walk up aq_parent. Or am I missing something?

"aq_chain" gives you a list of the objects traversed to get to your object,
in reverse order.

"getPhysicalPath" gives you a tuple of the Ids of all objects on the
shortest path from the root to your object.

So, given a hierarchy like this:

A__B__C
|_D
|_E

Object C has physical path ('', 'A', 'B', 'C') no matter how you get to it.
Its acquisition chain, on the other hand, depends completely on the path you
use to access it:

A/B/C = [C, B, A]
A/D/B/C = [C, B, D, A]
A/B/D/E/C = [C, E, D, B, A]

*WARNING*: "aq_chain" does *not* tell you the order in which acquisition
will search the objects.  That is more complicated.

Cheers,

Evan @ digicool


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



[Zope-dev] New Zcatalog bug on b2?

2001-03-16 Thread Júlio Dinis Silva

When passing in the REQUEST the var sort_on into the
searchREsults method I get this error:

Zope Errorr

Zope has encountered an error while publishing this resource.

Error Type: TypeError
Error Value: len() of unsized object

With this traceback:

Traceback (innermost last):
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 223, in publish_module
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 187, in publish
  File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Zope/__init__.py, 
line 221, in zpublisher_exception_hook
(Object: Traversable)
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 171, in publish
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/mapply.py, line 
160, in mapply
(Object: executeSearch)
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 112, in call_object
(Object: executeSearch)
  File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/OFS/DTMLMethod.py, 
line 189, in __call__
(Object: executeSearch)
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_String.py, 
line 538, in __call__
(Object: executeSearch)
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_Let.py, 
line 146, in render
(Object: Results="Catalog(REQUEST=REQUEST)")
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_Util.py, 
line 334, in eval
(Object: Catalog(REQUEST=REQUEST))
(Info: REQUEST)
  File string, line 0, in ?
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/ZCatalog.py, 
line 530, in searchResults
(Object: Traversable)
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/Catalog.py, 
line 654, in searchResults
  File 
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/Catalog.py, 
line 591, in _indexedSearch
TypeError: (see above)









_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] ZODB Couldn't load state (Berkeley DB 2..7.7)

2001-03-16 Thread Chris McDonough

Ping... eek.  Do you have a backup?  There are no recovery utilities for
BerkeleyStorage AFIAK.

- Original Message -
From: "Ping Lau" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 17, 2001 3:55 AM
Subject: [Zope-dev] ZODB Couldn't load state (Berkeley DB 2..7.7)


 I have been using Berkeley DB 2.7.7 as main Zope Storage for about 3
months
 now.  I am running Zope 2.2.4.  Everything was fine yesterday.  This
morning
 I tried to access a ZClass (base class ZObjectManager), which contains
about
 2,000 objects, I got

 ERROR(200) ZODB Couldn't load state for '\000\000\000\000\000\000\026\351'
 Traceback (innermost last):
 File /usr/local/zope/2-2/lib/python/ZODB/Connection.py, line 448, in
 setstate cPickle.UnpicklingError: invalid load key, ''.

 Other than this ZClass, I can access other objects just fine.  I tried
Ty's
 tranalyzer.  But it gave me "error: Not a .fs file (at least, not a kind I
 know about)".

 How can I recover the 2,000 objects?

 Regards,
 Ping


 ___
 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] New Zcatalog bug on b2?

2001-03-16 Thread Chris McDonough

Julio,

Can you give us the actual index names that you're putting in the request to
search against, the query values you're passing in to each index, and the
contents of the sort_on parameter for that request?  What kinds of indexes
are referred to by each of the index names in the query?

- Original Message -
From: "Júlio Dinis Silva" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 16, 2001 2:28 PM
Subject: [Zope-dev] New Zcatalog bug on b2?


 When passing in the REQUEST the var sort_on into the
 searchREsults method I get this error:

 Zope Errorr

 Zope has encountered an error while publishing this resource.

 Error Type: TypeError
 Error Value: len() of unsized object

 With this traceback:

 Traceback (innermost last):
   File
 /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py,
 line 223, in publish_module
   File
 /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py,
 line 187, in publish
   File /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Zope/__init__.py,
 line 221, in zpublisher_exception_hook
 (Object: Traversable)
   File
 /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py,
 line 171, in publish
   File
 /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/mapply.py,
line
 160, in mapply
 (Object: executeSearch)
   File
 /usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/ZPublisher/Publish.py,
 line 112, in call_object
 (Object: executeSearch)
   File
/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/OFS/DTMLMethod.py,
 line 189, in __call__
 (Object: executeSearch)
   File

/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_String
.py,
 line 538, in __call__
 (Object: executeSearch)
   File

/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_Let.py
,
 line 146, in render
 (Object: Results="Catalog(REQUEST=REQUEST)")
   File

/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/DocumentTemplate/DT_Util.p
y,
 line 334, in eval
 (Object: Catalog(REQUEST=REQUEST))
 (Info: REQUEST)
   File string, line 0, in ?
   File

/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/ZCatalog
.py,
 line 530, in searchResults
 (Object: Traversable)
   File

/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/Catalog.
py,
 line 654, in searchResults
   File

/usr/local/src/Zope-2.3.1b2-linux2-x86/lib/python/Products/ZCatalog/Catalog.
py,
 line 591, in _indexedSearch
 TypeError: (see above)









 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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 )



___
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] Organizing modules in a python product

2001-03-16 Thread Dieter Maurer

Itai Tavor writes:
  ... abbreviated references to sibling subproducts ...
  Is there any way to set this up so imports like 'import Utils' and 
  'import Module2' would work in Module1? As a bonus, can I also get 
  __init__.py files in each module directory to be executed?
You can manipulate (extend) "sys.path" in your (top level)
"__init__.py" file. Python starts its package/module lookup
from the elements in "sys.path".

However, I doubt very much, that you should do this!
You will lose the namespace isolation provided by packages.



Dieter

___
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] (no subject)

2001-03-16 Thread Dieter Maurer

Menno Brandsen writes:
  I'm trying to insert (and retrieve) images into a mysql database I use a
  standard upload form and a normal insert statement in the sql.
  The output i get is this : ZPublisher.HTTPRequest.FileUpload instance at
  86550c8 which is clearly not the correct data
To get the file content, you call the object's "read" method:

   dtml-sqlvar "uploadImage.read()" type=string


Dieter

___
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] [ANN] LDAPUserManager Released

2001-03-16 Thread Jens Vagelpohl

The LDAPUserManager is a LDAP user record administration tool to be used in
conjunction with the LDAPLoginAdapter.

It allows the site manager to search, create, edit and delete user records
that are stored on an LDAP server, thereby completing the Zope user
management functionality already offered by the LDAPLoginAdapter.

You can view some of the documentation and download the software at
http://www.dataflake.org/software/ldapusermanager/.

The LDAPLoginAdapter, now at 1.0beta3, can be found at
http://www.dataflake.org/software/ldaploginadapter/.

A Tracker at that same address allows you to easily file bug reports or
feature requests for this product.

jens



___
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] ZPT trials and tribulations

2001-03-16 Thread Martijn Pieters

On Fri, Mar 16, 2001 at 04:59:16PM -, Phil Harris wrote:
 All,
 
 I'm in the process of trying out the ZPT stuff(thanks to Duncan Booth for
 the win32 stuff).
 
 Anyway up, It's all going according to plan but I have a few issues, maybe
 someone has a better idea than me what's wrong here.
 
 code starts here
 
 ?xml version="1.0" ?
 html xmlns:tal="http://xml.zope.org/namespaces/tal"
   xmlns:metal="http://xml.zope.org/namespaces/metal"
   head
 title tal:insert="here/title"The title/title
   /head
   body
 h2 tal:insert="here/title_or_id"the title/h2
 div tal:define="ui python:container.userInfo()"
   b tal:replace="python:ui['dn']"crap/b
   b tal:replace="python:ui['sn']"crap/b
   b tal:replace="python:ui['cn']"crap/b
 /div
 hr /
 a href="index_html"click here to refresh/a
 
   /body
 /html
 
 /code ends here
 
 The problem is that I'm getting a traceback (I won't bore you with the
 details unless I have to) to the effect of 'ui' being unknown.
 
 If I replace the 'div' in the code above with:
 
 b tal:replace="python:container.userInfo()['dn']"crap/b
 b tal:replace="python:container.userInfo()['sn']"crap/b
 b tal:replace="python:container.userInfo()['cn']"crap/b
 
 then all works according to design, but with a lot more overhead.
 
 btw, the userInfo method returns a dictionary of LDAP information, it works
 in all other contexts, so I don't think the problem is there.

As Ethan said, the release you are using doesn't yet support access to
defined variables in python.

Instead, try the following:

  div tal:define="ui python:container.userInfo()"
b tal:replace="ui/dn"crap/b
b tal:replace="ui/sn"crap/b
b tal:replace="ui/cn"crap/b
  /div

It will be much more readable, and it removes a layer of interpretation
too.

-- 
Martijn Pieters
| Software Engineer  mailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
-

___
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] Playing with DateTime

2001-03-16 Thread Juan David Ibáñez Palomar



Hello,

Of course, we already can use mxDateTime in our own products. But
there is a problem, both modules have the same name, if you write
"import DateTime" you get the Zope's DateTime module.

A solution is to rename the mxDateTime module directory from
DateTime to, for example, mxDateTime, then use "import mxDateTime"
and everything is fine. Unfortunetaly this could break other
python programs.

I've played for several hours with imp, __import__, sys, etc.. 
but haven't been able to import mxDateTime as it's installed.
If somebody knows how to do it please let me know.

We also could build a python product (a Zope component as Brian
suggests), it would be just a copy of mxDateTime. This is not very
elegant because you could need two copies of mxDateTime, one for
the Zope and one for other python programs. And it wouldn't be so
easy to install because mxDateTime has C code that needs to be
compiled.


Another posibility is to use a symbolic link:

  $ cd INSTANCE_HOME/Products
  $ ln -s wherever the mxDateTime module is mxDateTime

And then use "from Products import mxDateTime". Windows users
still would need to copy the directory.

The (small) problem with this solution is that requires some
work of the user/admin that would be nice to avoid.

The following code automates the creation of the sym. link:

  import imp, os, string, sys
  filename = os.path.join(INSTANCE_HOME, 'Products', 'mxDateTime')
  if not os.path.isdir(filename):
  ## Find the path to the mxDateTime module
  path = filter(lambda x, find=string.find: find(x, 'zope') == -1, sys.path)
  file, pathname, description = imp.find_module('DateTime', path)
  ## Create the symlink
  os.symlink(pathname, filename)

  from Products import mxDateTime


But I still don't like this solution. If somebody comes to something better
please let me know. Improvements to that code are also very welcomed, I want
to use mxDateTime for the upcomoing new version of the CalendarTag.

Also, perhaps DC could do something to avoid the name conflict for a future
Zope release, :)


best regards,
jdavid


 
 Note the "DC needs to decide..." only applies to what we
 decide to integrate (and thus sign up to maintain, at some
 level) into the core. One of the key goals of our long-term
 strategy of becoming much more component-oriented is that
 the "marketplace" (aka the community) decides what the best
 component is for a given task.
 
 And we do not have to wait for the full component story to
 land for this to happen; as noted, I'm sure someone could
 come up with a product that "componentizes" mxDateTime in
 some way so that people who prefer it can use it easily.
 
 Time and de facto usage would then tell whether we (DC) should
 consider some sort of transition - and we can learn whether
 that would be a good idea without inconveniencing those who
 prefer to continue using the built-in DateTime in the meantime.
 
 
 
 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 )



[Zope-dev] Adding ZClass Instances via Python

2001-03-16 Thread Edmund Goppelt

Ok, I know there's a howto with a working solution to this problem,
but this is *still* killing me:

How does one add a ZClass Instance in a way analagous to adding, say,
a DTML Document in a Python script?

With the dtml document, it's easy:

container.manage_addProduct['OFSP'].addDTMLDocument('anid', 'atitle','a file')

I've tried the following, which don't work, as well as a variety of
permutations and combinations involving container  context.

constructor.Bill_add(None, context)
constructor.Bill_add(container, cons, REQUEST)

# Is this how one sets the REQUEST variable from a script?  Can the
# REQUEST variable be set from any valid Zope object, e.g,:
# Anywhere.Anyobject.REQUEST.set('dfkjd', 123) will change the
# variable dfkjd in the REQUEST object?

container.REQUEST.set('id', '9389483484') 
container.REQUEST.set('title', 'a title')
constructor=container.manage_addProduct['Bill']

The problem seems to have something to do with the getting the
contexts right and getting the REQUEST info. passed to the
constructor, but I'm just guessing at this point.

Bill_add is the standard dtml method constructor created by the ZClass product.

-- 

Ed Goppelt

___
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] Adding ZClass Instances via Python

2001-03-16 Thread Casey Duncan

Edmund Goppelt wrote:
 
 Ok, I know there's a howto with a working solution to this problem,
 but this is *still* killing me:
 
 How does one add a ZClass Instance in a way analagous to adding, say,
 a DTML Document in a Python script?
 
 With the dtml document, it's easy:
 
 container.manage_addProduct['OFSP'].addDTMLDocument('anid', 'atitle','a file')
 
 I've tried the following, which don't work, as well as a variety of
 permutations and combinations involving container  context.
 
 constructor.Bill_add(None, context)
 constructor.Bill_add(container, cons, REQUEST)
 
 # Is this how one sets the REQUEST variable from a script?  Can the
 # REQUEST variable be set from any valid Zope object, e.g,:
 # Anywhere.Anyobject.REQUEST.set('dfkjd', 123) will change the
 # variable dfkjd in the REQUEST object?
 
 container.REQUEST.set('id', '9389483484')
 container.REQUEST.set('title', 'a title')
 constructor=container.manage_addProduct['Bill']
 
 The problem seems to have something to do with the getting the
 contexts right and getting the REQUEST info. passed to the
 constructor, but I'm just guessing at this point.
 
 Bill_add is the standard dtml method constructor created by the ZClass product.
 

self = self.this()
ob = self.Control_Panel.Products.SomeProduct.SomeZClass(id)
ob._setId(id)
...Other inits such as property sheets, etc...
self._setObject(id, ob)

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

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



Re: [Zope-dev] (no subject)

2001-03-16 Thread Gregor Heine

Hi Menno,

what you get from the form is a FileUpload object, so try this:
print file.__dict__
and you will find out that it has a method called
file.read()
which returns the data of the uploaded file.

Cheers,

Gregor!


-Original Message-
From: "Menno Brandsen" [EMAIL PROTECTED] 
To: [EMAIL PROTECTED] 
Date: Fri, 16 Mar 2001 03:46:45 +0100 
Subject: [Zope-dev] (no subject) 



I have a question regarding images in a MySQL Database 

I'm trying to insert (and retrieve) images into a mysql database I use a 
standard upload form and a normal insert statement in the sql. 
The output i get is this : ZPublisher.HTTPRequest.FileUpload instance at 
86550c8 which is clearly not the correct data 

Can someone help me out with this, i need to get the data from the image in 
some sort of way, but i dont know how to do this ! 



Friendly greetings, 
Menno Brandsen 

___
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] getPhysicalPath?

2001-03-16 Thread Michel Pelletier



On Fri, 16 Mar 2001, Brian Lloyd wrote:

  To me, aswell. Is this documented somewhere? ;-)

 It's not in the Acquisition.stx in the ExtensionClass docs -
 probably they were never updated when it was added. I think
 that aq_chain is most useful as a debugging aid rather than
 something one would use in an application (which is not to
 say that it shouldn't be documented). It would be a good idea
 to add this to the Collector as a documentation issue.

A better place would be the sourceforge issue tracker for the dev guide:

http://sourceforge.net/projects/zope-devel

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