Re: [Zope-dev] Images and Products

2001-03-27 Thread Andre Schubert

Hi,

i have found the error. I had somewhere definded '' in a Permission wich is
the same as index_html. And this permission was not set to Anonymous.

as

Dieter Maurer schrieb:

 Andre Schubert writes:
   I have a little Problem on using Images in my Product.
   If i'am logged in as Manager i can View the Image, but if logged in as
   Anonymous i can't view the Image.
   The View permission is assigned to Anonymous Role and the Image Foo is
   assing to the View Permission, but i can't view the Image as Anonymous.
  
   Source:
   __ac_permissions=(
   
   ('View', ('index_html','Foo'), ('Manager',)),
 As Chris already pointed out:

   ^
 does not work.

   Foo = ImageFile('icons/foo.gif',globals())
  
   Link:
   http://www.somewhere.de/myProduct/Foo
 Access permissions are controlled by the permission
 of "ImageFile.index_html" which requires view permission.

 I expect, you have somehow broken the acquisition chain.
 Does your product inherits "Acquisition.{Ex|Im}plicit"
 or at least "ExtensionClass.Base"?
 If not, Zope's permission machinery will not work.

 Dieter

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


___
Zope-Dev 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] Compiling Zope from source on Windows

2001-03-27 Thread Phil Harris

This is too cool, works great!

Compiled first time and run first time.

Serving pages already, too cool.



- Original Message -
From: "Chris McDonough" [EMAIL PROTECTED]
To: "Brian Lloyd" [EMAIL PROTECTED]; "Andy McKay"
[EMAIL PROTECTED]; "Chris Withers" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, March 26, 2001 7:51 PM
Subject: Re: [Zope-dev] Compiling Zope from source on Windows


 Oh my god.  ;-)

 - Original Message -
 From: "Brian Lloyd" [EMAIL PROTECTED]
 To: "Andy McKay" [EMAIL PROTECTED]; "Chris Withers"
 [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, March 26, 2001 1:24 PM
 Subject: RE: [Zope-dev] Compiling Zope from source on Windows


  FYI: I've finally had time to finish my present :)
 
 
  http://www.zope.org/Members/Brian/Misc/ExtensionBuilder/
 
 
  Brian Lloyd[EMAIL PROTECTED]
  Software Engineer  540.371.6909
  Digital Creations  http://www.digicool.com
 
 
 
 
   -Original Message-
   From: Andy McKay [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, March 22, 2001 12:58 PM
   To: Chris Withers; Brian Lloyd
   Cc: [EMAIL PROTECTED]
   Subject: Re: [Zope-dev] Compiling Zope from source on Windows
  
  
   Wouldnt be anything to do with SQL would it? Brian did help me a
   while ago,
   I will have a look and see if I can find anything helpful... ;)
   --
 Andy McKay.
  
  
   - Original Message -
   From: "Chris Withers" [EMAIL PROTECTED]
   To: "Brian Lloyd" [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Sent: Thursday, March 22, 2001 9:47 AM
   Subject: Re: [Zope-dev] Compiling Zope from source on Windows
  
  
Brian Lloyd wrote:

  What I'm really looking for is how to compile Zope
  from source on Windoze.  Anybody?

 I sent some info to Chris Withers recently, who promised
 to make it into a how-to. I'd say it's time to call him
 on it :)
   
I haven't got it to work yet ;-)
   
cheers,
   
Chris
   
PS: You'll see one of the things that's been sucking my time in a
 minute
   or two
on [EMAIL PROTECTED] ;-)
   
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )
   
  
  
 
 
  ___
  Zope-Dev 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 )



[Zope-dev] LoginManager question

2001-03-27 Thread Bertrand Croq

Hi,
  I am currently using LoginManager to authenticate users from a MySQL 
database. I followed the tutorials and it works quite well; but there are 
other data associated with users in the database that I would like to use in 
Zope. I have found a solution but I think it is quite complicated:

- first, I added SQL_id_user (ZSQL-method) in the acl_users:

select id_user
from user
where dtml-sqltest username column=user_name type=string

- then, I added id_user (DTML-method) in the acl_users:

dtml-in expr="SQL_id_user(username=username)"
  dtml-return id_user 
/dtml-in

- now, when I want to get the id_user value associated with the current user, 
I need to do:

dtml-with REQUEST
 dtml-var
  expr = "AUTHENTICATED_USER.id_user(
   AUTHENTICATED_USER,
   username=AUTHENTICATED_USER
  )"
 
/dtml-with

Isn't there an easier way to get the id_user value?

-- 
Bertrand Croq - VIRTUAL NET (http://www.virtual-net.fr)
80, avenue des Buttes de Coesmes - 35700 RENNES
tel: +33 2 23 21 06 30 - fax: +33 2 99 38 16 85

___
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] FTP interface being worked on?

2001-03-27 Thread Steve Spicklemire


Hi Fred,

 "Fred" == Fred Wilson Horch [EMAIL PROTECTED] writes:

Fred Wanted to follow up on Steve's points.

Fred I don't know if we need just one serialization interface
Fred that tries to solve all five issues.

Ok.. 

Fred We currently have two serialization interfaces in Zope:

Fred  1) the FTP interface, and 2) the XML export interface.

Fred Seems to me that the FTP interface could be generalized as
Fred the "lossy" serialization interface that is "morally human
Fred readable" and the XML export interface could be tweaked a
Fred bit as "lossless" but "morally binary".

Fred The FTP interface would be used when you want a
Fred representation that can be edited by hand.  It solves C, D
Fred and E, but not A and B.

Fred The XML interface would be used when you want a
Fred representation that can be manipulated programmatically.  It
Fred solves A and B, but not C, D and E.

Hmm.. maybe I'm misuderstanding... which would/could you use for
version control? It still seems to me that a blend of these could be
developed that would work in all cases. An object could have a human
readable part/aspect and 'the rest' could be captured as an xml
bloblet. The 'human editable' part could just be what you get on the
FTP interface (as you say), and the rest could be saved/restored to a
'auxiliary' file that would track other aspects of the object.  Since
objects could implement their own serialization, they could decide
what aspects belonged in which part.  Otherwise I can't help feeling
that we'd have problems with duplicated versions, some xml/zexp, some
human-readable that would inevitably stomp on eachother in any version
control scenario. If all this could be worked in to the existing
FTP/export/import system... there would be a minimum impact on 
existing interfaces.

Fred FWIW, I'm working on tweaking the XML export/import code to
Fred serialize object hierarchies as directories and files,
Fred rather than exporting a single file.

Cool.. this sounds like a promising approach. I'd be interested
in testing this.. 

thanks!
-steve

Fred Fred

Fred P.S.  The link Karl sent
Fred (http://www.thetwowayweb.com/theXmlFiles) is interesting.
Fred -- Fred Wilson Horch mailto:[EMAIL PROTECTED] Executive
Fred Director, EcoAccess http://ecoaccess.org/ P.O. Box 2823,
Fred Durham, NC 27715-2823 phone: 919.419-8354


___
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] FTP interface being worked on?

2001-03-27 Thread Chris Withers

Steve Spicklemire wrote:
 
 Fred FWIW, I'm working on tweaking the XML export/import code to
 Fred serialize object hierarchies as directories and files,
 Fred rather than exporting a single file.
 
 Cool.. this sounds like a promising approach. I'd be interested
 in testing this..

Indeed :-)

A slight further tweak... I'd love to be able to tick a group of objects and hit
the export button. Maybe the stuff Fred is looking at could be bent to do that?

cheers,

Chris

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



[Zope-dev] filter metatypes in objectmanager

2001-03-27 Thread Magnus Heino


How can I control what meta_type's that can be added to an ObjectManager?

If you create a ZClass that inherits from ObjectManager, you can specify 
this, but how is it done from a python product?

/Magnus


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



Re: [Zope-dev] filter metatypes in objectmanager

2001-03-27 Thread Jens Vagelpohl

define a method with the name "all_meta_types" inside your class and have it
return the correct information, like this:



import Products

def all_meta_types(self):
""" What can you put inside me? """
f = lambda x: x['name'] in ('DTML Method', 'DTML Document')
return filter(f, Products.meta_types)



Products.meta_types contains information about all available meta types and
you need to filter out what you need.

jens




on 3/27/01 7:44, Magnus Heino at [EMAIL PROTECTED] wrote:

 
 How can I control what meta_type's that can be added to an ObjectManager?
 
 If you create a ZClass that inherits from ObjectManager, you can specify
 this, but how is it done from a python product?
 
 /Magnus


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



Re: [Zope-dev] FTP interface being worked on?

2001-03-27 Thread R. David Murray

On 26 Mar 2001, Karl Anderson wrote:
 Is there a particular set of tools or editing paradigms that we have
 in mind when we say that a non-XML representation is suited for client
 side tools?

I think the prime current example of this is the way you can use
any text editor to edit the serialized format of a pythonscript:
metadata is included in the serialized format as header lines.
The fact that this is *very* pythonscript specific is the motivation
for a class-implemented serialization format, IMO.  When possible,
the metadata *ought* to go in the same file as the body, simply
because it makes the human edit cycle more convenient/faster, thus raising
productivity.  Again, I'm focusing on "editing via arbitrary external
text editing tools" here, and not CVS, but if the conversion is
invariant, it works for CVS too.

--RDM


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



[Zope-dev] Zope/OpenBSD: Too many open files

2001-03-27 Thread Ricardo Bermell

Zope (started from a shell) in OpenBSD gets locked 
too easyly because of the low default limit for 
open file descriptors (64).   

When Zope gets locked shows repeatedly this message
"PROBLEM(100) ZServer warning: server accept() threw an exception",
locking effectively also the console.

Conditions in wich i have tested the problem:

- OpenBSD 2.7
- Zope 2.3.0 
- 'bash' shell

How to reproduce the problem:

1. Anotate your current limit for open files
   (after this test you will want to restore this value):
   type "ulimit -a | grep 'open files'"
   My systems gives "open files   64"

2. If you want to crash zope sooner, set a lower limit 
   (for example, 32) with "ulimit -n 32".

3. Start Zope from your shell (mine is 'bash') with 
   zope 'start' script.

   Before, in the call to z2.py (in 'start') include option 
   -D for 'debugging' (if not, all will be the same, exept 
   that you won't see the "Problem(100)" message

4. Type "fstat | grep run-zope | grep stream | wc -l",
  (where 'run-zope' is the user account you use to run zope)

  or "fstat | grep 11789 | grep stream | wc -l"
  (where '11789' is the pid of zope process)

  That gives you the number of open streams for zope,
  which initially is 1.

  Each open stream consumes one file descriptor.

5. From a browser of another computer, open any (one) page
   of your zope site (http://your.zope.server:8080, where 
   8080 is the port you've open for zope).

   That will open 2 tcp streams in your server. 
   Test, as before: "fstat | grep run-zope | grep stream | wc -l"
   This gives me 3 streams in total (1 initial + 2 for browser)

6. Close your browser and see how the open streams persists
   Type again: "fstat | grep run-zope | grep stream | wc -l"
   You will see 3 yet.

7. Repeat this operation many times (open browser, get http page,
   close browser), observing how the number of open streams increases 
   in steps of 2.

   After m repetitions your browser does not get response from Zope:
   your Zope service and your console stops attending requests.

8. Stop your Zope from another console. (This liberates also
   the locked console)

9. Test distinct values for 'ulimit -n'. You will observe that, 
   for a given value of 'ulimit -n' the number of repetitions (m) 
   needed to hang your zope will be always the same.

   (You must run 'ulimit -n' _before_ run zope for it to get effect,
   not _while_ running zope)


Questions which i'm not able to answer:

- How many time an open tcp stream lives after you open a page from
  your browser?

- How many time an open tcp stream lives after you close the browser
  (wich originated the stream)?

the answer to those two questions will help to know:

- How can i predict an adequate number for 'ulimit -n' (max. number of
  file/stream descriptors) in function of the utilization of my server?

Unknowing wich is the perfect election, i've selected a limit of 1024

- Is it too many 1024? Too many resources utilization? 

But, the main question, IMHO, is that:

- It is Zope robustness what fails. It should deny access gracefully when
  resources are exhausted. (Or at least, it should give comprehensive error
  information). Is it so? Or is it a wrong observation? 

I am now using zope only for developing static pages, not for a public 
dynamic service, and the 'ulimit' patch suffices, but i am afraid for 
when i'll want to put it in a public service with a heavy load.


-- Ricardo




P.S. I have tested also Zope 2.2.4 and 2.3.1b1 in OpenBSD. 
I didn't perform the 'ulimit' test in these versions but i do 
have experienced the "PROBLEM(100)" error (or similar).
I have tested Zope 2.3.1b1 and 2.3.0 thru Apache and standalone.
When thru Apache: with pcgi and with fastcgi.
When with fastgi: with port and with socket.


___
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] FTP interface being worked on?

2001-03-27 Thread Fred Wilson Horch

Hi Steve,

You wrote:
 
 Fred We currently have two serialization interfaces in Zope:
 Fred  1) the FTP interface, and 2) the XML export interface.
 
 Hmm.. maybe I'm misuderstanding... which would/could you use for
 version control?

The XML interface.

 It still seems to me that a blend of these could be
 developed that would work in all cases. An object could have a human
 readable part/aspect and 'the rest' could be captured as an xml
 bloblet. The 'human editable' part could just be what you get on the
 FTP interface (as you say), and the rest could be saved/restored to a
 'auxiliary' file that would track other aspects of the object.  Since
 objects could implement their own serialization, they could decide
 what aspects belonged in which part.  Otherwise I can't help feeling
 that we'd have problems with duplicated versions, some xml/zexp, some
 human-readable that would inevitably stomp on eachother in any version
 control scenario. If all this could be worked in to the existing
 FTP/export/import system... there would be a minimum impact on
 existing interfaces.

That was my original sentiment, too.

But Chris McDonough's proposal
(http://dev.zope.org/Wikis/DevSite/Proposals/RepresentingObjectsOnTheFilesystem)
seems to allow developers to ignore any 'auxiliary' information that is
not easy to serialize.

I've come around to the viewpoint that the FTP interface (which in my
opinion is what Chris' proposal is replacing) could just be used for
editing objects one at a time.  You can afford not to represent some
information in this situation.  It is just like through the web editing,
but allows you to use emacs or Microsoft Word (or whatever client side
tools you have that work with files on your filesystem).

 Fred FWIW, I'm working on tweaking the XML export/import code to
 Fred serialize object hierarchies as directories and files,
 Fred rather than exporting a single file.
 
 Cool.. this sounds like a promising approach. I'd be interested
 in testing this..

The reason I'm working on this is that I think the XML serialization is
what developers should use for source control / configuration
management.

There are really only two major problems with the existing XML
serialization functionality that prevent us from using it with CVS:

1) everything is serialized to a single monolithic XML export file, and
2) you cannot update existing objects from an XML export file

Hopefully I will have some code soon based on the existing export code
that allows you to export any part of the object tree as a hierarchy of
directories and files in Python Pickle Markup Language (ppml - the
format used by the existing XML export), and import ppml files to update
existing objects in the ZODB.

By the way -- is it me, or is the current Import/Export interface
broken?  I tried to select multiple objects to export, but I can only
get the first one to actually be exported.

Fred
-- 
Fred Wilson Horch   mailto:[EMAIL PROTECTED]
Executive Director, EcoAccess   http://ecoaccess.org/
P.O. Box 2823, Durham, NC 27715-2823phone: 919.419-8354

___
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] FTP interface being worked on?

2001-03-27 Thread Christian Scholz

Hi!

 By the way -- is it me, or is the current Import/Export interface
 broken?  I tried to select multiple objects to export, but I can only
 get the first one to actually be exported.

It's not just you.. but never thought about whether this might be
a bug ;-)

-- christian

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

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



Re: [Zope-dev] LoginManager question

2001-03-27 Thread Phillip J. Eby

At 12:19 PM 3/27/01 +0200, Bertrand Croq wrote:
Hi,
  I am currently using LoginManager to authenticate users from a MySQL 
database. I followed the tutorials and it works quite well; but there are 
other data associated with users in the database that I would like to use in 
Zope. I have found a solution but I think it is quite complicated:

- first, I added SQL_id_user (ZSQL-method) in the acl_users:

select id_user
from user
where dtml-sqltest username column=user_name type=string

- then, I added id_user (DTML-method) in the acl_users:

dtml-in expr="SQL_id_user(username=username)"
  dtml-return id_user 
/dtml-in

- now, when I want to get the id_user value associated with the current
user, 
I need to do:

dtml-with REQUEST
 dtml-var
  expr = "AUTHENTICATED_USER.id_user(
   AUTHENTICATED_USER,
   username=AUTHENTICATED_USER
  )"
 
/dtml-with

Isn't there an easier way to get the id_user value?


Yes, there is.  Get rid of the "id_user" DTML method and add the following
to a SkinScript method inside your UserSource:

WITH QUERY SQL_id_user(username=self.id) COMPUTE id_user

You should then be able to do "AUTHENTICATED_USER.id_user" to retrieve the
attribute.  


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



[Zope-dev] ANN: Zope Page Templates 1.0.0 beta 1

2001-03-27 Thread Evan Simpson



The first beta release of ZPT is 
ready!

Come read about them at http://dev.zope.org/Wikis/DevSite/Projects/ZPT, 
and download from http://www.zope.org/Members/4am/ZPT.

These should be especially interesting for teams of 
Zope developersin whichthe programming and page/site design tasks 
are handled by separate people.

Cheers,

Evan @ digicool


Re: [Zope-dev] FTP interface being worked on?

2001-03-27 Thread Karl Anderson

"Chris McDonough" [EMAIL PROTECTED] writes:

   Are you thinking that we would build client-side tools to recognize an
 XML
   representation of a subpart of a site?
 
  Client-side tools, no.  I'm thinking that exporting to XML would allow
  existing tools to recognize and manipulate a subpart of a site.
 
 Which ones?

Parsers, transformers, etc..  I don't know of any end-user tools (are
there any?), I'm talking about building blocks.

  Is there a particular set of tools or editing paradigms that we have
  in mind when we say that a non-XML representation is suited for client
  side tools?
 
 Yes.. anything that works well with diff and CVS and is recognizable by a
 human.  PythonScripts should be serialized to something that looks like a
 regular Python script.  Images should look like images, etc.  The directory
 tree generated should look as much as possible like a normal filesystem.

Sure, I would use that, too, probably more than an XML representation,
I'm referring to the ability to represent in other formats because of
their usefulness and scalability.

For example, if I were doing lots of random edits on a subtree of
DTML files and Python scripts, I'd want them to look like a filesystem
tree full of text files and I'd use emacs, grep, find, etc. on them.
If I wanted to be able to use an automated tool to, say, update the
spam and eggs fields of everyting in a subtree every friday, an XML
parser and/or DOM tree and/or transform working on a single XML
representation of the subtree checked out to the local filesystem
seems like the easiest entry point.

I'm probably straying from the proposal here.

-- 
Karl Anderson  [EMAIL PROTECTED]

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



[Zope-dev] ZPatterns, DataSkins, forms and error checking/handling

2001-03-27 Thread Itai Tavor

Hi,

I'm trying to work out the best way to check for and report errors 
when DataSkin objects are created/edited, but I'm having a lot of 
problems.

For form validation, Zope's build-in constraints are pretty 
useless... things like ValueHandler are a little better, but IMO not 
good enough. When a user types incorrect data in a form, I don't want 
to display a page with a list of errors and say "click Back to fix 
your errors". I want to return the form, with a list of errors and 
the bad fields highlighted. So I need to perform field checks in the 
form action method and in case of errors call the original form, 
giving it an error list.

I know that to ensure that object data is always valid I should 
validate the object in a SkinScript, using WHEN OBJECT ADDED,CHANGED 
call self.validate(), and raise an exception in validate in case of a 
problem. But this can't deal with returning the original form. It can 
only display error pages, and to display nicely formatted error pages 
it has to return a DTML Method so I can use dtml-raise, rather than 
directly do raise in validate.

So I'm looking at a validate method for use at commit time, a 
show_errors DTML Method, and a validate_form to call from the form 
action method...

The validate_form method is defined in the DataSkin class. But it is 
also used when a new object is created from a form, so it needs to be 
called from a Specialist before the object is created, so I need to 
import it in the Specialist. But this method might use other methods 
of the DataSkin class, so I need to import those too...

So, to sum up, I need a method used in commit time, that renders a 
DTML method to raise an error message, another method to verify form 
submissions and return the form with error messages, and I need to 
import that method and all other methods it uses into the Specialist. 
This seems too much work...

Can anyone suggest a simpler approach (one that still retains the 
ability to return the original form in case of errors)?

TIA, Itai
-- 
--
Itai Tavor  -- "Je sautille, donc je suis."--
[EMAIL PROTECTED]--   - Kermit the Frog --
-- --
-- "If you haven't got your health, you haven't got anything"  --


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