[Zope-dev] Five and browser-oriented components
On Z2, certain imports need to come from Products.Five, to play nicely with ZPublisher and friends. I'd like to ask for the motivation for not patching it onto the existing classes and/or modules. The effect of having Z2-developers import from Products.Five is that they must opt out on packages that make use of templates, browser views, formlib, ... --- and it adds needless complexity. This split might also have prompted the Plone community to walk their own way to the extend that there isn't much code reuse outside of the core Zope packages (along with egg dependencies, but with our fake eggs, we're almost up to par here). \malthe ___ Zope-Dev maillist - Zope-Dev@zope.org 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: What happened to the infrae.subversion and py eggs?
Tres Seaver schreef: Daniel Nouri wrote: 1.0dev-r27844 seems to be gone from PyPI. Such a version should *never* have been "released" to PyPI (any egg / source dist with an SVN revision number in its filename is *not* suitable for sharing with the wider world). I've made it a habit *not* to enable the option in setup.cfg that adds those svn revision numbers to the version. It is enabled by default in all/most of the ZopeSkel-generated packages that I use. That single change forces me to maintain a proper version number in the setup.py ("0.9 dev 3" for development versions). That is the spot where you make a change anyway when doing a release. It is wy too easy to forget to remove the subversion revision option from setup.cfg (and having to enable it again after the release). Somehow it helps :-) Reinout -- Reinout van Rees Blog: http://vanrees.org/weblog/ [EMAIL PROTECTED] Work: http://zestsoftware.nl/ http://vanrees.org Video: http://reinout.blip.tv/ ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: What happened to the infrae.subversion and py eggs?
Previously Reinout van Rees wrote: > Tres Seaver schreef: > >Daniel Nouri wrote: > >>1.0dev-r27844 seems to be gone from PyPI. > > > >Such a version should *never* have been "released" to PyPI (any egg / > >source dist with an SVN revision number in its filename is *not* > >suitable for sharing with the wider world). > > I've made it a habit *not* to enable the option in setup.cfg that adds > those svn revision numbers to the version. It is enabled by default in > all/most of the ZopeSkel-generated packages that I use. I recently started adding that option again for some of my projects. For a few frequently updated sites I do a lot of updates & installs without making full releases and it is extremely convenient to be able to see which exact revision number I'm currently using. Wichert. -- Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. ___ Zope-Dev maillist - Zope-Dev@zope.org 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: What happened to the infrae.subversion and py eggs?
Reinout van Rees <[EMAIL PROTECTED]> writes: > Tres Seaver schreef: >> Daniel Nouri wrote: >>> 1.0dev-r27844 seems to be gone from PyPI. >> >> Such a version should *never* have been "released" to PyPI (any egg / >> source dist with an SVN revision number in its filename is *not* >> suitable for sharing with the wider world). > > I've made it a habit *not* to enable the option in setup.cfg that adds > those svn revision numbers to the version. It is enabled by default in > all/most of the ZopeSkel-generated packages that I use. > > That single change forces me to maintain a proper version number in > the setup.py ("0.9 dev 3" for development versions). That is the spot > where you make a change anyway when doing a release. It is wy too > easy to forget to remove the subversion revision option from setup.cfg > (and having to enable it again after the release). For making releases, I create a tag and remove the setup.cfg file from that tag. No need to remove it from trunk. Also see [1] and [2]. And I agree with Wichert that for non-public packages, these development snapshot releases can be useful. [1] http://peak.telecommunity.com/DevCenter/setuptools#managing-continuous-releases-using-subversion [2] http://peak.telecommunity.com/DevCenter/setuptools#making-official-non-snapshot-releases Daniel ___ Zope-Dev maillist - Zope-Dev@zope.org 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 Tests: 5 OK
Summary of messages to the zope-tests list. Period Wed Apr 9 11:00:00 2008 UTC to Thu Apr 10 11:00:00 2008 UTC. There were 5 messages: 5 from Zope Tests. Tests passed OK --- Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Tests Date: Wed Apr 9 20:56:34 EDT 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-April/009380.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Tests Date: Wed Apr 9 20:58:05 EDT 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-April/009381.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Tests Date: Wed Apr 9 20:59:35 EDT 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-April/009382.html Subject: OK : Zope-2.11 Python-2.4.4 : Linux From: Zope Tests Date: Wed Apr 9 21:01:05 EDT 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-April/009383.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Tests Date: Wed Apr 9 21:02:35 EDT 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-April/009384.html ___ Zope-Dev maillist - Zope-Dev@zope.org 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: Five and browser-oriented components
Malthe Borch <[EMAIL PROTECTED]> writes: > On Z2, certain imports need to come from Products.Five, to play nicely > with ZPublisher and friends. > > I'd like to ask for the motivation for not patching it onto the > existing classes and/or modules. The effect of having Z2-developers > import from Products.Five is that they must opt out on packages that > make use of templates, browser views, formlib, ... --- and it adds > needless complexity. IMO, any implicitness here will eventually slap you in your face, cause bugs, and be hard to figure out. I already dislike the way that e.g. FiveFormLibMixin implicitly changes my request to be more conform with formlib . This has caused confusion and pain for me in the past. Therefore, I'd argue that we should, in contrary to what you suggest, make the Zope 2 compatibility layer more explicit in the form of utility functions, instead of more implicit. Because it makes things more transparent and easier to debug. One concrete argument against patching the Zope 3 view page template in Five to be Zope 2 conform is that this would stand in the way of legitimate use of pure Zope 3 views in Zope 2 applications, which is something that's quite feasible today. We don't to lock ourselves into a situation where Z3 templates in Z2 assume that the view is acquisition wrapped. Daniel ___ Zope-Dev maillist - Zope-Dev@zope.org 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: Five and browser-oriented components
Daniel Nouri wrote: Therefore, I'd argue that we should, in contrary to what you suggest, make the Zope 2 compatibility layer more explicit in the form of utility functions, instead of more implicit. Because it makes things more transparent and easier to debug. You might be right; but it's a very bad place to be, stuck in the middle of two frameworks. We're duplicating code all over the place, and while this has obvious inherent qualities, it also wears us out as a community. I fail to understand why people are not more motivated to get rid of all the cruft. There are times when I wish the ship would sink, if only to get on with it. \malthe ___ Zope-Dev maillist - Zope-Dev@zope.org 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: straighting out the SQLAlchemy integration mess
Martin Aspeli wrote: [snip] It's never particularly pleasant. I think we need to make sure we make this as easy and pleasant as possible though. This means at the very least some document that tells you what to do. :) Regards, Martijn ___ Zope-Dev maillist - Zope-Dev@zope.org 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: Five and browser-oriented components
Malthe Borch wrote: On Z2, certain imports need to come from Products.Five, to play nicely with ZPublisher and friends. I'd like to ask for the motivation for not patching it onto the existing classes and/or modules. Technically, I think that this is going to be hard. You'd need to patch in the magic acquisition base class. Acquisition is the main reason that some of the code needed to be duplicated - without the existence of acquisition wrappers, security checks are not made for view access and things just won't work. We do explicit acquisition in those bits of code, but it's still a pain and leads to confusion around self.context in views being acquisition-wrapped weirdly, breaking some expectations around aq_parent. The other argument against monkey-patching is that monkey-patching is something to be avoided if at all possible. I think it's wise to avoid it here, as it's possible. If you monkey-patched core Zope 3 classes, the chances are that you'll break Zope 3 code that assumes certain behavior. The way to get rid of many of these problems would be to get rid of the need for acquisition. Philipp started a branch long ago that allows the acquisition system to look at a __parent__ pointer if no acquisition wrapper is present. Since our views have __parent__ pointers, this should fix the issue. This branch has been lingering in an "almost ready" state for a long time now. In general, I think acquisition is one of the major remaining stumbling block in enabling quite a bit of straightforward Zope 3 code in Zope 2. Here are some more of my thoughts on this: http://faassen.n--tree.net/blog/view/weblog/2008/01/30/0 Regards, Martijn ___ Zope-Dev maillist - Zope-Dev@zope.org 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: Five and browser-oriented components
Malthe Borch <[EMAIL PROTECTED]> writes: > Daniel Nouri wrote: >> Therefore, I'd argue that we should, in contrary to what you suggest, >> make the Zope 2 compatibility layer more explicit in the form of utility >> functions, instead of more implicit. Because it makes things more >> transparent and easier to debug. > > You might be right; but it's a very bad place to be, stuck in the > middle of two frameworks. We're duplicating code all over the place, > and while this has obvious inherent qualities, it also wears us out as > a community. I think I found a useful pattern for how to work with z3c.forms to avoid duplication. For each page that has forms, I make two views; one is the Products.Five.BrowserView view that's looked up by the publisher and is registered with ZCML. The other is my z3c.form.form.Form that does the actual work and renders my content area. The relationship between these two forms is similar to that of forms and subforms. Here is an example of how this looks like in practice: class MyForm(z3c.form.form.Form): template = Z3ViewPageTemplateFile('form.pt') fields = z3c.form.Fields(ISomething) @button.buttonAndHandler(_('Apply'), name='apply') def handle_apply(self, action): data, errors = self.extractData() # ... class PloneView(Products.Five.BrowserView): __call__ = Z2ViewPageTemplateFile('main.pt') form = MyForm def contents(self): z2.switch_on(self) return self.form(self.context.aq_inner, self.request)() Here, main.pt is the part that renders main_template and pulls in view/contents into the "content area". z2.switch_on() is a compatibility function that fiddles a bit with the Zope 2 request to make it work with z3c.form (and also calls Five's decodeInput). Of course, PloneView is generic enough to be subclassed at this point: class MyFunnyView(PloneView): form = MyFunnyForm What's the advantage of this separation? - You don't have to worry about Acquisition in your form code, which will make out the bigger part of your code. The implications of Five's BrowserView being derived from Acquisition.Explicit has often left me confused. (Death to self.context.aq_inner!) - You can reuse form code between Zope 2 and Zope 3. - Your forms can be rendered in any part of your page, like in portlets. - No subclassing of classes in z3c.form is necessary to use the forms in Zope 2. (In contrast to Five's current way of subclassing formlib.) Daniel ___ Zope-Dev maillist - Zope-Dev@zope.org 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.testing.doctest] a nasty surprise
As the community (apparently) strongly favors "doctest" over "unittest", I wrote my first test based on "zope.testing.doctest". And promptly, I was badly surprised In order to analyse a difficult problem, I added "from dm.pdb import zpdb; zpdb.set_trace()" in the doctest ("dm.pdb.zpdb" is my Zope aware PDB extension) -- and got a "TypeError: set_trace requires at least one argument, 0 given". Now, I know the "zpdb.set_trace()" does not want any arguments. I moved the line from the doctest code into the failing infrastructure code -- same "TypeError". I called "help(zpdb.set_trace)" and got: Help on function set_trace in module zope.testing.doctest: set_trace(self) Apparently, "doctest" has overridden "zpdb.set_trace" in an incompatible way I will rewrite my test as "unittest" and probably avoid in the future "zope.testing.doctest" whenever possible. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org 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: straighting out the SQLAlchemy integration mess
Martin Aspeli wrote: Laurence Rowe wrote: Should one phase commit be set as the default to make it easier to work with sqlite (and mssql)? Probably yes. Ideally we'd guess based on the URL scheme but allow it to be set explicitly, IMHO. Single phase would be the fallback, I guess. I don't like the idea of guessing too much, but it could be done in the __init__. There might be good reasons to choose one phase commit even for a two phase commit supporting database (i.e. when you only are talking to a single database, it is more efficient). Given that a single database is the common case I am tempted to say just make 1PC the default. Should the default be for sessions to start out `active` or `dirty`? If they start out `dirty` then existing 1.0 code should work as before. What are the implications of having them start out dirty? Unnecessary commits to the database for read only transactions (i.e. the current situation) Laurence ___ Zope-Dev maillist - Zope-Dev@zope.org 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: straighting out the SQLAlchemy integration mess
Martin Aspeli wrote: Martijn Faassen wrote: Martijn Pieters wrote: On Tue, Apr 8, 2008 at 11:54 PM, Martijn Faassen <[EMAIL PROTECTED]> wrote: All of these are in various states of brokenness. z3c.zalchemy doesn't work with SQLAlchemy trunk. collective.lead works with it, but only if you check out a particular branch, and not with sqlite. Quite possibly z3c.sqlalchemy has a release that actually works. One out of three is not bad... :) We are going into production with collective.lead and are committed to releasing the 1.0 branch as 1.0. sqlite works just great for us, we use it to run unit tests and for developers that just need to adjust the styling and such. The production environment will run against Oracle. The elro-tpc branch (which, I was told, is the future) doesn't appear to work with sqlite out of the box. I think this is a temporary bug, as Laurence pointed out, caused by SQLite not supporting two-phase commit. It should be fixed before release, by adding a one-phase fallback. I'm curious how to do functional tests with collective.lead - I'd like to have some real easy way to get the database set up and tore down down in my tests. Are you doing this? I'm doing a lot of it in Java. :) The typical pattern is to use a test setup that does database clean-down to return it to a steady state. Test data is kept in a declarative file (e.g. with an XML syntax that maps to DB structure) and used to initialise the database before each run. Doing nested transactions and rollback would be nicer, but probably doesn't work in all cases since app code may well do explicit commits. Note that sqlite does not support nested transactions or savepoints. It's never particularly pleasant. Martin Laurence ___ Zope-Dev maillist - Zope-Dev@zope.org 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.testing.doctest] a nasty surprise
Dieter Maurer wrote: As the community (apparently) strongly favors "doctest" over "unittest", I wrote my first test based on "zope.testing.doctest". And promptly, I was badly surprised In order to analyse a difficult problem, I added "from dm.pdb import zpdb; zpdb.set_trace()" in the doctest ("dm.pdb.zpdb" is my Zope aware PDB extension) The standard PDB works fine. I'm sure you're extended version can be tweaked to as well. -- Benji York Senior Software Engineer Zope Corporation ___ Zope-Dev maillist - Zope-Dev@zope.org 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: AW: [Zope-dev] Re: [Zope3-Users] How do I automatically login a user]
I have completed a first draft of an implementation of a proposal for for changes to the SessionCredentials Access code (zope.app.authentication). http://wiki.zope.org/zope3/SessionCredentialsAPIEnhancements I want to put them somewhere so that they can be discussed. I think that a svn.zope.org/Sandbox is the appropriate place. Can I get committer access to the subversion repository to make changes to this area? [According to the faq, I ask for commiter access on this list]. Alternatively, is there another location where proposed changes to the core are generally posted. Thanks Kevin > On Apr 9, 2008, at 5:07 AM, kevin gill wrote: >> 1. IP Extraction >> >> Extract the IP Address from the credentials and store it. Return the >> IP Address in the dictionary from extractCredentials(). >> >> The value from request._environ['HTTP_X_FORWARDED_FOR'] will be used >> if present. otherwise request._environ['REMOTE_ADDR']. > > > On a basis of "privacy" of attributes starting with underscore, such > as _environ, I would suggest using request.headers (for X-Forwarded- > For) and request.environment instead. These are defined in the public > interface API. > > -- > Zvezdan Petkovic <[EMAIL PROTECTED]> > > ___ > Zope-Dev maillist - Zope-Dev@zope.org > 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 ) > > -- > ** Email Scanned by Elive's Virus Scanning Service - > http://www.elive.net ** > > > > > ___ Zope-Dev maillist - Zope-Dev@zope.org 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] straighting out the SQLAlchemy integration mess
On Wed, Apr 09, 2008 at 12:51:53PM -0400, Kapil Thangavelu wrote: > that sound good, i'd like to see a common base layer, providing transaction > support, simple containers. Actually, containers are one of the things I think should be explicitly excluded from a base SQLAlchemy integration package. You could do the same thing by IPublishTraverse plugins as well. -- Brian Sutherland ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: straighting out the SQLAlchemy integration mess
On Wed, Apr 09, 2008 at 05:47:06PM +0200, Andreas Jung wrote: > > > --On 9. April 2008 14:15:38 +0100 Laurence Rowe <[EMAIL PROTECTED]> wrote: > >> @everyone: >> >> If we can all agree to use the same basic session and transaction >> management then we should probably push for it to be included as a >> sqlalchemy extension module. > > I would be happy with such a solution. As said, I am not into the > datamanager-building business and more interested in > application-integration issues. The basic requirements I have for our > applications: > > - having the same session within one ZODB transaction (per thread) > - need to get hold of the underlying database connection for a given > session Just adding my few requirements: - Integration into transactions. - Integration into the component architecture in such a way that I can specify the db connection parameters in ZCML and that database reflection still works. I want to be able to get a handle on SQLAlchemy things by calling getUtility. - Have a connection available as IZopeDatabaseAdapter utility (for BBB) -- Brian Sutherland ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: straighting out the SQLAlchemy integration mess
--On 10. April 2008 19:10:49 +0200 Brian Sutherland <[EMAIL PROTECTED]> wrote: Just adding my few requirements: - Integration into the component architecture in such a way that I can specify the db connection parameters in ZCML and that database reflection still works. I want to be able to get a handle on SQLAlchemy things by calling getUtility. Please *NO* database specific configurations within ZCML. We're running applications in up three or four different environments and I don't want to maintain instance specific configurations within ZCML. Either we pass such informations through environment variables or the database connections parameters are read from a configuration within the instance configuration. Andreas pgpPVek73cZst.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org 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: Have you checked on the latest commits?
On Tue, Apr 08, 2008 at 09:20:23AM +1200, Matthew Grant wrote: > On Mon, 2008-04-07 at 20:02 +0300, Marius Gedminas wrote: > > > I want to get teh branch to the point where it gets merged. > > > > Don't feel that my review is somehow necessary for it being merged. I > > tend to procrastinate. :-( > > Could you please tell me what has to happen to get the merge done? Someone with commit access goes and does the merge :-) I've looked at your latest checkins a bit. I got the impression at one or two places that you didn't quite understand the point of my suggestion, but none of those were very important. And, you know, perfect is the enemy of good. I've no objections for the merge. > I > believe there is some consensus that needs to be reached with the other > zope.sendmail maintainers? No, I don't think so. There's no code ownership in Zope: everybody can do whatever he or she wants. At worst you'll get yelled at if you introduce a bug or commit broken untested code somewhere. ;-) Marius Gedminas -- Any sufficiently advanced Operating System is indistinguishable from Linux. -- Jim Dennis signature.asc Description: Digital signature ___ Zope-Dev maillist - Zope-Dev@zope.org 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] straighting out the SQLAlchemy integration mess
Hi there, On Thu, Apr 10, 2008 at 7:04 PM, Brian Sutherland <[EMAIL PROTECTED]> wrote: > On Wed, Apr 09, 2008 at 12:51:53PM -0400, Kapil Thangavelu wrote: > > that sound good, i'd like to see a common base layer, providing transaction > > support, simple containers. > > Actually, containers are one of the things I think should be explicitly > excluded from a base SQLAlchemy integration package. > > You could do the same thing by IPublishTraverse plugins as well. Agreed. I think the common base layer should do the minimum transaction integration stuff and leave any policy to layers on top. Hopefully we'll arrive at a commonly used package for containers too at some point, but we'll see about that then. Regards, Martijn ___ Zope-Dev maillist - Zope-Dev@zope.org 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 )
AW: AW: [Zope-dev] Re: [Zope3-Users] How do I automatically login a user]
Hi Kevin > Betreff: Re: AW: [Zope-dev] Re: [Zope3-Users] How do I > automatically login a user] > > I have completed a first draft of an implementation of a > proposal for for changes to the SessionCredentials Access > code (zope.app.authentication). > > http://wiki.zope.org/zope3/SessionCredentialsAPIEnhancements Thanks a lot for pick up that work. Looks very promising. One imporant part whould be to prevent write access on each request. But you noticed that already on your wiki page. Regards Roger Ineichen ___ Zope-Dev maillist - Zope-Dev@zope.org 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.testing.doctest] a nasty surprise
Benji York wrote at 2008-4-10 11:50 -0400: >Dieter Maurer wrote: >> As the community (apparently) strongly favors "doctest" over >> "unittest", I wrote my first test based on "zope.testing.doctest". >> And promptly, I was badly surprised >> >> In order to analyse a difficult problem, I added >> "from dm.pdb import zpdb; zpdb.set_trace()" in the doctest >> ("dm.pdb.zpdb" is my Zope aware PDB extension) > >The standard PDB works fine. I'm sure you're extended version can be >tweaked to as well. Does a documentation exist how "doctest" manipulates "set_trace" and what it expects that the manipulation succeeds. Apparently, "doctest" has replaced my "set_trace" in "zpdb" by its non working implementation of "set_trace". I can understand that my "set_trace" would not have worked (as probably "sys.stdout/err" points somewhere else then usual), but I have difficulties to understand why "doctest"'s "set_trace" does not work (at all). -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: straighting out the SQLAlchemy integration mess
On Thu, Apr 10, 2008 at 07:31:54PM +0200, Andreas Jung wrote: > > > --On 10. April 2008 19:10:49 +0200 Brian Sutherland > <[EMAIL PROTECTED]> wrote: > > >> >> Just adding my few requirements: >> - Integration into the component architecture in such a way that I >> can specify the db connection parameters in ZCML and that database >> reflection still works. I want to be able to get a handle on >> SQLAlchemy things by calling getUtility. > > Please *NO* database specific configurations within ZCML. We're running > applications in up three or four different environments and I don't want to > maintain instance specific configurations within ZCML. Either we pass > such informations through environment variables or the database connections > parameters are read from a configuration within the instance configuration. What defines if something is the instance configuration? Isn't ZCML just another format of configuration file? I agree it's evil to hardcode database connections in the application as they must be under the control of the sysadmin. But that doesn't preclude them from being expressed in zcml. I *do* like the idea of using one and only one file format to configure applications. We also run the in a few different environments, the /etc/myserver/site.zcml is different on a per instance basis and looks like this: http://namespaces.zope.org/zope"; xmlns:rdb="http://namespaces.zope.org/rdb";> But, I'm diverging, my point is that it would be nice to be able to have SQLAlchemy connections available as IZopeDatabaseAdapter utilities to allow a migration path. Whether they are defined in or out of ZCML, I just don't care. -- Brian Sutherland ___ Zope-Dev maillist - Zope-Dev@zope.org 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.testing.doctest] a nasty surprise
On Thu, Apr 10, 2008 at 08:46:15PM +0200, Dieter Maurer wrote: > Benji York wrote at 2008-4-10 11:50 -0400: > >Dieter Maurer wrote: > >> As the community (apparently) strongly favors "doctest" over > >> "unittest", I wrote my first test based on "zope.testing.doctest". > >> And promptly, I was badly surprised > >> > >> In order to analyse a difficult problem, I added > >> "from dm.pdb import zpdb; zpdb.set_trace()" in the doctest > >> ("dm.pdb.zpdb" is my Zope aware PDB extension) > > > >The standard PDB works fine. I'm sure you're extended version can be > >tweaked to as well. > > Does a documentation exist how "doctest" manipulates "set_trace" > and what it expects that the manipulation succeeds. Documentation? Well, there are some comments in the source file... doctest monkey-patches pdb.set_trace (in an ugly way, IMHO) to restore sys.stdout, because you want the output from pdb commands like 'list' or 'print' to go to your console, and not to the doctest's actual result StringIO collector. > Apparently, "doctest" has replaced my "set_trace" in "zpdb" > by its non working implementation of "set_trace". I find it hard to believe. It's more likely that zpdb is interacting with pdb.set_trace in a way that conflicts with doctest's monkey-patch. Is the zdpb module available on the web somewhere? > I can understand that my "set_trace" would not have worked > (as probably "sys.stdout/err" points somewhere else then usual), > but I have difficulties to understand why "doctest"'s "set_trace" > does not work (at all). Marius Gedminas -- ...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and the Ugly). -- Matt Welsh signature.asc Description: Digital signature ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: straighting out the SQLAlchemy integration mess
On Thu, Apr 10, 2008 at 09:29:43PM +0200, Brian Sutherland wrote: > On Thu, Apr 10, 2008 at 07:31:54PM +0200, Andreas Jung wrote: > > Please *NO* database specific configurations within ZCML. We're running > > applications in up three or four different environments and I don't want to > > maintain instance specific configurations within ZCML. Either we pass > > such informations through environment variables or the database connections > > parameters are read from a configuration within the instance configuration. I must admit though, that being able to set an environment variable and have an IZopeDatabaseAdapter utility registered from that would make setting up functional tests much nicer. Currently, because of layers, all my functional tests run against a magical database "test" :((( -- Brian Sutherland ___ Zope-Dev maillist - Zope-Dev@zope.org 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: Five and browser-oriented components
Martijn Faassen wrote: Technically, I think that this is going to be hard. You'd need to patch in the magic acquisition base class. Acquisition is the main reason that some of the code needed to be duplicated - without the existence of acquisition wrappers, security checks are not made for view access and things just won't work. I think if we could finish the philikon-aq_parent branch (or whatever it's called) that makes it possible to do acquisition using __parent__ pointers, we'd be a lot closer. Hanno and Philipp know more, but I think it's reasonably close. We do explicit acquisition in those bits of code, but it's still a pain and leads to confusion around self.context in views being acquisition-wrapped weirdly, breaking some expectations around aq_parent. And other bizarre things sometimes. The way to get rid of many of these problems would be to get rid of the need for acquisition. Philipp started a branch long ago that allows the acquisition system to look at a __parent__ pointer if no acquisition wrapper is present. Since our views have __parent__ pointers, this should fix the issue. This branch has been lingering in an "almost ready" state for a long time now. Ah, great minds think alike. ;) Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http://martinaspeli.net/plone-book ___ Zope-Dev maillist - Zope-Dev@zope.org 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.testing.doctest] a nasty surprise
Marius Gedminas wrote at 2008-4-10 22:37 +0300: > ... >doctest monkey-patches pdb.set_trace (in an ugly way, IMHO) to restore >sys.stdout, because you want the output from pdb commands like 'list' or >'print' to go to your console, and not to the doctest's actual result >StringIO collector. > >> Apparently, "doctest" has replaced my "set_trace" in "zpdb" >> by its non working implementation of "set_trace". > >I find it hard to believe. It's more likely that zpdb is interacting >with pdb.set_trace in a way that conflicts with doctest's monkey-patch. > >Is the zdpb module available on the web somewhere? "dm.pdb" is on "PyPI". And your intuition is right. "zpdb" rebinds "pdb.set_trace" overriding the name "Pdb". Now, I also understand how the "TypeError" results: "doctest" has replaced the function "set_trace" by an instance method. Rebinding unwraps the "InstanceMethod" and operates only on the enclosed function -- the implicit instance argument is lost. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org 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: Five and browser-oriented components
Hi. Martin Aspeli wrote: Martijn Faassen wrote: Technically, I think that this is going to be hard. You'd need to patch in the magic acquisition base class. Acquisition is the main reason that some of the code needed to be duplicated - without the existence of acquisition wrappers, security checks are not made for view access and things just won't work. I think if we could finish the philikon-aq_parent branch (or whatever it's called) that makes it possible to do acquisition using __parent__ pointers, we'd be a lot closer. Hanno and Philipp know more, but I think it's reasonably close. It is reasonably close but as stated in some threads a few month back I hit some problems which I cannot solve (not even with walking up stack frames...). As the problems only showed themselves while doing browser testing inside Plone, I guess I can at least write some unit tests for them, so someone else can actually take a look at them more easily. I'll see if I can do that during my next 10% day [1] :) Hanno [1] http://www.jarn.com/blog/the-10-plone-manifesto ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: straighting out the SQLAlchemy integration mess
On Thu, Apr 10, 2008 at 1:31 PM, Andreas Jung <[EMAIL PROTECTED]> wrote: > > > --On 10. April 2008 19:10:49 +0200 Brian Sutherland < > [EMAIL PROTECTED]> wrote: > > > > > Just adding my few requirements: > >- Integration into the component architecture in such a way that I > > can specify the db connection parameters in ZCML and that database > > reflection still works. I want to be able to get a handle on > > SQLAlchemy things by calling getUtility. > > > > Please *NO* database specific configurations within ZCML. We're running > applications in up three or four different environments and I don't want to > maintain instance specific configurations within ZCML. Either we pass > such informations through environment variables or the database > connections parameters are read from a configuration within the instance > configuration. > i still don't see the harm having zcml db conf in a base package, if you don't have to use it to setup your particular deployment's connections. -kapil ___ Zope-Dev maillist - Zope-Dev@zope.org 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: straighting out the SQLAlchemy integration mess
Andreas Jung wrote: --On 10. April 2008 19:10:49 +0200 Brian Sutherland <[EMAIL PROTECTED]> wrote: Just adding my few requirements: - Integration into the component architecture in such a way that I can specify the db connection parameters in ZCML and that database reflection still works. I want to be able to get a handle on SQLAlchemy things by calling getUtility. Please *NO* database specific configurations within ZCML. We're running applications in up three or four different environments and I don't want to maintain instance specific configurations within ZCML. Either we pass such informations through environment variables or the database connections parameters are read from a configuration within the instance configuration. As long as it can also be specified in the code, that way people can build UIs to set up the connection. Perhaps that's what you mean by a "configuration within the instance configuration". Regards, Martijn ___ Zope-Dev maillist - Zope-Dev@zope.org 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: Five and browser-oriented components
Hanno Schlichting wrote: [snip] As the problems only showed themselves while doing browser testing inside Plone, I guess I can at least write some unit tests for them, so someone else can actually take a look at them more easily. I'll see if I can do that during my next 10% day [1] :) Yes, it'd be cool to have some tests that demonstrate the failure. Then come back to this list and bug people until they look into this. Regards, Martijn ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: straighting out the SQLAlchemy integration mess
--On 10. April 2008 21:29:43 +0200 Brian Sutherland <[EMAIL PROTECTED]> wrote: On Thu, Apr 10, 2008 at 07:31:54PM +0200, Andreas Jung wrote: --On 10. April 2008 19:10:49 +0200 Brian Sutherland <[EMAIL PROTECTED]> wrote: Just adding my few requirements: - Integration into the component architecture in such a way that I can specify the db connection parameters in ZCML and that database reflection still works. I want to be able to get a handle on SQLAlchemy things by calling getUtility. Please *NO* database specific configurations within ZCML. We're running applications in up three or four different environments and I don't want to maintain instance specific configurations within ZCML. Either we pass such informations through environment variables or the database connections parameters are read from a configuration within the instance configuration. What defines if something is the instance configuration? Isn't ZCML just another format of configuration file? I agree it's evil to hardcode database connections in the application as they must be under the control of the sysadmin. But that doesn't preclude them from being expressed in zcml. The point is: we don't need yet another configuration language for the configuration of a site. ZCML should be used for the purpose it has been intended for: for the configuration of the components of your site (easily spoken). This kind of configuration is static if you setup a site for project X. But settings like ports, paths etc. often differ between dev, test and production environments. We already have ZConfig as standard cofniguration language for instance specific configuration aspects. In addition: we often do use environment variables and .ini files for additional configurations. Introducing another configuration language is stupid. Especially because system administrators or co-workers know little or nothing about ZCML. This is an unnecessary introduction of complexity. Setting an environment variable with a DSN is much easier then having to fiddle around with ZCML and XML...totally unnecessary overheadkeep it simple ...using ZCML in this configuration context is only for XML masochists. Andreas pgpyigxtKwGmK.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org 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 )