[Zope-dev] More ZPatterns confusion

2000-11-26 Thread bentzion

I am trying to add a ZClass with a DataSkin Property sheet to a 
Virtual Rack. So I call the following:
dtml-let ni="newItem(key=REQUEST['key'])"
  props="ni.propertysheets.get('Basic')"
dtml-call "props.manage_changeProperties(REQUEST.form)"
/dtml-let

I assume this should call ADDED and CHANGE trigger's to place data 
in my SQL Database.
Unfortunately this is not happening. The ADDED trigger is doing the 
initial creation, but the changeProperties is not effecting the 
right changes. It seems that the CHANGE trigger is not getting 
called.

Is there something else I should be doing?
Thanks for all the help




___
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] How to get rid of obsolete Permissions

2000-11-26 Thread Joachim Schmitz

how can I get rid of the permissions defined for a ZClass, after I deleted
the ZClass, all permissions for all ZClasses I ever created are still around
and pollute my security or permission management screens.


Mit freundlichen Grüßen

Joachim Schmitz  

  
AixtraWare, Ing. Büro für Internetanwendungen
Hüsgenstr. 33a, D-52457 Aldenhoven  
Telefon: +49-2464-8851, FAX: +49-2464-905163


___
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] SQL-Methods Through-the-FileSystem

2000-11-26 Thread Johan Carlsson


Hi all,
Does anybody have a good suggestion how to
develope SQL Method ftfs (through the filesystem)
rather than ttw.

Perferably in someway similare to the HTMLFile way 
to include DTML methods in Zope classes.

Regards,
Johan


(One problem I recently discovered was the fact that
SQl methods makes "hardlinks" to SQL connection when 
changed. So if I move the SQL connection to some other
place in the aq-path I need to update the methods. 
This make it hard because the SQL method seems to
point to the right connection but it doesn't, in other
words been very confusing for users.)


torped
johan carlsson
birkagatan 9
113 36 stockholm
[EMAIL PROTECTED]
www.torped.se
voice +46-(0)-8-32 31 23
mobil +46-(0)-70-558 25 24

workshop
västmannagatan 67



___
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 Through-the-FileSystem

2000-11-26 Thread Ender

Johan Carlsson wrote:
 
  Seb:
   Does anybody have a good suggestion how to
   develope SQL Method ftfs (through the filesystem)
   rather than ttw.
  
   Perferably in someway similare to the HTMLFile way
 
  try something like this:
 
from Products.ZSQLMethods.SQL import SQL
import PoPy
 
def manage_add_user(self,email,password):
 
  conn = 'PoPy_database_connection'
  self.sql_add_user=SQL('sql_add_user', '', conn, 'email password', 
_sql_add_user)
 
  _sql_add_user = """
  insert into tbl_users(email,password)
  values (
dtml-sqlvar email type=string,
dtml-sqlvar password type=string
  )
  """
 
 Hi Seb,
 
 I guess I could skip putting it in a method and create the SQL instance
 as a attribute of the class (that I currently would be working on)?

yes

 Why do I need to import the database module?

sql methods are bound to database connections, you could instantiate one
without, but than you wouldn't be able to use it. 

 Couldn't I just try to locate/create a DA when my class is instantiated?

you could, the search routine in /lib/python/Products/ZSQLMethods/SQL.py
is a good starting point

 Would it be poor design to create a DA connection as an attribute of the class?
 Or would it be perferd to create it in the __init__ as a instance attribute?

do you really want to create a new db connection for every instance of
your class?


kapil

___
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] RFC: Python/Zope Interfaces

2000-11-26 Thread Dieter Maurer

Michel Pelletier writes:
  Also, defining the interface seperately keep the two things apart,
  impementation and interface, and doesn't allow you to sneak in a new
  method unless you also sneak it into the interface, thus making a
  stronger "contract" with the user.
I am a bit astonished by this statement:

  I know the "design by contract" concept from Bertrand Meyer,
  the Eiffel developper.

  In Eiffel, essential parts of the contract, among others
  method prototype, pre- and post-conditions as well as invariants
  are build directly into the language.
  A documentation tool extracts these parts
  from the source to generate the interface, for people
  that are only interested in how to use the class/method.

  Programms can be executed in a way, that the various
  (executable) contract parts can be checked at runtime.
  *THIS* provides for quite a strong contract.


I cannot see, why the separation of interface and implementation
should make the contract stronger. I do see, however, that it
makes it more likely to be broken by the implementation.

It is a very good thing to have the specification very near
to the implementation -- as a permanent guide to the
implementor. It is even better, when big parts of the
specification becomes part of the executable code
(as is the case for Eiffel's pre- and post-conditions).

If you want to prevent your implementors to change the
interface specification, generate the interface for the
implementation and compare against your master copy.

In my view, it is better to have a somewhat "weaker" contract
that is met by the partners than a "stronger" contract that
is violated. Or, to say it differently, it is more essential
the a system's documentation describes faithfully what is
rather than what should be (but is not).


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] SQL-Methods Through-the-FileSystem

2000-11-26 Thread Johan Carlsson

 Johan Carlsson wrote:
  
   Seb:
Does anybody have a good suggestion how to
develope SQL Method ftfs (through the filesystem)
rather than ttw.
   
Perferably in someway similare to the HTMLFile way
  
   try something like this:
  
 from Products.ZSQLMethods.SQL import SQL
 import PoPy
  
 def manage_add_user(self,email,password):
  
   conn = 'PoPy_database_connection'
   self.sql_add_user=SQL('sql_add_user', '', conn, 'email password', 
_sql_add_user)
  
   _sql_add_user = """
   insert into tbl_users(email,password)
   values (
 dtml-sqlvar email type=string,
 dtml-sqlvar password type=string
   )
   """
  
  Hi Seb,
  
  I guess I could skip putting it in a method and create the SQL instance
  as a attribute of the class (that I currently would be working on)?
 
 yes
 
  Why do I need to import the database module?
 
 sql methods are bound to database connections, you could instantiate one
 without, but than you wouldn't be able to use it. 

What I mean is that if I acquired the DA connection, the import would be unnecessary?
 
  Couldn't I just try to locate/create a DA when my class is instantiated?
 
 you could, the search routine in /lib/python/Products/ZSQLMethods/SQL.py
 is a good starting point

Yes, I know, for ones I turned to zope-dev before diving into the source ;-)
 
  Would it be poor design to create a DA connection as an attribute of the class?
  Or would it be perferd to create it in the __init__ as a instance attribute?
 
 do you really want to create a new db connection for every instance of
 your class?

I might, if each instance should connect to  its own database.
For instance I could have different databases (with different user identities)
for different customers sharing the same host machine.

Thanks Seb and Ender, I really got a head start.
Johan




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