Re: [Zope3-Users] Local configuration settings via ZCML

2006-09-25 Thread Bernd Dorn



On 25.09.2006, at 06:05, Andrew Groom wrote:


Hi All,

I have a component that's doing a database connection, and the  
connection is described in configure.zcml as:


rdb:provideConnection name='my_db'
component='psycopgda.adapter.PsycopgAdapter'
dsn='dbi://user:[EMAIL PROTECTED]/dbname' /

The problem is that this file is being committed to subversion then  
deployed to a production site, overwriting the production settings.  
I'd like to have a nice tidy way of having a bunch of settings like  
this for my development environment in some sort of optional local  
include file. I thought the include directive might do it for me,  
but it seems to ignore any settings in the local file, and when I  
use includeOverrides I get a config conflict error.


i always use the site.zcml file of the instance for such things

you have to do the development specific configuration there too,  
otherwise you get confilicts


regards, Bernd



Any suggestions as to the best way to handle this ?

Cheers, Andrew.
-
Reurbanise - Urban Sustainability
ph: (03) 3528 055, mobile: 0274 992 569
http://www.reurbanise.co.nz
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Autocreated content objects

2006-09-25 Thread Darryl Cousins
Hi John,

This may be what you are after:

root['my-app'] = MyApp()

Regards,
Darryl

On Mon, 2006-09-25 at 17:21 +1000, John Maddison wrote:
 Hi there,
 
 Is it possible/wise to auto-create content objects in the ZODB?  Say
 I'm creating a blog application and have a container
 type(BlogContainer) and want an instance called blog in the root of
 the ZODB.  Is it possible to programatically specify this, or is my
 only option to create it through the ZMI? I thought that perhaps an
 event was generated when the root object was created that I could hook
 into, but it seems not.  Perhaps I'm looking at this the wrong way -
 would fixtures like this be better implemented as utilities with
 z3c.traverser redirecting to appropriate views?
 
 John
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Autocreated content objects

2006-09-25 Thread Philipp von Weitershausen

Tom Dossis wrote:

mats.nordgren wrote:

The IntId subscribers are fired on
zope.app.container.interfaces.IObjectAddedEvent and IObjectRemovedEvent.



That's correct, however the (IWrite)Container __setitem__ method invokes
the ObjectAddedEvent for you when you add an object to the container.

Your code below looks like it's running zope directly, e.g. `zopectl
debug`.  In this case you need to explicitly set a/the current site
yourself.  Try insert the following first up...

  from zope.app.component import hooks
  hooks.setSite(app.root())


Correct. SItes are usually found during traversal. When doing stuff 
before any traversal is happening, you won't have a local site yet. So, 
using setSite() is appropriate, just remember to call setSite(None) 
afterwards for cleanup!


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Autocreated content objects

2006-09-25 Thread Baiju M

On 9/26/06, Fred Drake [EMAIL PROTECTED] wrote:

On 9/25/06, Philipp von Weitershausen [EMAIL PROTECTED] wrote:
 Yeah, like Stephan says, Zope should probably send an
 IObjectCreatedEvent there. In the mean time, you can hook into
 IDatabaseOpenedEvent which gets sent every time Zope starts up and opens
 a connection to the ZODB.

I've fixed the trunk so that an IObjectCreatedEvent is generated when
the root folder is created.


If this is a _bug fix_ and not a _feature_, can we port it to 3.3 also.
Of cource in 3.3.1 release only.

Regards,
Baiju M
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Autocreated content objects

2006-09-25 Thread Fred Drake

On 9/26/06, Baiju M [EMAIL PROTECTED] wrote:

If this is a _bug fix_ and not a _feature_, can we port it to 3.3 also.
Of cource in 3.3.1 release only.


I think so.  I've got to get some sleep now, but feel free to go ahead
and backport it if like.


 -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Every sin is the result of a collaboration. --Lucius Annaeus Seneca
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users