[Zope-dev] Referencial Integrity in ZCatalogs

2004-08-02 Thread Santi Camps
Hi all,
I've been developing database oriented applications for about 10 years, 
using zope with Relation DDBB for one year and a half, and just one year 
using Zope with ZODB in my applications.   At this point, I can see a 
lot of advantatges of use ZODB with Zope, but there are some points 
where the relational model was more useful to me. 
In fact, the main problem in my applications are relationships.   In a 
relational world, you can specify relations using foreign keys, and also 
say what action should be done on delete or on update (no action, set 
null, restrict, cascade, set default).   This is very useful developing 
business oriented applications. 
Using ZODB some of these relations can be done using containment:   If A 
contains B, this is the same of having a relation 1-N on delete cascade
Another case is to use a Relation Manager.   I've implemented and object 
Relation that is deleted when some of the two related objects are (using 
manage_beforeDelete).  This is the same that a relation M - N on 
delete cascade
The third case I've been implemented, and the one giving me more 
problems, is to have a property referencing another object (path or 
UID).  If the referenced object is dropped, the referer has problems

I work a lot with ZCatalogs, using one catalog for each meta_type of 
objects, so for me catalogs are the most similar thing to a Table.   
I'm thinking that could be very useful to implement some basic 
referencial integrity in ZCatalogs.   Just being able to define primary 
keys and some simple types of foreign keys we will have on Zope the best 
of two worlds.   Seeing code of ZCatalog product it seems not to be very 
difficult to implement, adding some validations on catalog_object and 
uncatalog_object methods.   Of course, all these should be optional.   I 
no Primary Keys neither Foreign Keys are defined, catalogs should work 
exactly like until now.

What do you think about this ?  If nobody convince me that this is a 
stupid work, I will try to implement it.   In this case, what's the 
better way to provide the code ?  A patch for ZCatalog ?  Or a new 
Product IntegrityZCatalog inheriting from ZCatalog ?

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


Re: [Zope-dev] Referencial Integrity in ZCatalogs

2004-08-02 Thread Roché Compaan
Have a look at Archetypes, it does what you want.
http://sourceforge.net/projects/archetypes
--
Roché Compaan
Upfront Systems http://www.upfrontsystems.co.za
Santi Camps wrote:
Hi all,
I've been developing database oriented applications for about 10 years, 
using zope with Relation DDBB for one year and a half, and just one year 
using Zope with ZODB in my applications.   At this point, I can see a 
lot of advantatges of use ZODB with Zope, but there are some points 
where the relational model was more useful to me. In fact, the main 
problem in my applications are relationships.   In a relational world, 
you can specify relations using foreign keys, and also say what action 
should be done on delete or on update (no action, set null, restrict, 
cascade, set default).   This is very useful developing business 
oriented applications. Using ZODB some of these relations can be done 
using containment:   If A contains B, this is the same of having a 
relation 1-N on delete cascade
Another case is to use a Relation Manager.   I've implemented and object 
Relation that is deleted when some of the two related objects are (using 
manage_beforeDelete).  This is the same that a relation M - N on 
delete cascade
The third case I've been implemented, and the one giving me more 
problems, is to have a property referencing another object (path or 
UID).  If the referenced object is dropped, the referer has problems

I work a lot with ZCatalogs, using one catalog for each meta_type of 
objects, so for me catalogs are the most similar thing to a Table.   
I'm thinking that could be very useful to implement some basic 
referencial integrity in ZCatalogs.   Just being able to define primary 
keys and some simple types of foreign keys we will have on Zope the best 
of two worlds.   Seeing code of ZCatalog product it seems not to be very 
difficult to implement, adding some validations on catalog_object and 
uncatalog_object methods.   Of course, all these should be optional.   I 
no Primary Keys neither Foreign Keys are defined, catalogs should work 
exactly like until now.

What do you think about this ?  If nobody convince me that this is a 
stupid work, I will try to implement it.   In this case, what's the 
better way to provide the code ?  A patch for ZCatalog ?  Or a new 
Product IntegrityZCatalog inheriting from ZCatalog ?

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


Re: [Zope-dev] Referencial Integrity in ZCatalogs

2004-08-02 Thread Russ Ferriday
Take a look at archetypes on Plone.org, and download a version from sf.net.
Look in particular at the ReferenceEngine, based on the catalog, and note that there have been implementation changes, and there's a new beta version.
Ben Saller and Kapil Thangavelu were part of the team responsible for Archetypes.
--r.
On 2 Aug 2004, at 12:46, Santi Camps wrote:

Hi all,

I've been developing database oriented applications for about 10 years, using zope with Relation DDBB for one year and a half, and just one year using Zope with ZODB in my applications.   At this point, I can see a lot of advantatges of use ZODB with Zope, but there are some points where the relational model was more useful to me. In fact, the main problem in my applications are relationships.   In a relational world, you can specify relations using foreign keys, and also say what action should be done on delete or on update (no action, set null, restrict, cascade, set default).   This is very useful developing business oriented applications. Using ZODB some of these relations can be done using containment:   If A contains B, this is the same of having a relation 1->N on delete cascade
Another case is to use a Relation Manager.   I've implemented and object Relation that is deleted when some of the two related objects are (using manage_beforeDelete).  This is the same that a relation M -> N on delete cascade
The third case I've been implemented, and the one giving me more problems, is to have a property referencing another object (path or UID).  If the referenced object is dropped, the referer has problems

I work a lot with ZCatalogs, using one catalog for each meta_type of objects, so for me catalogs are the most similar thing to a Table.   I'm thinking that could be very useful to implement some basic referencial integrity in ZCatalogs.   Just being able to define primary keys and some simple types of foreign keys we will have on Zope the best of two worlds.   Seeing code of ZCatalog product it seems not to be very difficult to implement, adding some validations on catalog_object and uncatalog_object methods.   Of course, all these should be optional.   I no Primary Keys neither Foreign Keys are defined, catalogs should work exactly like until now.

What do you think about this ?  If nobody convince me that this is a stupid work, I will try to implement it.   In this case, what's the better way to provide the code ?  A patch for ZCatalog ?  Or a new Product IntegrityZCatalog inheriting from ZCatalog ?

Thanks

Santi Camps

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


Russ Ferriday
Solution Workshops for Plone 
(+44) (0) 7789 338868
http://www.solutionworkshops.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Referencial Integrity in ZCatalogs

2004-08-02 Thread Santi Camps
En/na Roché Compaan ha escrit:
Have a look at Archetypes, it does what you want.
http://sourceforge.net/projects/archetypes
I think you are talking about SQLStorage of Archetypes.   Storing some 
attributes in a Relational Database and using foreign keys in it can 
solve the problem.  But I have some inconveniences to use Archetypes:
1) I don't use CMF.  My applications aren't content management 
applications, but business oriented applications.
2) I like to distribute my applications without needing BBDD 
installation.   Just download and run.   Having a relational database 
backend will need some extra installation

In any case, use SQLStorage without CMF could be interesting.   I don't 
know if it is possible.   Do you know ?

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


Re: [Zope-dev] Referencial Integrity in ZCatalogs

2004-08-02 Thread Roché Compaan
Santi Camps wrote:
En/na Roché Compaan ha escrit:
Have a look at Archetypes, it does what you want.
http://sourceforge.net/projects/archetypes
I think you are talking about SQLStorage of Archetypes.
I was actually thinking of the implementation of References, which uses 
the ZCatalog in manner you described.

Storing some 
attributes in a Relational Database and using foreign keys in it can 
solve the problem.  But I have some inconveniences to use Archetypes:
1) I don't use CMF.  My applications aren't content management 
applications, but business oriented applications.
2) I like to distribute my applications without needing BBDD 
installation.   Just download and run.   Having a relational database 
backend will need some extra installation
You should be able to strip away CMF dependencies, but why bother. We 
develop business applications with Archetypes on top of CMF.

--
Roché Compaan
Upfront Systems http://www.upfrontsystems.co.za
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Referencial Integrity in ZCatalogs

2004-08-02 Thread Santi Camps
En/na Russ Ferriday ha escrit:
Take a look at archetypes on Plone.org, and download a version from 
sf.net.
Look in particular at the ReferenceEngine, based on the catalog, and 
note that there have been implementation changes, and there's a new 
beta version.
Ben Saller and Kapil Thangavelu were part of the team responsible for 
Archetypes.
--r.
Um, this seems something more what I'm looking for.  I can see that 
ReferenceEngine and Referenceable implements some referential at object 
level.  I was thinking about to do it at catalog level, maintaining a 
paralelism with a referential model, where catalog = table.   But making 
an implementation like Archetypes one is another good option, of course.

Unfortunately, I don't use CMF in my application.   I use a structure of 
frames to work, and also a lot of javascript and DHTML, translatable 
javascript content, etc.  Working this way is easy don't use CMF that 
accommodate to it.

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


[Zope-dev] Zope 2.7.2, restrictedTraverse or hasattr

2004-08-02 Thread Kai Hoppert
Hi all,

i actually have a Problem with restrictedTraverse and hasattr.

Object1
Object2
Object3


I want to test if there exists a Object in Object3 wich has the same id and meta type 
how Object2 (id=myobject).
so i ask

Object3.restrictedTraverse('myobject',None) or

hasattr(Object3,'myobject')

i every time get's true back. I know that he jump's to Object2. i testet this with 
absolute_url, but this makes no sense i think. Either i never noticed that this both 
funktions works in this way or it is a bug. If it is no bug has anybody a solution for 
my problem?

Greetings

Kai Hoppert 
___
tomcom Gesellschaft für Informationstechnologie mbH
Heuriedweg 14 | D-88131 Lindau
Fon +49 (0)8382 975844 | Fax +49 (0)8382 975855
[EMAIL PROTECTED] | http://www.tomcom.de

This document should only be read by those persons to whom it is addressed and is not 
intended to be relied upon by any person without subsequent written confirmation of 
its contents.  tomcom disclaims all responsibility and accepts no liability for the 
consequences of any person acting, or refraining from acting on the contents of this 
document.  Any unauthorised form of dissemination, copying, disclosure, modification, 
distribution and/or publication of this message is strictly prohibited. For 
information about tomcom please contact us on +49.8382.975844 or visit our web site at 
www.tomcom.de


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


[Zope-dev] Re: Zope 2.7.2, restrictedTraverse or hasattr

2004-08-02 Thread Kai Hoppert
Ok found a solution in using aq_explicit

Greetings

Kai Hoppert 
___
tomcom Gesellschaft für Informationstechnologie mbH
Heuriedweg 14 | D-88131 Lindau
Fon +49 (0)8382 975844 | Fax +49 (0)8382 975855
[EMAIL PROTECTED] | http://www.tomcom.de

This document should only be read by those persons to whom it is addressed and is not 
intended to be relied upon by any person without subsequent written confirmation of 
its contents.  tomcom disclaims all responsibility and accepts no liability for the 
consequences of any person acting, or refraining from acting on the contents of this 
document.  Any unauthorised form of dissemination, copying, disclosure, modification, 
distribution and/or publication of this message is strictly prohibited. For 
information about tomcom please contact us on +49.8382.975844 or visit our web site at 
www.tomcom.de


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


[Fwd: Re: [Zope-dev] Referencial Integrity in ZCatalogs]

2004-08-02 Thread Leonardo Rochael Almeida
Forgot to Cc: zope-dev

-Mensagem encaminhada-
From: Leonardo Rochael Almeida [EMAIL PROTECTED]
To: Santi Camps [EMAIL PROTECTED]
Subject: Re: [Zope-dev] Referencial Integrity in ZCatalogs
Date: Mon, 02 Aug 2004 17:05:53 -0300

I would suggest you take a look at mxmRelations, however Zope.org
workflow is keeping it out of reach, and I couldn't find it on MaxM's
own site.

The URL for it would be:

http://www.zope.org/Members/maxm/products/mxmRelations

but right now it requires a login.

If any kind soul from the Zope web team could release it, or if MaxM
could post it somewhere else, that would be very nice.

Cheers, Leo

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


Re: [Zope-dev] Zope 2.7.2, restrictedTraverse or hasattr

2004-08-02 Thread Dieter Maurer
Kai Hoppert wrote at 2004-8-2 14:04 +0200:
i actually have a Problem with restrictedTraverse and hasattr.

Object1
   Object2
   Object3
   

I want to test if there exists a Object in Object3 wich has the same id and meta type 
how Object2 (id=myobject).
so i ask

Object3.restrictedTraverse('myobject',None) or

hasattr(Object3,'myobject')
 
i every time get's true back.

You can write a Script(Python) hasattr_unacquired
with parameters obj, attr and body

 return hasattr(obj.aq_inner.aq_explicit, attr)

Note that a solution without the aq_inner will often work
but is not reliable...


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


[Zope-dev] Re: Referencial Integrity in ZCatalogs

2004-08-02 Thread Casey Duncan
You should be able to access it now anonymously.

-Casey

On Mon, 02 Aug 2004 17:07:30 -0300
Leonardo Rochael Almeida [EMAIL PROTECTED] wrote:

 Forgot to Cc: zope-dev
 
 -Mensagem encaminhada-
 From: Leonardo Rochael Almeida [EMAIL PROTECTED]
 To: Santi Camps [EMAIL PROTECTED]
 Subject: Re: [Zope-dev] Referencial Integrity in ZCatalogs
 Date: Mon, 02 Aug 2004 17:05:53 -0300
 
 I would suggest you take a look at mxmRelations, however Zope.org
 workflow is keeping it out of reach, and I couldn't find it on MaxM's
 own site.
 
 The URL for it would be:
 
 http://www.zope.org/Members/maxm/products/mxmRelations
 
 but right now it requires a login.
 
 If any kind soul from the Zope web team could release it, or if MaxM
 could post it somewhere else, that would be very nice.
 
 Cheers, Leo
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )
 

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


Re: [Zope-dev] Syslog logger broken?

2004-08-02 Thread Paul Winkler
On Sun, Aug 01, 2004 at 06:20:19AM +0200, Andreas Jung wrote:
 
 
 --On Samstag, 31. Juli 2004 23:37 Uhr -0400 Paul Winkler 
 [EMAIL PROTECTED] wrote:
 
 Has anybody had success with the syslog logger in Zope 2.7.0 or later?
 AFAICT the example in zope.conf.in is borken.
 See http://collector.zope.org/Zope/1425
 
 Andreas assigned it to me, but I really have no clue
 how to fix it.
 
 
 
 hm...according to your report only the entries in the example are 
 broken...maybe I have to
 re-read again..

Yes, please do :-)
From the bug report:


The following is what I guess to be correct based on 
zLOG/component.xml, and it raises no errors, but I don't see any 
output either (maybe it's a problem with my /etc/syslog.conf):

logger trace
   level all
  syslog
 address localhost:514
  /syslog
/logger


-- 

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


Re: [Fwd: Re: [Zope-dev] Referencial Integrity in ZCatalogs]

2004-08-02 Thread Santi Camps
En/na Leonardo Rochael Almeida ha escrit:
Forgot to Cc: zope-dev
-Mensagem encaminhada-
From: Leonardo Rochael Almeida [EMAIL PROTECTED]
To: Santi Camps [EMAIL PROTECTED]
Subject: Re: [Zope-dev] Referencial Integrity in ZCatalogs
Date: Mon, 02 Aug 2004 17:05:53 -0300
I would suggest you take a look at mxmRelations, however Zope.org
workflow is keeping it out of reach, and I couldn't find it on MaxM's
own site.
The URL for it would be:
http://www.zope.org/Members/maxm/products/mxmRelations
 

Yes, I've seen this solution.  It's another way to make things.  But I'm 
not sure that it can implement a foreign key on delete restricted, for 
instance. 

I see there are a lot of ways to solve this problem, so I will implement 
my proposal as a separate Product.   I will try to implement a 
IntegrityZCatalog, adding primary and foreign key capabilities.  

It will be easier to use for me, and also for all new zope coders 
comming from relational databases.  If we can say Catalogs are our 
Tables.  Use them as you have been using Tables until now and you will 
be right, I think we can make they learning much short.

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