Re: [Zope-dev] ZCatalog scalability

2001-01-23 Thread Erik Enge

[Michael Bernstein]

| We seem to have disposed of the wildcard issue [snipped out
| below], and I'm looking forward to Eric's results, but does
| anyone else have any information about whether there is a
| practical upper limit on how many objects can be indexed and
| searched in a ZCatalog?

I don't know.  But there is one on BTree folders, right?  And as soon
as those get full, you need to start segment your data (which you
probably would have done in the first place anyway).  Then you can use
several ZCatalogs in different locations (so that they don't carry so
many objects each).  Then create a nice little method that finds out
which (or all) of the ZCatalogs to ask, when users make queries.


___
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] sql methods and the namespace stack

2001-01-23 Thread Chris Withers

Tim McLaughlin wrote:
 
 Does anybody know why sql methods only search the request object instead of
 traversing the dtml namespace stack?

Nope, other than it's been like that for donkey's years...

I guess the idea was that it didn't accidentally get parameters from elsewhere,
which can be an issue, but not only for SQL Methods...

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

2001-01-23 Thread Tres Seaver

[EMAIL PROTECTED] wrote:
 [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...

Please post this as a "Bug w/ patch" to the Collector:

 http://classic.zope.org:8080/Collector

That way we don't lose your fix in the list traffic (losing it
along with our marbles is another problem :)

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   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] ZCatalog scalability

2001-01-23 Thread Erik Enge

[Chris Withers]

| ...and is that specifically for BTree folders, or Zope BTree's in general?

I don't believe that B-Tree folders have those kinds of limitations by
general design.  I'm more conserned that somewhere along the lines,
doing operations on a huge BTree Folder (Yes, in Zope) will be slow.

However, this is more gut-feeling than anything else.

Hm, more over, if you actually need to stuff that many objects into
one Folder, you are probably trying to use the wrong tool for the job.

I do expect that stuffing 27 million objects into one BTree Folder
will be slow, and I don't want to segment the data.  I do expect that
I'll have to resort to a relational database, and I have no problem
with that.  Object databases aren't always the right tool for the job,
and when they aren't, Zope let's me talk with the other ones nicely,
so no problemo seor ;).

___
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 block parsing

2001-01-23 Thread Steve Alexander

Casey Duncan wrote:

 
 If not, I will make a patch for DT_String to support this. The
 beneficial side affect would be that dtml-comment could be "fixed" so
 that its contents need not be parsable anymore, just like every other
 language I know of.

With your patch applied, will nested dtml-comment tags still work?

dtml-comment
   Some code commented out
 dtml-comment
   Documentation in a comment
 /dtml-comment
   Rest of code commented out
/dtml-comment

--
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] Local roles and security of ZClass instances in Specialists

2001-01-23 Thread Steve Spicklemire


Hi Itai,

   I'm sure there's something clever you could do here with
an attribute provider for you user object that supplied
__roles__ dynamically somehow, but I'd need to think
about that more... one easy way to limit who can
see different stuff is to use a wrapper around
your access methods (e.g., SQL queries) that checks for
security:

e.g., 

WITH [ QUERY ] LookupAttributesAndCheckForPermission(REQUEST) COMPUTE foo, bar, baz

where LookupAttributesAndCheckForPermission get's everything it needs out of
the REQUEST.

It's a crude tool.. but it's simple. When I get some time to think clearly.. 
I'll try to come up with something more general. Hopefully you'll also get
some other suggestions... 

-steve
 "Itai" == Itai Tavor [EMAIL PROTECTED] writes:

Itai Hi,

Itai I'm trying to work out a security strategy for data stored
Itai in Specialists, where specific users need access to specific
Itai data instances.

Itai For example: A Customer object is linked to a Person and
Itai Address objects. The customer needs permission to edit the
Itai her - and only her - Address object. Using the Owner local
Itai role won't work, because customers can be registered by site
Itai managers and customer support people, in which case Owner
Itai won't be the customer.

Itai I can solve this by giving the customer a local role when
Itai creating her Address object:

Itai  Customers.addCustomer(REQUEST): ni =
Itai container.addItem(some_id)
Itai container.Addresses.addAddressFor(ni.id, REQUEST)

Itai  Addresses.addAddressFor(for_id, REQUEST): ni =
Itai container.addItem(some_id) ni.manage_addLocalRole(for_id,
Itai 'EditMyDetails')

Itai But this can be a lot of work - If an Address object can
Itai also be created for a CreditCard object, addCreditCard will
Itai have to both set its own local role, and pass the customer
Itai id on to Address...

Itai But the main problem is that I'm not sure if it will work at
Itai all - can local roles be set for DataSkins that aren't
Itai stored in the ZODB?  From what I can see ZPatterns doesn't
Itai support this, so I'll have to do it
Itai myself. __ac_local_roles__ can't be accessed in a SkinScript
Itai - so will I have to override has_local_roles,
Itai get_local_roles and get_local_roles_for_userid and call them
Itai from the SkinScript? This is getting hairy...

Itai Without local roles, all I can think of is explicitly
Itai checking that the logged in user is the right customer in
Itai all the methods that display and edit the object, which is
Itai very ugly. Plus it would require Address to know a
Itai customer_id even when it actually belongs to a CreditCard,
Itai not a Customer... there goes Demeter. Or I can add a
Itai findUserID to Address, CreditCard and Customer, all of which
Itai pass the request upwards until one is reached that actually
Itai knows the customer. Still ugly.

Itai TIA for Any comments/suggestions.

Itai Itai -- Itai Tavor "Je sautille, donc je suis."  C3Works
Itai [EMAIL PROTECTED] - Kermit the Frog

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


Itai ___ Zope-Dev
Itai maillist - [EMAIL PROTECTED]
Itai http://lists.zope.org/mailman/listinfo/zope-dev ** No cross
Itai posts or HTML encoding!  ** (Related lists -
Itai http://lists.zope.org/mailman/listinfo/zope-announce
Itai 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] Local roles and security of ZClass instances in Specialists

2001-01-23 Thread Steve Alexander

Steve Spicklemire wrote:

 
 WITH [ QUERY ] LookupAttributesAndCheckForPermission(REQUEST) COMPUTE foo, bar, baz
 
 where LookupAttributesAndCheckForPermission get's everything it needs out of
 the REQUEST.

You could use

WITH CheckForPermission(REQUEST) and makeQuery() COMPUTE foo, bar, baz

where CheckForPermission returns 1 if the permission is ok, or raises 
unauthorized otherwise.
You might not need to pass in REQUEST if you're using a Python Script.

You could also add in an argument to CheckForPermission that indicates 
the sort of permission to check for.

--
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] Membership and the 2.3 beta2 ... bug in the latter!

2001-01-23 Thread Brian Lloyd

 Not sur ecompletely why yet, but in 2.3b2, I can't move or copy a 
 ZCatalog. There is one in the Membership interface, so as a result, no 
 workie there.
 
 After deleteing int from teh membership interface folder, I get a 
 traceback complaining about too many arguments in checkRoles (3 
 instead of 
 2). I haven't had time to dig into it yet, so I thought I would 
 toss it up 
 here so anyone with visibility to this issue can look at it.

Hi Bill - this was due to a problem that is fixed in CVS
and will be in beta 3 (out late today or tomorrow).

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] DTML block parsing

2001-01-23 Thread Casey Duncan

Steve Alexander wrote:
 With your patch applied, will nested dtml-comment tags still work?
 
 dtml-comment
Some code commented out
  dtml-comment
Documentation in a comment
  /dtml-comment
Rest of code commented out
 /dtml-comment
 
 --
 Steve Alexander
 Software Engineer
 Cat-Box limited
 http://www.cat-box.net

In present form no. It also does not support block continuation tags.

I will see what I can do about this.
-- 
| 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] ZCatalog scalability

2001-01-23 Thread Michael Bernstein

Erik Enge wrote:
 
 [Chris Withers]
 
 | ...and is that specifically for BTree folders, or Zope BTree's in general?
 
 I don't believe that B-Tree folders have those kinds of limitations by
 general design.  I'm more conserned that somewhere along the lines,
 doing operations on a huge BTree Folder (Yes, in Zope) will be slow.

What sort of 'operations' do you mean? copying and pasting
the whole thing?

 Hm, more over, if you actually need to stuff that many objects into
 one Folder, you are probably trying to use the wrong tool for the job.
 
 I do expect that stuffing 27 million objects into one BTree Folder
 will be slow, and I don't want to segment the data.  I do expect that
 I'll have to resort to a relational database, and I have no problem
 with that.  Object databases aren't always the right tool for the job,
 and when they aren't, Zope let's me talk with the other ones nicely,
 so no problemo seor ;).

Eric,

I had separated the storage issue into a different thread
(Specialist/Rack Scalability), and received a reply from
Phillip Eby:

 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 the question I was asking is: "if we ignore the issue of
storage and consider indexing and searching the ZCatalog
alone, and assuming that wildcard searches are disallowed,
how far will a single ZCatalog with a text index (on a
computed attribute that concatenates several properties) and
a keyword index (for creating ZTopic heirarchies) scale?"

While I'm perfectly willing to split up the storage of the
data as neccessary, I am far less enamoured by the prospect
of divvying up the indexing and searching to multiple
ZCatalogs. In any case, according to Phillip, if I don't
have to split the ZCatalog, I shouldn't have to split the
storage (in Racks, anyway, but probably BTree Folders too),
either.

Anyway Eric, I hope that when you report your results,
you're able to separate indexing, searching, storage, and
retreival results, so that the appropriate factor can be
identified as the bottleneck. Or at least into
indexing/searching and storage/retreival.

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-23 Thread Erik Enge

[Michael Bernstein]

| Erik Enge wrote:
|  
|  I don't believe that B-Tree folders have those kinds of limitations by
|  general design.  I'm more conserned that somewhere along the lines,
|  doing operations on a huge BTree Folder (Yes, in Zope) will be slow.
| 
| What sort of 'operations' do you mean? copying and pasting
| the whole thing?

My point was that anything will be slow at some stage.  This is valid
for BTree Folders as well, and doing opertions on the objects
(copying, deleting, modifying), will be slower than adding them, I
guess.  I'm not quite sure here Michael, someone else has probably
more experience and knowledge to answer more correctly.
 
| I had separated the storage issue into a different thread

Oops, I forgot that, sorry.

| Anyway Eric, I hope that when you report your results, you're able
| to separate indexing, searching, storage, and retreival results, so
| that the appropriate factor can be identified as the bottleneck. Or
| at least into indexing/searching and storage/retreival.

Yes, I hope I'll manage to do that.  And till then, I guess we just
have to wait to see how things work in practice, which might be
different to the theory.  ;)


___
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 block parsing

2001-01-23 Thread Casey Duncan

Casey Duncan wrote:
 
 Steve Alexander wrote:
  With your patch applied, will nested dtml-comment tags still work?
 
  dtml-comment
 Some code commented out
   dtml-comment
 Documentation in a comment
   /dtml-comment
 Rest of code commented out
  /dtml-comment
 
  --
  Steve Alexander
  Software Engineer
  Cat-Box limited
  http://www.cat-box.net
 
 In present form no. It also does not support block continuation tags.
 
 I will see what I can do about this.

OK, I have developed a new patch that almost completely fixes this
issue. In fact I am happier with it in general than my first patch.
There is only one flaw, although you can nest comments inside of one
another, and you can have any manner of broken dtml inside, if you open
another comment tag inside it, it must be properly balanced or you will
get a parse error. Here are some examples:

These do not generate errors with my new patch:
dtml-comment
dtml-if blah
/dtml-comment

dtml-comment
/dtml-with
/dtml-comment

dtml-comment
dtml-asdfsadf
/dtml-comment

dtml-comment
dtml-comment
Blah Blah
/dtml-comment
/dtml-comment

These do:

dtml-comment
dtml-comment
/dtml-comment

dtml-comment
dtml-if foo
dtml-comment
/dtml-if
/dtml-comment
/dtml-comment

I am a bit concerned that dtml-comment should ever generate errors at
all, but this is certainly an improvement. Anybody have any thoughts?
-- 
| 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] dtml-in batching

2001-01-23 Thread richard

Tres Seaver wrote:
 
 [EMAIL PROTECTED] wrote:
  [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...
 
 Please post this as a "Bug w/ patch" to the Collector:
 
  http://classic.zope.org:8080/Collector
 
 That way we don't lose your fix in the list traffic (losing it
 along with our marbles is another problem :)

   Someone else responded to the list saying that he'd already done it.
There was no match to my search of dtml-in though, so I've submitted a new
bug report.


  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 )




[Zope-dev] Problem using External Method

2001-01-23 Thread Espen Sorbye Frederiksen

The module below works using the python compiler
class Testclass:
def setdata(self,val1,val2,val3):
self.data = [val1,val2,val3]
def updatedata(self, index):
self.data[index] = self.data[index]+1
def display(self):
print self.data

x = Testclass() 
def createdata():
import __main__
__main__.x.setdata(10, 20, 30)
__main__.x.updateLog(2)
__main__.x.display()

createdata()
[10,20,31]

However if I try to add it as an External Method( id= createdata) it
doesn't
seem to work. I've tried to call it using dtml-var/call createdata
without success. Any suggestions what I do wrong.
I am grateful for all comments,

Espen


___
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-23 Thread Tres Seaver

On Wed, 24 Jan 2001 [EMAIL PROTECTED] wrote:

 Tres Seaver wrote:

  Please post this as a "Bug w/ patch" to the Collector:
  
   http://classic.zope.org:8080/Collector
  
  That way we don't lose your fix in the list traffic (losing it
  along with our marbles is another problem :)
 
 Someone else responded to the list saying that he'd already
 done it.  There was no match to my search of dtml-in though, so
 I've submitted a new bug report.

Thanks very much!

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   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] Problem using External Method

2001-01-23 Thread Chris McDonough

Espen,

The files that external methods actually live in are not Python modules,
like normal Python modules.  Though I haven't tried your example, it's
likely that your reference to __main__ is confusing the external method
machinery.  Additionally, the output of "print" doesn't go to the remote
browser, it instead goes to the console.  You need to return a value to the
caller for it to be displayed on the remote browser.

Try instead (as an example):

class Testclass:
def setdata(self,val1,val2,val3):
self.data = [val1,val2,val3]
def updatedata(self, index):
self.data[index] = self.data[index]+1
def display(self):
print self.data

def createdata():
x = Testclass()
x.setdata(10, 20, 30)
x.updatedata(2)
return x.display()

- Original Message -
From: "Espen Sorbye Frederiksen" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 23, 2001 5:52 PM
Subject: [Zope-dev] "Problem" using External Method


 The module below works using the python compiler
 class Testclass:
 def setdata(self,val1,val2,val3):
 self.data = [val1,val2,val3]
 def updatedata(self, index):
 self.data[index] = self.data[index]+1
 def display(self):
 print self.data

 x = Testclass()
 def createdata():
 import __main__
 __main__.x.setdata(10, 20, 30)
 __main__.x.updateLog(2)
 __main__.x.display()

 createdata()
 [10,20,31]

 However if I try to add it as an External Method( id= createdata) it
 doesn't
 seem to work. I've tried to call it using dtml-var/call createdata
 without success. Any suggestions what I do wrong.
 I am grateful for all comments,

 Espen


 ___
 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] Problem using External Method

2001-01-23 Thread Chris McDonough

Ooops, replace "print self.data" with "return self.data" in the display
method of my Testclass.


- Original Message -
From: "Chris McDonough" [EMAIL PROTECTED]
To: "Espen Sorbye Frederiksen" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, January 23, 2001 6:46 PM
Subject: Re: [Zope-dev] "Problem" using External Method


 Espen,

 The files that external methods actually live in are not Python modules,
 like normal Python modules.  Though I haven't tried your example, it's
 likely that your reference to __main__ is confusing the external method
 machinery.  Additionally, the output of "print" doesn't go to the remote
 browser, it instead goes to the console.  You need to return a value to
the
 caller for it to be displayed on the remote browser.

 Try instead (as an example):

 class Testclass:
 def setdata(self,val1,val2,val3):
 self.data = [val1,val2,val3]
 def updatedata(self, index):
 self.data[index] = self.data[index]+1
 def display(self):
 print self.data

 def createdata():
 x = Testclass()
 x.setdata(10, 20, 30)
 x.updatedata(2)
 return x.display()

 - Original Message -
 From: "Espen Sorbye Frederiksen" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, January 23, 2001 5:52 PM
 Subject: [Zope-dev] "Problem" using External Method


  The module below works using the python compiler
  class Testclass:
  def setdata(self,val1,val2,val3):
  self.data = [val1,val2,val3]
  def updatedata(self, index):
  self.data[index] = self.data[index]+1
  def display(self):
  print self.data
 
  x = Testclass()
  def createdata():
  import __main__
  __main__.x.setdata(10, 20, 30)
  __main__.x.updateLog(2)
  __main__.x.display()
 
  createdata()
  [10,20,31]
 
  However if I try to add it as an External Method( id= createdata) it
  doesn't
  seem to work. I've tried to call it using dtml-var/call createdata
  without success. Any suggestions what I do wrong.
  I am grateful for all comments,
 
  Espen
 
 
  ___
  Zope-Dev maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope )
 
 


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




___
Zope-Dev 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-23 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  That (or rather Image.File) was where I started. I decided to go with
  HTMLFile as a basis so we could have some DTML in the CSS file - but
  overrode it so we weren't forced to have the .dtml extension (much happier
  web designers that way :)
Thus, the only thing, you need to do in addition, is to set
the correct content type.

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

2001-01-23 Thread Brad Clements

On 24 Jan 2001, at 9:43, [EMAIL PROTECTED] wrote:

 Tres Seaver wrote:

  Please post this as a "Bug w/ patch" to the Collector:
  
   http://classic.zope.org:8080/Collector
  
  That way we don't lose your fix in the list traffic (losing it
  along with our marbles is another problem :)
 
Someone else responded to the list saying that he'd already done it.
 There was no match to my search of dtml-in though, so I've submitted a new
 bug report.


I posted this same bug AND a patch as bug # 1566 on Aug 28th, 2000.


http://classic.zope.org:8080/Collector/1566/view

Sad to see its *still* pending



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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-23 Thread richard

Brad Clements wrote:
 On 24 Jan 2001, at 9:43, [EMAIL PROTECTED] wrote:
  Tres Seaver wrote:
 
   Please post this as a "Bug w/ patch" to the Collector:
  
http://classic.zope.org:8080/Collector
  
   That way we don't lose your fix in the list traffic (losing it
   along with our marbles is another problem :)
 
 Someone else responded to the list saying that he'd already done it.
  There was no match to my search of dtml-in though, so I've submitted a new
  bug report.
 
 I posted this same bug AND a patch as bug # 1566 on Aug 28th, 2000.
 
 http://classic.zope.org:8080/Collector/1566/view
 
 Sad to see its *still* pending

Well that's odd - I searched the collector for "dtml-in" and got no
matches. A search for "renderwb" (which is in the title) works. Looks like
it doesn't search the description after all. Boo to the search engine.

Just curious: why specify the browser/platform/python version stuff when
the problem is independant of those things?


Richard

ps. Brad, sorry I referred to you as "someone else" - I lost the email with
your name in it ;)

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

2001-01-23 Thread richard

Dieter Maurer wrote:
 
 [EMAIL PROTECTED] writes:
   That (or rather Image.File) was where I started. I decided to go with
   HTMLFile as a basis so we could have some DTML in the CSS file - but
   overrode it so we weren't forced to have the .dtml extension (much happier
   web designers that way :)
 
 Thus, the only thing, you need to do in addition, is to set
 the correct content type.

   Which is pretty much what I did. I've attached the CSSFile class (which
I suppose I should have done in the first place)...

   I'm not sure if this implementation is entirely "correct" - I have no
idea what the func_code stuff is for (though if it's not commented out, the
class breaks) or the __need_name__... but it works well for us :)


 Richard

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


Re: [Zope-dev] dtml-in batching

2001-01-23 Thread Brad Clements

On 24 Jan 2001, at 11:15, [EMAIL PROTECTED] wrote:


 Brad Clements wrote:

  I posted this same bug AND a patch as bug # 1566 on Aug 28th, 2000.
  
  http://classic.zope.org:8080/Collector/1566/view
  
  Sad to see its *still* pending
 
 Well that's odd - I searched the collector for "dtml-in" and got no
 matches. A search for "renderwb" (which is in the title) works. Looks like
 it doesn't search the description after all. Boo to the search engine.
 
 Just curious: why specify the browser/platform/python version stuff when
 the problem is independant of those things?
 

Because I'm Anal Retentive.

Also figured perhaps my entry would be ignored without that information.

Or worse the form would be rejected on submit because those fields 
where blank AND it wouldn't remember what I'd put in AND back would 
fail.

So, I filled out the form entirely.


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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] Old to new registerClass

2001-01-23 Thread Andy McKay

Im hacking around IEMethod and it uses an old style of class initialisation
in the __init__.py along the lines of:

  misc_ = { 'imagef':'foo','imageg':'goo', }
  lang_= { 'en':'lang_en','sv':'lang_sv', }

I want to put this into a modern style product initialisation
(context.registerClass). Looking at this functions API it didn't become
readily apparent how I can pass in these values. This would be nice to do so
I don't have any hacking of dtml to do. Has anyone done this / got any
advice?

Thanks.

--
  Andy McKay.




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




Re: [Zope-dev] DTML block parsing

2001-01-23 Thread Steve Alexander

Casey Duncan wrote:

 
 OK, I have developed a new patch that almost completely fixes this
 issue. In fact I am happier with it in general than my first patch.
 There is only one flaw, although you can nest comments inside of one
 another, and you can have any manner of broken dtml inside, if you open
 another comment tag inside it, it must be properly balanced or you will
 get a parse error. Here are some examples:

examples removed

 I am a bit concerned that dtml-comment should ever generate errors at
 all, but this is certainly an improvement. Anybody have any thoughts?

I'm very happy with the way you describe the patched tag works. I'll try 
it out when I return from the EuroZope meeting in Amsterdam.

I don't think it is reasonable to try to catch unbalanced dtml-comment 
tags. In fact, I like the fact that it will raise an error if I leave 
them unbalanced.

Thanks.

--
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] Buffer overflow in MySQL 3.23.31

2001-01-23 Thread Ragnar Beer

Howdy!

Just for us MySQL users I'm forwarding this from bugtraq.

Ragnar

Hi,

all versions of MySQL  3.23.31 have a buffer-overflow which crashs the
server and which seems to be exploitable (ie. 4141414 in eip)

Problem :
An attacker could gain mysqld privileges (gaining access to all the
databases)

Requirements :
You need a valid login/password to exploit this

Solution :
Upgrade to 3.23.31

Proof-of-concept code :
None

Credits :
I'm not the discoverer of this bug
The first public report was made by [EMAIL PROTECTED] via the MySQL
mailing-list
See the following mails for details

Regards,
Nicob

Here the original post to the MySQL mailing-list :
==

On Jan 12, Jo?o Gouveia wrote:
  Hi,

  I believe i've found a problem in MySql. Here are some test's i've made in
  3.22.27 x86( also tested on v3.22.32 - latest stable, although i didn't
  debug it, just tested to see if crashes ).Confirmed up to latest 3.23

  On one terminal:
  quote
  spike:/var/mysql # /sbin/init.d/mysql start
  Starting service MySQL.
  Starting mysqld daemon with databases from /var/mysql
  done
  spike:/var/mysql #
/quote

  On the other terminal:
  quote
  jroberto@spike:~  mysql -p -e 'select a.'`perl -e'printf("A"x130)'`'.b'
  Enter password:
  (hanged..^C)
  /quote

  On the first terminal i got:
  quote
  spike:/var/mysql # /usr/bin/safe_mysqld: line 149: 15557 Segmentation fault
  nohup
  $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --skip-lockin
  g "$@" $err_log 21
  Number of processes running now: 0
  mysqld restarted on  Fri Jan 12 07:10:54 WET 2001
  mysqld daemon ended
  /quote

  gdb shows the following:
  quote
  (gdb) run
  Starting program: /usr/sbin/mysqld
  [New Thread 16897 (manager thread)]
  [New Thread 16891 (initial thread)]
  [New Thread 16898]
  /usr/sbin/mysqld: ready for connections
  [New Thread 16916]
  [Switching to Thread 16916]

  Program received signal SIGSEGV, Segmentation fault.
  0x41414141 in ?? ()
  (gdb) info all-registers
  eax0x1  1
  ecx0x68 104
  edx0x8166947135686471
  ebx0x41414141   1094795585
  esp0xbf5ff408   0xbf5ff408
  ebp0x41414141   0x41414141
  esi0x41414141   1094795585
  edi0x0  0
  eip0x41414141   0x41414141
  eflags 0x10246  66118
  cs 0x23 35
  ss 0x2b 43
  ds 0x2b 43
  es 0x2b 43
  fs 0x0  0
  gs 0x0  0
  (gdb)
  /quote

  looks like a tipical overflow to me.
  Please reply asap, at least to tell me i'me not seeing things. :-)
  Best regards,

  Joao Gouveia aka Tharbad.

  [EMAIL PROTECTED]

Here the reponse to a email I send today to the MySQL list :


Sergei Golubchik (MySQL team) wrote :

  Hi!

  On Jan 18, Nicolas GREGOIRE wrote:
   Hi,
  
   Still not any info about the buffer-overflow discovered last week ?
   Shouldn't be fixed at the beginning of the week ?
  
   Please, dear MySQL team, give us info !!
  
   Regards,
   Nicob

  Fixed in latest release (3.23.31).

  Regards,
  Sergei

Here an part of the 3.23.30 to 3.23.31 diff :
=

+Changes in release 3.23.31
+--
+
+   * Fixed security bug in something (please upgrade if you are using a
+ earlier MySQL 3.23 version).


___
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 2.3.0b2 bug #2

2001-01-23 Thread Oleg Broytmann

On Mon, 22 Jan 2001, Dieter Maurer wrote:
 Oleg Broytmann writes:
  Hm, will you fix my browser, too? I am using Netscape for Linux, don't
   know how well it plays with Unicode. I suppose it plays bad :(
 We use Netscape (4.5, 4.7; Linux, Windows) with "charset=utf-8" and
 it handles it well.

   Good news, thanks. Are there (free) Unicode fonts for X? What should I
do if I want to save an HTML to disk? (I want plain text, of course, in my
preferred encoding... probably need to write Unicode-to-koi8 converter)

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
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 Products and ZODB Transactions

2001-01-23 Thread Stephan Richter

Hello everyone,

wow, I haven't posted here for a while now, but now I came to a bigger 
problem and I hope someone of you will have some suggestions:

I built a Python Product that saves and gets data from a RDB. Whenever a 
method is called from my Python Product, the ZODB saves the transaction, 
even though the object was not modified at all. I really would like the 
ZODB to never save any of my Products actions. Any ideas?

Reagrds,
Stephan
--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development  Technical Project Management


___
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] ZPyGresQL Connection Add Error

2001-01-23 Thread Oleg Broytmann

On Mon, 22 Jan 2001, Craig wrote:
 Error Type: IOError
 Error Value: [Errno 2] No such file or directory:
 '/usr/lib/zope/lib/python/Shared/DC/ZRDB/connectionAdd.dtml'

   Also check all permissions starting from the root.

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
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] Opensource DBMS for WIN?

2001-01-23 Thread Paul Zwarts

Greetings,

Was wondering if there was an open source dbms to use with Zope on a
Win2k machine...? I found references of using cygwin to run PGSQL (which
we have on our unixbox) but would prefer something that doesnt run over
an extender-shell...

TIA,
Paz


___
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] Opensource DBMS for WIN?

2001-01-23 Thread Phil Harris

Try:

http://www.mysql.com
http://firebird.sourceforge.net (was Borland Interbase, Firebird is the
open-source version).

hth

Phil

- Original Message -
From: "Paul Zwarts" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 23, 2001 9:35 AM
Subject: [Zope] Opensource DBMS for WIN?


 Greetings,

 Was wondering if there was an open source dbms to use with Zope on a
 Win2k machine...? I found references of using cygwin to run PGSQL (which
 we have on our unixbox) but would prefer something that doesnt run over
 an extender-shell...

 TIA,
 Paz


 ___
 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] LocalFS and PathHandler

2001-01-23 Thread Chris Withers

Ulrich Wisser wrote:
 
 Hello,
 
 I try to access LocalFS from my own DTML method.
 (Exactly from my PathHandler method.) I got all
 directory information in one array like this
 
 path_to_handle = ['sub1', 'sub2', 'sub3']
 
 How can a get a directory listining with LocalFS
 for path "/sub1/sub2/sub3/"? I know I need something
 like "lfs['sub1']['sub2']['sub3'].fileids". 

Hmmm... try this as a Python (Script|Method|External Method), don't try and do
it in DTML ;-)

object = lfs
for id in path_to_handle:
object = object.get(id)
return object.fileids

you could probably turn that into a one liner with reduce:

return reduce(lamda x,y: x.get(y), [lfs]+path_to_handle).fileids

I'd laugh loads if you could do that in DTML:

dtml-var "reduce(lamda x,y: x.get(y), path_to_handle, lfs).fileids"

Who said you can't write obfuscated python?

*grinz*

Chris

PS: The first method should work, the one may work through sheer fluke, neither
have been tested though...

PPS: Nice to see someone using PathHandler :-)

___
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 Products and ZODB Transactions

2001-01-23 Thread Toby Dickenson

On Tue, 23 Jan 2001 03:28:34 -0600, Stephan Richter [EMAIL PROTECTED]
wrote:

Hello everyone,

wow, I haven't posted here for a while now, but now I came to a bigger 
problem and I hope someone of you will have some suggestions:

I built a Python Product that saves and gets data from a RDB. Whenever a 
method is called from my Python Product, the ZODB saves the transaction, 
even though the object was not modified at all. I really would like the 
ZODB to never save any of my Products actions. Any ideas?

Use the tranalyzer to see which objects are being commited. They think
they are being modified, even if you dont think they should be.

http://www.zope.org/Members/tsarna/Tranalyzer


Toby Dickenson
[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 )




[Zope] Getting access to python methods of some product

2001-01-23 Thread Ivan Somov

  How I can use method, stored in a ".py" file of some product, and send
some parameters to that method?
  I want to create an instance of ExtImage product programmatically,
 but have a troubles doing it..



___
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] [voipiri: Re: [Zope] Opensource DBMS for WIN?]

2001-01-23 Thread Riku Voipio

too fast typing - ment this to the list...
-- 
Riku Voipio
[EMAIL PROTECTED]
09-862 60764




On Tue, Jan 23, 2001 at 10:35:11AM +0100, Paul Zwarts wrote:
 Greetings,
 
 Was wondering if there was an open source dbms to use with Zope on a
 Win2k machine...? I found references of using cygwin to run PGSQL (which
 we have on our unixbox) but would prefer something that doesnt run over
 an extender-shell...

Uh, why bother?

postgres / mysql are desgned to be run under unixen, running them on
Win will always be a hack. 

It will probably be easier to install the Linux OS and Posgres on 
the win2k machine than to install posgres/mysql on win2k. 

all respectable distributions carry postgres _as part_ of 
the distrubuition.


-- 
Riku Voipio
[EMAIL PROTECTED]
09-862 60764





Re: [Zope] ActiveState on Zope.org

2001-01-23 Thread Tres Seaver

"Andy McKay" [EMAIL PROTECTED] wrote
 
  hi,
 
  I'm kind of surprised that Active State has such a big promo on Zope.org's
  site considering they use IIS; and considering the blurb talks about how
  much they do for Open Source.
 
 We use IIS for many reasons, it's fast and we use some of products in
 conjunction with it. To suggest that using IIS is somehow "wrong" confuses
 me, Zope.org doesn't use ZServer.

Strictly speaking, not true -- the host your browser connects to is
first
a load-balancer, then an Apache instance;  Apache is proxying for
ZServer.
See http://www.zope.org/About for details.

Otherwise, I'd agree with the rest of your points.

 For me the flexibilty of using Zope any
 way we see fit is its greatest strength. We made a decision to serve
 "static" content using a simple fast server and dynamic content using Zope.
 
 Actually we have the main web site in Zope. Its the CMS for the main web
 site and only accessible internally. This allows multiple users to access
 and make changes, templating and so on. Since this content changes very
 rarely we use wget hack to move the information to the main web site to be
 served by IIS, since IIS can serve out many more pages per second that Zope
 can (because it is doing some much less). This is a "right product for the
 right job" decision.
 
 For the dynamic portions (mailing list arcive etc.) we use Zope and ZServer
 quite happily on the front end. One day we may move to having the whole site
 in Zope, who knows :).
 
 As mentioned we do a great deal for Open Source (ActivePerl, ActivePython,
 PyXPCOM, PPM and so on) to name a just a bit. ActiveState is one of the very
 few companies where we pay people to hack open source stuff all day. In the
 same way Guido works for DC and spends time on Python, we have many talented
 Python and Perl developers (David Ascher, Paul Prescod, Gurusamy Sarathy,
 Jan Dubois) who in put a great deal of Open Source work.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

___
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] exchanging ids in a single transaction

2001-01-23 Thread Jerome Alet

Hi,

I'm currently thinking about a project in which I'd want to be able to
exchange 2 objects ids.

My plan is to save the first one's id
then rename the first one with the second's id 
then rename the second with the first's id

which is very classical.

I've got no code yet, but I want to know if there's a method to do all
this in a single transaction: if any error occur then I don't want any id
to be changed 

Is it possible and How ?

Should I use the UNDO machinery to do that or is it possible with another 
way ?

When I rename an object will my Data.fs grow (some objects may be 5 MBytes
large, but rarely) ?

Any tip will be appreciated.

Jerome Alet - [EMAIL PROTECTED] - http://cortex.unice.fr/~jerome
Fac de Medecine de Nicehttp://wwwmed.unice.fr 
Tel: (+33) 4 93 37 76 30 Fax: (+33) 4 93 53 15 15
28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE


___
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] Getting access to python methods of some product

2001-01-23 Thread Oleg Broytmann

Hi!

On Tue, 23 Jan 2001, Ivan Somov wrote:
   How I can use method, stored in a ".py" file of some product, and send
 some parameters to that method?

   I think, you can just acquire the method (if it is in the ZODB and is
acquirable).

   I want to create an instance of ExtImage product programmatically,
  but have a troubles doing it..

   Ah, that worse - you need a constructor, not an ordinary method. Not
sure how to call it. Probably, you need to import that .py, call the
constructor, get an object in return, and then _setObject somewhere into
ZODB.

   (Why not to try to ask the question in the Russian Python  Zope Mailing
List? :)

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
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] Getting an object from it's id

2001-01-23 Thread Gale

Hi,

This is obviously a newbie question.

I have several places in my dtml code where in order to obtain an object I
loop through objects of that kind and make a test to determine if each
objects id matches the id I picked up from a form.

This is the only way I could get it to work; but I feel there must be a
better, more efficient way.

Here is an example:

dtml-in expr="objectValues('Folder')"
dtml-if "myId==id"

Once I get a match I then proceed to use it in subsequent code, such as a
dtml with id and it works since id now refers to the object I'm interested
in.

Is there a Zope API method that will allow me to get an object from it's id,
or can I write a simple Python method to do it, or am I missing something
even more obvious?

Thanks


Geoff Armstrong


___
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] Getting an object from it's id

2001-01-23 Thread Erik Enge

[[EMAIL PROTECTED]]

| Is there a Zope API method that will allow me to get an object from
| it's id, or can I write a simple Python method to do it, or am I
| missing something even more obvious?

Well, sometimes objectItems or objectValues can be the right ones to
use.  Other times, (in Python Products at least) you use _getOb() to
fetch the object for you.

Let's say you have this object structure:

/Folder1
/Folder2

If you (in Python code) have Folder1 in the namespace, as self for
example, you can say object=self._getOb('Folder2'), and vila. :)
Don't know how you would do that in DTML, though.

___
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 Products and ZODB Transactions

2001-01-23 Thread Toby Dickenson

If your method changes data then it will always get saved. The only way is
to make sure your method never modifies a persistent object.

 -Original Message-
 From: Stephan Richter [mailto:[EMAIL PROTECTED]]
 Sent: 23 January 2001 11:11
 To: [EMAIL PROTECTED]
 Subject: Re: [Zope] Python Products and ZODB Transactions
 
 
 
 Use the tranalyzer to see which objects are being commited. 
 They think
 they are being modified, even if you dont think they should be.
 
 Okay, I found the methods and they are sometimes changed. But now, it 
 should NEVER save the transaction. Is there a way to do that?
 
 Regards,
 Stephan
 --
 Stephan Richter
 CBU - Physics and Chemistry Student
 Web2k - Web Design/Development  Technical Project Management
 

___
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] Getting an object from it's id

2001-01-23 Thread Oleg Broytmann

On Tue, 23 Jan 2001, Gale wrote:
 dtml-in expr="objectValues('Folder')"
 dtml-if "myId==id"

   You don't need to "get" the object, as the object is already on top of
the namespace stack (dtml-in put the object there on every iteration). Just
use the object's attributes (id, after all, is just yet another attribute).

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
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] : Postgre installation problem

2001-01-23 Thread K H Subrahmanyan

I have installed postgre SQL in my linux server.
I have installed ZpopyDA to my zope installation.

but when  I run the server I get the following error.

help me.
what else I have to do.
kindly give the necessary links.
thanks in advance.



ZPoPyDA Import Traceback

Traceback (innermost last):
  File "/Zope-2.2.5-linux2-x86/lib/python/OFS/Application.py", line 397, in
import_products
product=__import__(pname, global_dict, global_dict, silly)
  File "/Zope-2.2.5-linux2-x86/lib/python/Products/ZPoPyDA/__init__.py",
line 32, in ?
import sys, os, Globals, DA
  File "/Zope-2.2.5-linux2-x86/lib/python/Products/ZPoPyDA/DA.py", line 35,
in ?
from PoPy_db import DB
  File "/Zope-2.2.5-linux2-x86/lib/python/Products/ZPoPyDA/PoPy_db.py", line
35, in ?
raise "The PoPy module is not installed"
The PoPy module is not installed


___
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] Dynamic ordering of DTML-IN?

2001-01-23 Thread Andy Gates

Another one from the "my brain don't work" side of the tracks:

I have a staff list that I want to be orderable by first or last name. 
So I have buttons for each that link thus:

a href="staff?orderby=firstname" etc

The idea is that that feeds over to the DTML-IN tag thus:

dtml-in "sql_search(search='foo')" sort=orderby

But this barfs, because it's expecting a field name "orderby" and there
isn't one.  How do I evaluate that?

--
Andy Gates, Learning and Research Technology
[EMAIL PROTECTED] - ICQ#74362415
http://www.ilrt.bristol.ac.uk


___
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] : Postgre installation problem

2001-01-23 Thread Jerome Alet

On Tue, 23 Jan 2001, K H Subrahmanyan wrote:

 I have installed postgre SQL in my linux server.
 I have installed ZpopyDA to my zope installation.
 
 but when  I run the server I get the following error.
 
 ZPoPyDA Import Traceback
 raise "The PoPy module is not installed"
 The PoPy module is not installed

This is very clear.

You don't have installed the PoPy module

PoPy is needed by ZPoPyDA

PoPy is the layer between PostgreSQL and ZPoPyDA:

PostgreSQL -- PoPy -- ZPoPyDA -- Zope

hoping this will help

bye,
Jerome Alet


___
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] Opensource DBMS for WIN?

2001-01-23 Thread Petru Paler

On Tue, Jan 23, 2001 at 10:35:11AM +0100, Paul Zwarts wrote:
 Was wondering if there was an open source dbms to use with Zope on a
 Win2k machine...? I found references of using cygwin to run PGSQL (which
 we have on our unixbox) but would prefer something that doesnt run over
 an extender-shell...

I don't think I get what you mean by "extender shell". As far as I know
(never used it though), PostgreSQL works on win32. I'd ask on the postgres
lists first, though.

--
Petru Paler, mailto:[EMAIL PROTECTED]
http://www.ppetru.net - ICQ: 41817235

___
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] Dynamic ordering of DTML-IN?

2001-01-23 Thread Diego Rodrigo Neufert

You can use something like:

dtml-if "orderby=='firstname'"
dtml-in "sql_search(search='foo')" sort=firstname
dtml-elif "orderby=='lastname'"
dtml-in "sql_search(search='foo')" sort=lastname
/dtml-if

On Tuesday 23 January 2001 10:39 am, you wrote:
 Another one from the "my brain don't work" side of the tracks:

 I have a staff list that I want to be orderable by first or last name.
 So I have buttons for each that link thus:

 a href="staff?orderby=firstname" etc

 The idea is that that feeds over to the DTML-IN tag thus:

 dtml-in "sql_search(search='foo')" sort=orderby

 But this barfs, because it's expecting a field name "orderby" and there
 isn't one.  How do I evaluate that?

 --
 Andy Gates, Learning and Research Technology
 [EMAIL PROTECTED] - ICQ#74362415
 http://www.ilrt.bristol.ac.uk


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

-- 
Diego Rodrigo Neufert
Webmaster / Web Developer - Magic Web Design
---
[EMAIL PROTECTED]
www.magicwebdesign.com.br
Curitiba - PR - Brasil

___
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] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong

on 1/23/01 12:34 PM, Oleg Broytmann at [EMAIL PROTECTED] wrote:

 On Tue, 23 Jan 2001, Gale wrote:
 dtml-in expr="objectValues('Folder')"
 dtml-if "myId==id"

What I'm trying to do here is avoid using dtml-in, since in order for it to
put the object in the namespace it has to iterate over all of them (there
could be any number).

All I have at the beginning is the name of the object in the REQUEST part of
the namespace as picked up from a form. My method is the action to that
form.

In DTML there doesn't seem to be a way of saying, "I have this string with
the name of an object, now fetch me the object."

Geoff


 
 You don't need to "get" the object, as the object is already on top of
 the namespace stack (dtml-in put the object there on every iteration). Just
 use the object's attributes (id, after all, is just yet another attribute).
 
 Oleg.
 
 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
 Programmers don't die, they just GOSUB without RETURN.


___
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] Dynamic ordering of DTML-IN?

2001-01-23 Thread Andrew Kenneth Milton

+---[ Andy Gates ]--
| Another one from the "my brain don't work" side of the tracks:
| 
| I have a staff list that I want to be orderable by first or last name. 
| So I have buttons for each that link thus:
| 
| a href="staff?orderby=firstname" etc
| 
| The idea is that that feeds over to the DTML-IN tag thus:
| 
| dtml-in "sql_search(search='foo')" sort=orderby
| 
| But this barfs, because it's expecting a field name "orderby" and there
| isn't one.  How do I evaluate that?

dtml-in "sql_search(search='foo', orderby=orderby)"

Then change your Z SQL Method to look like;

select * from Customers where
foofield=dtml-sqlvar search type=string
dtml-if orderby
ORDER BY dtml-var orderby
/dtml-if

-- 
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] Getting an object from it's id

2001-01-23 Thread Andrew Kenneth Milton

+---[ Geoff Armstrong ]--
| on 1/23/01 12:34 PM, Oleg Broytmann at [EMAIL PROTECTED] wrote:
|
| In DTML there doesn't seem to be a way of saying, "I have this string with
| the name of an object, now fetch me the object."

if objectname is actually a variable with the name...

dtml-with "_.getitem(objectname,0)"

or dtml-call "REQUEST.set('fooobject',_.getitem(objectname,0))" to
get the object into a variable to pass or manipulate.

-- 
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] LocalFS and PathHandler

2001-01-23 Thread Ulrich Wisser

Hello,

At 19:54 22.01.2001 +0100, Dieter Maurer wrote:

Ulrich Wisser writes:
   How can a get a directory listining with LocalFS
   for path "/sub1/sub2/sub3/"? I know I need something
   like "lfs['sub1']['sub2']['sub3'].fileids". But
   what if there are more (or less) elements in path_to_handle?
The easiest answer to these types of questions are
recursive functions.

[...]

this is the code I came up with:

   dtml-call "REQUEST.set('mylfs',lfs)"
   dtml-in path_to_handle
 dtml-call "REQUEST.set('mylfs',mylfs[_['sequence-item']])"
   /dtml-in

Now I should have a reference to the object in mylfs.

How can I detect if mylfs is a file or a directory?

Thanks

Ulrich
-- 
Searchengine Know How  - Webpromotion - Optimization - Internal Search
World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg
http://www.publisher.de   Tel: +46-8-53460905Fax: +46-8-534 609 06


___
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, database field formats, output format of queries

2001-01-23 Thread Michael Schmidt

On Mon, Jan 22, 2001 at 07:50:45PM +0100, Dieter Maurer wrote:
 Michael Schmidt writes:
   Can you create fields in a zope based database where you force 
   the fields to accept e.g. only letters "M" or "W" or any other 
   other combination of your choice?
 What do you mean with a Zope based database?
 
 If you mean an external database, look for the datatypes and
 restrictions, they support for column values. SQL 3 may
 give you some of what you want.

The wording of "Zope based database" may cause a misunderstanding, 
what I really meant was a database behind Zope or a database 
accessed through the interface of Zope.

 Whether internal or external, you can control what goes through
 Zope to your database. You will probably need External Methods to
 get the full Python power, see "python.org" for documentation
 about Pythons vast library.
 You will be especially interested in the "re" module.
 It implements (Perl style) regular expressions.

Do these also achieve error handling?
Shall say which part of the software presents error messages 
on the screen if e.g. the user inputs other values than "M" 
and "W" in the above question?

Please excuse my ignorance, I'm new to Zope. Why I'm asking is 
that I'm thinking of recoding an application which I wrote years 
ago in the 4GL ZIM of Zanthe Information Technologies. That ZIM 
provided you with features I mentioned in the beginning and you 
hadn't to handle the error handling of wrong/unwanted input 
yourself, the underlying software did it for you.

Would be fine if Zope could do the same or similar, can it?

-- 
Michael  Schmidt [EMAIL PROTECTED]
MIRROR OF
Ghostscript  *  X-Windows X11  *  DJGPP  *  and more...

___
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] Dynamic ordering of DTML-IN?

2001-01-23 Thread Andy Gates

Message-ID: [EMAIL PROTECTED]
Priority: NORMAL
X-Mailer: Execmail for Win32 5.1 Build (9) 
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"

 You can use something like:
 
 dtml-if "orderby=='firstname'"
   dtml-in "sql_search(search='foo')" sort=firstname
 dtml-elif "orderby=='lastname'"
   dtml-in "sql_search(search='foo')" sort=lastname
 /dtml-if

Hmm, that chokes, becuase it thinks the /dtml-if tag is inside the 
dtml-in I think.

AndyG


___
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] Trivial challenge ?

2001-01-23 Thread Olivier Deckmyn

Hi all,

I have a problem that looks simple (if not trivial) : I would like to
"render" a DTML Document using a DTML Method.

The DTMLDoc is "mydoc", has a title (="My Document") and a content (="I am
the doc content")

The DTMLMethod is "render" and its code is :
"""
I am rendering the dtml-var title_or_id page !
"""

And, at last, I have a index_html like this :

"""
dtml-with mydoc
dtml-var render
/dtml-with
"""
(All the items are in the same folder , whose id=test and no title)

When viewing http://localhost:8080/test/ the result I expect is :

I am rendering the My Document page !

OK ?

But I got :

I am rendering the test page !

THE DTML-WITH DID NOTHING !!

What makes me become crasy is that http://localhost:8080/test/mydoc/render
works as expected !!! :
I am rendering the My Document page !

Can anyone explain me this ?

And by the way give a solution to my problem ??? Of course I cannot use the
http://localhost:8080/test/mydoc/render  notation.

Thanx for reading that far.

Olivier.



___
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] Getting an object from it's id

2001-01-23 Thread Ivan Cornell

Geoff Armstrong wrote:

 What I'm trying to do here is avoid using dtml-in, since in order for it to
 put the object in the namespace it has to iterate over all of them (there
 could be any number).

 All I have at the beginning is the name of the object in the REQUEST part of
 the namespace as picked up from a form. My method is the action to that
 form.

 In DTML there doesn't seem to be a way of saying, "I have this string with
 the name of an object, now fetch me the object."


Hi Geoff,

Try using _.getitem(), as in:
dtml-let myObject="_.getitem(myId)"
... dtml-call myObject.foo ...
/dtml-let
or probably:
dtml-let myObject="_.getitem(REQUEST['myId'])"

If you aren't sure of the existance of the object, wrap the above in:
dtml-if "_.hasattr(this(), REQUEST['myId'])"
/dtml-if

Ivan


___
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] Trivial challenge ?

2001-01-23 Thread Andrew Kenneth Milton

+---[ Olivier Deckmyn ]--
| Hi all,

| """
| dtml-with mydoc
| dtml-var render
| /dtml-with

Why don't you just do dtml-var mydoc ?

you can also do dtml-var "mydoc.render(_.None,_)"
I suppose

-- 
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] Getting an object from it's id

2001-01-23 Thread Max Møller Rasmussen

From: Geoff Armstrong [mailto:[EMAIL PROTECTED]]

In DTML there doesn't seem to be a way of saying, "I have this string with
the name of an object, now fetch me the object."

Shure there is:

dtml-var "some_container_object[remote_id].title"

As far as I remember.

regards Max M

A snippet I use somewhere:

dtml-in "emner[_['sequence-item']].objectValues('maal')"
dtml-var titlebr
dtml-var descriptionbrbr
/dtml-in

___
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] Trivial challenge ?

2001-01-23 Thread Olivier Deckmyn

I tried dtml-var "mydoc.render(_.None,_)" 

The same result : does'nt work...(exactly like with the dtml-with tag)

- Original Message -
From: "Andrew Kenneth Milton" [EMAIL PROTECTED]
To: "Olivier Deckmyn" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, January 23, 2001 2:43 PM
Subject: Re: [Zope] Trivial challenge ?


 +---[ Olivier Deckmyn ]--
 | Hi all,

 | """
 | dtml-with mydoc
 | dtml-var render
 | /dtml-with

 Why don't you just do dtml-var mydoc ?

 you can also do dtml-var "mydoc.render(_.None,_)"
 I suppose

 --
 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] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong

on 1/23/01 1:12 PM, Erik Enge at [EMAIL PROTECTED] wrote:

Thanks; but being new to this could you help me a bit more by providing an
example of how to use 'getOb' within dtml code. I tried testing in; but
couldn't get it work.

Geoff

 [[EMAIL PROTECTED]]
 
 | Is there a Zope API method that will allow me to get an object from
 | it's id, or can I write a simple Python method to do it, or am I
 | missing something even more obvious?
 
 Well, sometimes objectItems or objectValues can be the right ones to
 use.  Other times, (in Python Products at least) you use _getOb() to
 fetch the object for you.
 
 Let's say you have this object structure:
 
 /Folder1
 /Folder2
 
 If you (in Python code) have Folder1 in the namespace, as self for
 example, you can say object=self._getOb('Folder2'), and vila. :)
 Don't know how you would do that in DTML, though.
 
 ___
 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] Trivial challenge ?

2001-01-23 Thread Andrew Kenneth Milton

+---[ Olivier Deckmyn ]--
| I tried dtml-var "mydoc.render(_.None,_)" 
| 
| The same result : does'nt work...(exactly like with the dtml-with tag)

and dtml-var mydoc ?

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




[Zope] _.getitem() was:Getting an object from it's id

2001-01-23 Thread Tim Cook


Speaking of getitem...

 if objectname is actually a variable with the name...
 
 dtml-with "_.getitem(objectname,0)"

Can someone explain this from the ZQR?

getitem(name,flag)
Lookup a name in the namespace. If the value is callable and the
flag is true, then the result of calling the value is returned,
otherwise the value is returned. flag defaults to false. 


I use getitem() quite alot and never set the flag (therefore it's
false). It works and does what I want, but the ZQR entry doesn't
seem to support that and I have seen it given as an example with
the flag set true with what appears to me to be the same results.
  
Thanks,
-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Liberty has never come from the government." - Woodrow Wilson

___
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] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong

on 1/23/01 1:20 PM, Ivan Cornell at [EMAIL PROTECTED] wrote:


Hi Ivan,

Thanks. The "_.getitem(myId)" works well. I've made a note of the "hasattr"
trick as well for future reference.


Geoff
 Geoff Armstrong wrote:
 
 What I'm trying to do here is avoid using dtml-in, since in order for it to
 put the object in the namespace it has to iterate over all of them (there
 could be any number).
 
 All I have at the beginning is the name of the object in the REQUEST part of
 the namespace as picked up from a form. My method is the action to that
 form.
 
 In DTML there doesn't seem to be a way of saying, "I have this string with
 the name of an object, now fetch me the object."
 
 
 Hi Geoff,
 
 Try using _.getitem(), as in:
 dtml-let myObject="_.getitem(myId)"
 ... dtml-call myObject.foo ...
 /dtml-let
 or probably:
 dtml-let myObject="_.getitem(REQUEST['myId'])"
 
 If you aren't sure of the existance of the object, wrap the above in:
 dtml-if "_.hasattr(this(), REQUEST['myId'])"
 /dtml-if
 
 Ivan
 
 
 ___
 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] Trivial challenge ?

2001-01-23 Thread Chris Withers

Olivier Deckmyn wrote:
 
 this is not what I need !!!
 
 Yes : dtml-var mydoc displays the content of the document... But I don't
 need this.
 The example I gave is a simplified pb of my __real_world__ problem ... Just
 to show the interessting point !
 
 My __real_world__ document has several properties, etc...
 and a I have a lot of renderers (this explains that...)

Have you considered that you might have simplified out the problem too much, so
that the actual problem isn't present in your example?

cheers,

Chris

___
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] Trivial challenge ?

2001-01-23 Thread Olivier Deckmyn

this is not what I need !!!

Yes : dtml-var mydoc displays the content of the document... But I don't
need this.
The example I gave is a simplified pb of my __real_world__ problem ... Just
to show the interessting point !

My __real_world__ document has several properties, etc...
and a I have a lot of renderers (this explains that...)

Thanx !


- Original Message -
From: "Andrew Kenneth Milton" [EMAIL PROTECTED]
To: "Olivier Deckmyn" [EMAIL PROTECTED]
Cc: "Andrew Kenneth Milton" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, January 23, 2001 3:12 PM
Subject: Re: [Zope] Trivial challenge ?


 +---[ Olivier Deckmyn ]--
 | I tried dtml-var "mydoc.render(_.None,_)" 
 |
 | The same result : does'nt work...(exactly like with the dtml-with
tag)

 and dtml-var mydoc ?

 --
 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] _.getitem() was:Getting an object from it's id

2001-01-23 Thread Chris Withers

Tim Cook wrote:
 
 I use getitem() quite alot and never set the flag (therefore it's
 false). It works and does what I want, but the ZQR entry doesn't
 seem to support that and I have seen it given as an example with
 the flag set true with what appears to me to be the same results.

...it can quite often be, but try this:

if mymethod is a DTML method:

_.getitem('mymethod') will return a DTML Method object.

_.getitem('mymethod',1) will return a lump of text.


HTH,

Chris

___
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] _.getitem() was:Getting an object from it's id

2001-01-23 Thread Tim Cook

Chris Withers wrote:
 
 Tim Cook wrote:
 
  I use getitem() quite alot and never set the flag (therefore it's
  false). It works and does what I want, but the ZQR entry doesn't
  seem to support that and I have seen it given as an example with
  the flag set true with what appears to me to be the same results.
 
 ...it can quite often be, but try this:
 
 if mymethod is a DTML method:
 
 _.getitem('mymethod') will return a DTML Method object.
 
 _.getitem('mymethod',1) will return a lump of text.
 

It does, thanks.
See, simple answers for simple minds. s


-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Liberty has never come from the government." - Woodrow Wilson

___
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: Trivial challenge ?

2001-01-23 Thread Olivier Deckmyn

I got it :

dtml-with "mydoc"
dtml-var render
/dtml-with

rather than :
dtml-with mydoc
dtml-var render
/dtml-with

after all, this is quite logical ;)

ps : The idea came to me after playing with :
dtml-var "mydoc.title_or_id()"


- Original Message -
From: "Olivier Deckmyn" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 23, 2001 2:24 PM
Subject: Trivial challenge ?


 Hi all,

 I have a problem that looks simple (if not trivial) : I would like to
 "render" a DTML Document using a DTML Method.

 The DTMLDoc is "mydoc", has a title (="My Document") and a content (="I am
 the doc content")

 The DTMLMethod is "render" and its code is :
 """
 I am rendering the dtml-var title_or_id page !
 """

 And, at last, I have a index_html like this :

 """
 dtml-with mydoc
 dtml-var render
 /dtml-with
 """
 (All the items are in the same folder , whose id=test and no title)

 When viewing http://localhost:8080/test/ the result I expect is :

 I am rendering the My Document page !

 OK ?

 But I got :

 I am rendering the test page !

 THE DTML-WITH DID NOTHING !!

 What makes me become crasy is that http://localhost:8080/test/mydoc/render
 works as expected !!! :
 I am rendering the My Document page !

 Can anyone explain me this ?

 And by the way give a solution to my problem ??? Of course I cannot use
the
 http://localhost:8080/test/mydoc/render  notation.

 Thanx for reading that far.

 Olivier.




___
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] Getting an object from it's id

2001-01-23 Thread Geoff Armstrong

on 1/23/01 1:39 PM, Max Mller Rasmussen at [EMAIL PROTECTED] wrote:

Thanks. That's great; but you do need to know the objects immediate
container right? I have one situation where the container could be one of
many.


Geoff

 From: Geoff Armstrong [mailto:[EMAIL PROTECTED]]
 
 In DTML there doesn't seem to be a way of saying, "I have this string with
 the name of an object, now fetch me the object."
 
 Shure there is:
 
 dtml-var "some_container_object[remote_id].title"
 
 As far as I remember.
 
 regards Max M
 
 A snippet I use somewhere:
 
 dtml-in "emner[_['sequence-item']].objectValues('maal')"
 dtml-var titlebr
 dtml-var descriptionbrbr
 /dtml-in


___
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] Opensource DBMS for WIN?

2001-01-23 Thread Farrell, Troy

PostgreSQL compiles on Win32, but only under RedHat's(formerly Cygnus')
Cygwin Unix Compatibility Layer. http://www.postgresql.org
http://people.freebsd.org/~kevlo/postgres/portNT.html
MySQL, the newly GPL'd version, was declared stable yesterday.
http://www.mysql.com
SapDB is to be open-sourced soon.  http://www.sapdb.org

Troy

-Original Message-
From: Petru Paler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 6:48 AM
To: Paul Zwarts
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope] Opensource DBMS for WIN?


On Tue, Jan 23, 2001 at 10:35:11AM +0100, Paul Zwarts wrote:
 Was wondering if there was an open source dbms to use with Zope on a
 Win2k machine...? I found references of using cygwin to run PGSQL (which
 we have on our unixbox) but would prefer something that doesnt run over
 an extender-shell...

I don't think I get what you mean by "extender shell". As far as I know
(never used it though), PostgreSQL works on win32. I'd ask on the postgres
lists first, though.

--
Petru Paler, mailto:[EMAIL PROTECTED]
http://www.ppetru.net - ICQ: 41817235

___
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] Dynamic ordering of DTML-IN?

2001-01-23 Thread Oliver Bleutgen

 Then change your Z SQL Method to look like;

 select * from Customers where
 foofield=dtml-sqlvar search type=string
 dtml-if orderby
 ORDER BY dtml-var orderby
 /dtml-if

Hmm, I wouldn't do that, you're trusting the client here,
imagine someone going to 

http://yourserver/staff?orderby=firstname%20;%20delete from Customers;

(sufficient dbuser rights assumed)

I would use staff?order_id=1 (2,3,...)
etc. and then set orderby via a dictionary (or some simple
dtml-ifs).

cheers,
oliver


___
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] Dynamic ordering of DTML-IN?

2001-01-23 Thread Andrew Kenneth Milton

+---[ Oliver Bleutgen ]--
|  Then change your Z SQL Method to look like;
| 
|  select * from Customers where
|  foofield=dtml-sqlvar search type=string
|  dtml-if orderby
|  ORDER BY dtml-var orderby
|  /dtml-if
| 
| Hmm, I wouldn't do that, you're trusting the client here,
| imagine someone going to 
| 
| http://yourserver/staff?orderby=firstname%20;%20delete from Customers;

You always validate external input, especially in a web environment.
I didn't think it was necessary to spell that out.

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




[Zope] EMail with uploaded attachments

2001-01-23 Thread Klaus Herrmann

Hi Folks!

I have another problem:
I wrote a nice web interface for email feedback etc., but i want to add an
option for attaching files to the emails. how can i do this? i can't get it to
work.
i have this:

form action="send_email" method=post enctype="multipart/form-data"
..
input type=file size=18 maxlength=300
 name="attached_file"
/form

and in send_email:

dtml-sendmail mailhost=fox
To: ...
From: ...
Subject: ...
dtml-mime type=text/plain encode=7bit

plain text

dtml-boundary type=application/octet-stream
disposition=attachment encode=base64
dtml-var attached_file/dtml-mime

/dtml-sendmail

but the only result is that the attachments contains:
ZPublisher.HTTPRequest.FileUpload instance at 88b4df0

what am i doing wrong?

thanks in advance!

bye,
Klaus

-- 
Klaus Herrmann [EMAIL PROTECTED]
Goelz  Schwarz GmbH, Munich
www.goelz.com
phone:+49 - (0)89 - 544 67 0 22
fax: +49 - (0)89 - 544 67 0 10


___
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] Trivial challenge ?

2001-01-23 Thread Tim Cook

Olivier Deckmyn wrote:
 
 this is not what I need !!!
 
 Yes : dtml-var mydoc displays the content of the document... But I don't
 need this.
 The example I gave is a simplified pb of my __real_world__ problem ... Just
 to show the interessting point !
 
 My __real_world__ document has several properties, etc...
 and a I have a lot of renderers (this explains that...)
 
 Thanx !

I think it's time for your document to be an instance of a
ZClass.

-- Tim Cook, President --
Free Practice Management,Inc. | http://www.FreePM.com Office:
(901) 884-4126
"Liberty has never come from the government." - Woodrow Wilson

___
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] ZPoPyDa doesnt find the PoPy-Module

2001-01-23 Thread jpenny

On Tue, Jan 23, 2001 at 07:41:45AM +0100, Axel Missbach wrote:
 [EMAIL PROTECTED] wrote:
  
  On Sun, Jan 21, 2001 at 11:27:30AM +0100, Axel Missbach wrote:
   Hey to all,
   having installed the PoPy-Modul-2.01. The ZPoPyDa-1.01-pre2 doesnt find
   it.
   calling "import PoPy" in the python-interprter works with out error.
   Please give me a hint.
  
  Where did your zope come from?
 I have downloaded from zope.org the version zope-2.30b2-linux2-x86.tgz

OK, I think that comes with an internal python interpreter.
Yes, indeed, it is in $ZOPE_HOME/bin.

This means that when you run python, you are probably not running the 
python that zope is running.  

I think, but am not totally sure, that the PoPymodule.so would have to go
in $ZOPE_HOME/lib/python1.5 and zope restarted for it to become
available.

(Would you try this and tell me if it works, please?)

Alternatively, one could edit z2.py to NOT use Zope's python,
or one could install the source package.  I actually recommend
the latter course.  It is a dead easy install.

Jim
 
  
   ___
   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] EMail with uploaded attachments

2001-01-23 Thread Erik Enge

[Klaus Herrmann]

| but the only result is that the attachments contains:
| ZPublisher.HTTPRequest.FileUpload instance at 88b4df0

I might be wrong, but what if you used this instead:

dtml-var "_[attached_file]"

Would that work?

___
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] Opensource DBMS for WIN?

2001-01-23 Thread Marcin Kasperski

 PostgreSQL compiles on Win32, but only under RedHat's(formerly Cygnus')
 Cygwin Unix Compatibility Layer. http://www.postgresql.org
 http://people.freebsd.org/~kevlo/postgres/portNT.html
 MySQL, the newly GPL'd version, was declared stable yesterday.
 http://www.mysql.com
 SapDB is to be open-sourced soon.  http://www.sapdb.org
 

What about InterBase (formerly commercial database for both Windows and
Unix, currently open source)?

--
http://www.mk.w.pl /
 Marcin.Kasperski | Zbir porad dla twrcw serwisw WWW: 
   @softax.com.pl |   http://www.mk.w.pl/porady/porady_www
 @bigfoot.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] Problem instantiating ZClass

2001-01-23 Thread Åsmund Hjulstad


There appears to be something wrong... 

My config:  

Zope from CVS (2001-01-23, 16:15GMT)
Python 2.0  (yes, I know it is not supported)


I did the following:

In Control Panel, generate new product.
In the new product, Added new class (filled in the blanks).

In the root folder: Add, select the new class, entered ID, and then...

Error Type: AttributeError
   Error Value: _setId

I have reproduced it several times, with several different CVS-versions.


Traceback (innermost last):
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/Publish.py, line 222, 
in publish_module
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/Publish.py, line 187, 
in publish
  File /home/ahj/polar/zope/Zope2/lib/python/Zope/__init__.py, line 221, in 
zpublisher_exception_hook
(Object: RoleManager)
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/Publish.py, line 171, 
in publish
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/mapply.py, line 160, 
in mapply
(Object: CDClass_add)
  File /home/ahj/polar/zope/Zope2/lib/python/ZPublisher/Publish.py, line 112, 
in call_object
(Object: CDClass_add)
  File /home/ahj/polar/zope/Zope2/lib/python/OFS/DTMLMethod.py, line 189, in 
__call__
(Object: CDClass_add)
  File /home/ahj/polar/zope/Zope2/lib/python/DocumentTemplate/DT_String.py, 
line 538, in __call__
(Object: CDClass_add)
  File /home/ahj/polar/zope/Zope2/lib/python/DocumentTemplate/DT_With.py, 
line 133, in render
(Object: CDClass.createInObjectManager(REQUEST['id'], REQUEST))
  File /home/ahj/polar/zope/Zope2/lib/python/DocumentTemplate/DT_Util.py, 
line 334, in eval
(Object: CDClass.createInObjectManager(REQUEST['id'], REQUEST))
(Info: CDClass)
  File string, line 0, in ?
  File /home/ahj/polar/zope/Zope2/lib/python/ZClasses/ZClass.py, line 522, in 
createInObjectManager
(Object: CDClass)
AttributeError: (see above)


___
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 Products and ZODB Transactions

2001-01-23 Thread Stephan Richter

At 12:27 PM 1/23/01 +, Toby Dickenson wrote:
If your method changes data then it will always get saved. The only way is
to make sure your method never modifies a persistent object.

Mmmhh, so my answer is not to derive my classes from Persistent. Will it 
then actually store the object in the ZODB?
How does that work? That is the C part of Zope and I am not too efficient 
with C.

Regards,
Stephan
--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development  Technical Project Management


___
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] form question

2001-01-23 Thread jpenny

On Mon, Jan 22, 2001 at 07:55:28PM +0100, Dieter Maurer wrote:
 Oliver Vecernik writes:
   I'm designing an application gathering data with forms. Navigation
   should be done with Prev and Next buttons. As long as I'm not leaving
   the form data should be entered, processed and the *same* or another
   form should be displayed, depending on input of the user.
   
   So far I'm able to gather data, store them in a database, but can
   anybody give me a clue or point me to some docs how to control which
   form should be displayed next? It should depend on users input of let's
   say a text field.
 Look for the "RESPONSE.redirect" method.
 
 
 Dieter

Dieter, as usual, gave a good succinct answer.  But in this case, I
think that the problem is in the way the question is framed, and not
the answer.

I am going to give a completely different answer, based on what I think
the original questioner really needed, it will be a bit long.

I am assuming that the application lays in a folder called MyApplication.

I am going to use a particular coding style that I call "going nowhere",
it is actually a state machine.  I am going to use hidden variables to
hold state, you can also use cookies, database connections or other
mechanisms.

index_html is just a chain of if statements that encode what to
display next.

For example:

dtml-if "not REQUEST.has_key('current_state')"
  dtml-var entry_form
dtml-elif "current_state=='process_entry' and action=='Next'"
  dtml-var next_form
dtml-elif "current_state=='next_entry' and action=='Prev'"
  dtml-var entry_form
 .
.
 .
/dtml-if

entry_form looks like

form action=. method=post
  input type=hidden name=current_state value="process_entry"
  input type=text size=15 name=my_variable
  input type=submit name=action value="Next"
/form

(This is where the "going nowhere" comes from.  All forms use
. as the action, so the browser never goes to another folder.)

Now, it should be easy to see how to modify index_html to handle
displaying a different form depending on the previous input.
Just put in in one of the tests.

-

To elaborate this just a bit, I also typically do an error_entry__form 
that looks like:

form action=. method=post
  font color = reddtml-var error_message/font
  input type=hidden name=current_state value="process_entry"
  input type=text size=15 name=my_variable value="dtml-var my_variable"
  input type=submit name=action value="Next"
/form

and change my index_html to look like:

dtml-if "not REQUEST.has_key('current_state')"
  dtml-var entry_form
dtml-elif "current_state=='process_entry' and action=='Next'"
  dtml-var handle_process_entry_next
dtml-elif "current_state=='next_entry' and action=='Prev'"
  dtml-var handle_process_entry_prev
 .
.
 .
/dtml-if

Then 

handle_process_entry_next looks like:

dtml-call "REQUEST.set('error_message', '')"
dtml-call canonify_process_entry_next_data
dtml-call check_process_next_errors
dtml-if "error_message != ''"
  dtml-var error_entry_form
dtml-else
  dtml-var next_form
/dtml-if

(canonify_... does approriate things like stripping, converting to a particular
case, etc.; check_... enforces data consistency conditions.)

  
This is not an original idea.  I saw it when I was pretty green, myself, and
really did not understand its attraction and power.  Here are what I now see
as the benefits.  All of the application is kept in a single folder.  The
index_html is boilerplate, essentially a single long if-statement.  The
canonify_ and check_ methods are likely to be very small also, and can be
implemented in any language.  The forms are essentially pure HTML, and can
be kept very simple (OK, the error_form has a smattering of very simple
DTML to reset the last value of the user's input).  Error handling is natural
and easy to do.  You do not have to redirect.
Redirection destroys your REQUEST, forcing you to do other things to hold
information.

The cost, only that an application's folder gets to be somewhat large.

Jim Penny

 
 ___
 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] Dynamic ordering of DTML-IN?

2001-01-23 Thread Adam Karpierz

 You can use something like:

 dtml-if "orderby=='firstname'"
 dtml-in "sql_search(search='foo')" sort=firstname
 dtml-elif "orderby=='lastname'"
 dtml-in "sql_search(search='foo')" sort=lastname
 /dtml-if

For Zope.2.3.0+ you can use:

dtml-in "sql_search(search='foo')" sort_expr="orderby"

--
Adam Karpierz
[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] Opensource DBMS for WIN?

2001-01-23 Thread Adam Karpierz

 Greetings,

 Was wondering if there was an open source dbms to use with Zope on a
 Win2k machine...? I found references of using cygwin to run PGSQL (which
 we have on our unixbox) but would prefer something that doesnt run over
 an extender-shell...

 TIA,
 Paz

InterBase
From versiom 6.0 it is Open Source RDBMS.
http://www.interbase.com

Works good eg. with gvibDA adapter.


--
Adam Karpierz
[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] Opensource DBMS for WIN?

2001-01-23 Thread Hannu Krosing

Paul Zwarts wrote:
 
 Greetings,
 
 Was wondering if there was an open source dbms to use with Zope on a
 Win2k machine...? I found references of using cygwin to run PGSQL (which
 we have on our unixbox) but would prefer something that doesnt run over
 an extender-shell...

For smaller tasks you could use MySQL or even Gadfly (included with
Zope)
mSQL is also to be resurrected but I'm not sure it will run on windows.

But if you have a machine beefy enogh for Win2k a small extender-shell 
(or rather a compatibility layer) should make no difference ;)

You could also consider Interbase or SapDB but they are probably not yet 
stable.

Or if you want to get really exotic you can run VMware to run linux and 
run any free database there ;)


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 )




Re: [Zope] Zope 2.3.0b2 bug #2

2001-01-23 Thread Hannu Krosing

Oleg Broytmann wrote:
 
 On Mon, 22 Jan 2001, Dieter Maurer wrote:
  Oleg Broytmann writes:
   Hm, will you fix my browser, too? I am using Netscape for Linux, don't
know how well it plays with Unicode. I suppose it plays bad :(
  We use Netscape (4.5, 4.7; Linux, Windows) with "charset=utf-8" and
  it handles it well.
 
Good news, thanks. Are there (free) Unicode fonts for X?

If your X server supports ttf you could use the ones from windows (or
microsoft 
website).

You could also use the Bitstream Cyberbit fonts that are available at
least from
ftp://ftp.funet.fi/pub/mirrors/ftp.netscape.com/pub/communicator/extras/fonts/windows/

I'm not sure about their legal status though ;(

 What should I
 do if I want to save an HTML to disk? (I want plain text, of course, in my
 preferred encoding... probably need to write Unicode-to-koi8 converter)

That should be trivial in python 2.0 

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




Re: [Zope] Trivial challenge ?

2001-01-23 Thread Wolfgang Strobl

On 23 Jan 2001, at 14:17, Chris Withers wrote:

 Olivier Deckmyn wrote:
  
  this is not what I need !!!
  
  Yes : dtml-var mydoc displays the content of the document... But
  I don't need this. The example I gave is a simplified pb of my
  __real_world__ problem ... Just to show the interessting point !
  
  My __real_world__ document has several properties, etc...
  and a I have a lot of renderers (this explains that...)
 
 Have you considered that you might have simplified out the problem
 too much, so that the actual problem isn't present in your example?

Funny. I think he gave a good description of the problem. I've 
fallen into this trap too, when I started using Zope. I too consider 
the behaviour somewhat odd, and don't like the current state of 
affairs, where fiddling around with various partially implemented 
syntactic constructs gives quicker results than searching the 
documentation, or having a simple mental model of how it "is 
assumed to work".

Olivers mental model of how the evaluation of a dtml constructs 
obviously doesn't give him the right clues. IMHO, this isn't Olivers 
fault, but an indication that there is something wrong with dtml.

Btw, I believe that dtml-var "render(mydoc)" is the easiest way 
to express what he wants. But what do I know. :-}


-- 
Wolfgang Strobl

___
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: ZClasses and title property

2001-01-23 Thread Aaron Louie

I think the problem goes deeper than that. Zope 2.3x no longer allows the
setting or creation of any property called "title" for new ZClasses. Period
(At least, not in the same way it used to). Try it for yourself. If you
follow the steps in the "ZClass Properties" How-to
(http://www.zope.org/Members/lstaffor/zProperties), you'll find that Zope
2.3x gives a "The id 'title' is invalid--it is already in use" error when
you try to create a property called "title".

Fine, you say, it's already there by default, right?

Finish out the How-To, setting all the proper permissions, modifying the
addForm and the constructor to accomodate your other properties. Then try
creating an instance of your new class and setting the 'title' property
through the addForm. The title will not be set when you hit 'Add'. The field
will remain empty...

Of course, the How-To above worked just fine in 2.2.5. Doesn't work anymore.
There is no longer any default place to set the title in a new ZClass and
the title property cannot be set thru DTML. (Haven't tried it in Python yet)

Is this a bug or am I missing something?

ajl

 I guessed it was something like this, so this leads me to two followup
 questions.

 1) I'd be happy to use the built-in title property assuming that it
   won't cause some kind of problem.  I just don't know how I can set
   that in instance objects since it doesn't appear on the property
   sheet.  Can I modify the addForm and add methods for the class to
   set it there?  Do I need to make a custom view?  What approach do
   most people take in this situation, using the built-in title or
   choosing a different name for a title-like property?


 I use Title (note the upper-casity), and then I add a Python Mehtod (or in
 2.3 a Python Script) called 'title' that simply does:
 return self.Title
(or in a P.S.:
 return context.Title
 should do it
)


___
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: ZClasses and title property

2001-01-23 Thread Brian Lloyd

 I think the problem goes deeper than that. Zope 2.3x no longer allows the
 setting or creation of any property called "title" for new 
 ZClasses. Period
 (At least, not in the same way it used to). Try it for yourself. If you
 follow the steps in the "ZClass Properties" How-to
 (http://www.zope.org/Members/lstaffor/zProperties), you'll find that Zope
 2.3x gives a "The id 'title' is invalid--it is already in use" error when
 you try to create a property called "title".
 
 snip
 
 Is this a bug or am I missing something?
 
 ajl

Its a bug - this is fixed in CVS for 2.3 beta 3.


Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.371.6909  
Digital Creations  http://www.digicool.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] ZClasses date properties

2001-01-23 Thread Tim Moore

OK, now that I've settled my title property conundrum by just calling
the property "name" instead :-\ I go to add a "date" property to my
ZClass and find that it doesn't like that either.  Specifically, it
won't let me add a property of type date with no value, giving me an
"Invalid Date-Time String" error.  I take it that empty date fields
aren't allowed then...is this intended or a bug?  Still using 2.3b1.
-- 
Tim Moore

___
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] Fw: [Zope] ZClasses date properties

2001-01-23 Thread Andy McKay

 Empty date fields are not allowed, this has been a feature for a while. I
 set mine to 1970/01/01 for the hell of it.
 --
   Andy McKay.
 
 
 - Original Message -
 From: "Tim Moore" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, January 23, 2001 11:24 AM
 Subject: [Zope] ZClasses  date properties
 
 
  OK, now that I've settled my title property conundrum by just calling
  the property "name" instead :-\ I go to add a "date" property to my
  ZClass and find that it doesn't like that either.  Specifically, it
  won't let me add a property of type date with no value, giving me an
  "Invalid Date-Time String" error.  I take it that empty date fields
  aren't allowed then...is this intended or a bug?  Still using 2.3b1.
  --
  Tim Moore
 
  ___
  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] LocalFS and PathHandler

2001-01-23 Thread Jonothan Farr

 Now I should have a reference to the object in mylfs.
 
 How can I detect if mylfs is a file or a directory?

dtml-if "mylfs.meta_type=='Local Directory'

--jfarr



___
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] Property sheet feature request

2001-01-23 Thread Tim Moore

It would be nice to be able to reorder properties in a sheet, maybe
using something like the "First" button in the views screen.  I'd
submit a patch myself, but I'm still figuring all this out so it would
hopefully be quicker for someone else more familiar with the code to
add that.

thanks!
-- 
Tim Moore

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

2001-01-23 Thread Paula Mangas




Hi,


I'm a newbie and i would like to know how can i create a DTMLDocument from
a Python method.


Thanks,
Paula Mangas


___
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] PythonScript bug?

2001-01-23 Thread Tim Moore

I have a small python script method which works fine unless I bind the
Namspace to a variable (even if I don't actually use the variable),
which causes a MemoryError that appears to be due to deep (infinite?)
recursion in the __render_with_namespace__ method (Bindings.py, line
355).

Zope 2.3b2
-- 
Tim Moore

___
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 is not getting MySQL SELECT results ...

2001-01-23 Thread Gerald Gutierrez


Hi all.

I have set up, in a clean Zope installation, a MySQL database adapter. My 
connection string is "test test test", indicating a user test with password 
test connection to the test database.

The adapter indicates that it can connect to the database, and I can send 
queries to the database. CREATE TABLE, INSERT, UPDATE, and other queries 
work just fine through the "test" tab of the adapter management interface, 
but it does not seem to be able return any data through a SELECT query. 
This does not work in the "test" table nor in a SQL method. Using a query, 
such as "select * from test", it always replies with:


There was no data matching this My Query query.

SQL used:
select * from test


I know the queries are reaching the database, because if I give it a bogus 
command, it gives me an error, and if I give it a command that affects the 
data, I can see that reflected in the database itself with MySQL's "mysql" 
client. So what is a problem here?

As another test, I tried out the MySQL-python module; it works just fine.

I'm using Python 2.0, Zope 2.3b2, ZMySQLDA 1.2.0, MySQL-python 0.3.0.

Thanks for any help.

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] Some help required but no sarcastic comments this time please

2001-01-23 Thread alankirk



Hi there,
i sent an email the other week regarding problems 
i've been experiencing with zope and MySQL. I've set up a database connection 
for zope and mysql and it sort of works. I can send queries to add data to my 
database ok but when i send a query to get data from my database i get one of 3 
errors and my python server that zope runs from stops. The errors i get are 
Python experienced an error in (either nothing,MYSQL.DLL or PYTHON15.DLL). 

I am using Zope 2.2.2on windows(this time i'd 
appreciate no sarcastic comments this time)
I've sent a few emails about this problem to 
various people (including to this address) and the response has been pretty 
poor, i've even tried to email people involved with the mysql database adaptors 
and got no response.
It is really important that i get this problem 
sorted now if possible as my final year project for university depends on this 
'bug' getting fixed.

If you can give me help on this or point me in the 
direction of someone who can, i'd be grateful

Cheers

Alan


Re: [Zope] Adding users with a PythonMethod

2001-01-23 Thread Dieter Maurer

Curtis Maloney writes:
   I'm trying to add a users from within a PythonMethod.  I have searched this 
  list and found examples of how to add via DTML, but they all seem to require 
  REQUEST.
  ...
   So, what I'm left to conclude is it's easier to add a new user from DTML 
  than it is from a PythonMethod.
Can't be!

You can use REQUEST in a PythonMethod, too.
Either pass it explicitly as parameter or
use "self.REQUEST" to access it.



Dieter

___
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] LocalFS and PathHandler

2001-01-23 Thread Dieter Maurer

Ulrich Wisser writes:
  How can I detect if mylfs is a file or a directory?
I fear that is a difficult question.

  For unknown reasons, the builtin Python function "type" is
  considered unsafe (and would not help anyway). Thus,
  you cannot test for types.

  In PythonScript you have the function "same_type"
  that can be used to check whether two type
  are identical.
  I do not know, how well this function works with
  acquisition wrappers.

  There there is "isinstance". As I heard (but did not
  verify) there should be problems with ExtensionClass
  and Acquisition, as well.

Thus, I would not try to determine, whether it is a directory
or file. Instead, I would go for the interface based approach.
Ask yourself, what operations you would need for a directory
or file, respectively. Check for these operations to
differenciate between the two.


Dieter

___
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] Upload file and :int with :required and

2001-01-23 Thread Dieter Maurer

Hi Diego,

Diego Rodrigo Neufert writes:
  When I use dtml-unless "attach_file.filename"
  
  I got a NameError
This must be "NameError 'attach_file'", right?

  Do you know a solution to this? because when I dont specify anything in a 
  field zope just dont know about it...
Apparently, browsers behave differently. My Netscape 4.7
interpretes an empty file control as successful and sends
the corresponding name/value pair (with empty value).

To handle both behaviours, you can use:

  dtml-unless "REQUEST.form.has_key('attach_file') and attach_file.filename"
!-- error; empty file control --
  /dtml-unless


Dieter

___
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] EMail with uploaded attachments

2001-01-23 Thread Dieter Maurer

Klaus Herrmann writes:
  ... Email with file attachment ...
  dtml-sendmail mailhost=fox
  To: ...
  From: ...
  Subject: ...
  dtml-mime type=text/plain encode=7bit
  
  plain text
  
  dtml-boundary type=application/octet-stream
  disposition=attachment encode=base64
  dtml-var attached_file/dtml-mime
  
  /dtml-sendmail
Almost perfect.

Use
   dtml-var "attached_file.read()"/dtml-mime
instead.


Dieter

___
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] Limited folderish objects

2001-01-23 Thread Dieter Maurer

Nolan Darilek writes:
  The Folder class offers quite a bit of the functionality which I need
  for a current project. However, what I'm attempting to create isn't a
  traditional folder for DTML objects, methods, etc. Instead, I'm
  creating a folder which contains subfolders which are intended for
  specific objects. The "available objects" list in the parent folder
  should only allow the creation of a certain type of object.
  
  So, how can I do this? I was told that I could modify the permissions
  on the folder to prevent other objects from being added, and this
  seems to be confirmed by what I managed to find out about
  filtered_meta_types, but I'm not sure. Can anyone offer any advice?
You should search the (searchable) list archive.
You will find at least one thread that discusses this issue.

You may also find a HowTo at zope.org.


Dieter

___
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, database field formats, output format of queries

2001-01-23 Thread Dieter Maurer

Michael Schmidt writes:
  On Mon, Jan 22, 2001 at 07:50:45PM +0100, Dieter Maurer wrote:
   What do you mean with a Zope based database?
   
   If you mean an external database, look for the datatypes and
   restrictions, they support for column values. SQL 3 may
   give you some of what you want.
  
  The wording of "Zope based database" may cause a misunderstanding, 
  what I really meant was a database behind Zope or a database 
  accessed through the interface of Zope.
That is what I have called an external database.
You may look what constraints the database allows to define
for field values.

   Whether internal or external, you can control what goes through
   Zope to your database. You will probably need External Methods to
   get the full Python power, see "python.org" for documentation
   about Pythons vast library.
   You will be especially interested in the "re" module.
   It implements (Perl style) regular expressions.
  
  Do these also achieve error handling?
No.
They allow you to check whether the conditions are met.
You are free to decide what you do in this case.
The easiest thing is to raise an exception.
This results in a preconfigured error response, which
probably is not too useful.

You may look for a recent message to this list about
DTML contracts. It may give you most of what you want.


Dieter

___
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] dtml-tree causing authorization errors

2001-01-23 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  I've stumbled upon a strange problem with dtml-tree in version 2.2.5 (the
  problems occurs in the same way in any of the 2.2.x version), but didn't exhibit
  itself in 2.1.6:
You should read Brian's excellent "Upgrade to 2.2.x" document.
It will explain you the changes in the protection policy
and what class authors must do that the instances do not
throw Unauthorized exceptions when accessed.


Dieter

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




  1   2   >