[Zope3-dev] Re: wading through zcml...
Philipp von Weitershausen <[EMAIL PROTECTED]> wrote: [Chris] >> That said, I can live with most of the crap, but these dynamically >> generated classes... wtf? why? why did that? why are they still breathing?! > > *sigh* I don't know who came up with the idea, and I don't really care > as I don't want to point fingers at anyone. The reasons are probably > historical... Philipp, note that we're dynamically generating some classes in Grok: dynamically generated class for templates that don't have classes of themselves. I know you were there when we created this one. :) class TemplateView(grok.View): template = unassociated module_info = module_info_ of course the instances of this class do nothing the developer has to interact with. As soon as the developer provides a view class of their own, there's no dynamically generated class anymore. I think that this is an acceptable use of the pattern. I've done it too recently in the form support. The *real* formlib-level form class is dynamically created for each grok-level form: class RealEditForm(form.EditForm): form_fields = get_form_fields(factory, context) actions = actions_ This one is a bit more scary, as the end-user interacts with an *instance* of this class; the form attribute on grok-level forms is one. Of course there were good reasons to do this - I wanted to avoid mixing formlib level forms with grok-level forms, as too many method names were the same and making that horrible tangle work would've been a lot more pain indeed, I think. Regards, Martijn ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Re: zope3 instance with no zodb
Jim Fulton <[EMAIL PROTECTED]> wrote: > On Dec 2, 2006, at 4:30 AM, Chris Withers wrote: > >> I remember Shane asking this a while ago and seem to remember the >> answer was "no", but I'm hoping that's changed. >> >> Is it possible to have a Zope 3 instance that has no zodb backing >> at all? > > Yes, of course. [snip] > Yes. You have to configure an alternate publication object. Launchpad > does this. The publication object plugs in to the publisher and, among > other things, controls object traversal. The default publisher uses a > database object as a starting point for traversal. An alternate > publisher > could use something else, including allowing multiple "root" objects. Quite a few bits and pieces of Zope 3 also depend on there being a __parent__, including the default security policy. You may therefore either need to establish such a __parent__ relationship, or write a new security policy. Chris, when you finish doing this please document it so it'll be an "of course" for the rest of us too. :) Regards, Martijn ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] zope3 instance with no zodb
On Dec 2, 2006, at 4:30 AM, Chris Withers wrote: Hi All, I remember Shane asking this a while ago and seem to remember the answer was "no", but I'm hoping that's changed. Is it possible to have a Zope 3 instance that has no zodb backing at all? Yes, of course. I've been mocking up an app, currently in Zope 2, and have ended up using PostGresSQL as the data store (haven't done an rdb app in ages, foreign key constraints are nice, etc) and it occurred to me that with sqlalchemy, zsqlalchemy and some views that I don't actually need a zodb. Is this possible? Yes. You have to configure an alternate publication object. Launchpad does this. The publication object plugs in to the publisher and, among other things, controls object traversal. The default publisher uses a database object as a starting point for traversal. An alternate publisher could use something else, including allowing multiple "root" objects. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporationhttp://www.zope.com http://www.zope.org ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Re: Grok, CherryPy, WSGI and Zope 3
whit <[EMAIL PROTECTED]> wrote: > Martijn Faassen wrote: [snip] > cool! awesome to see integration efforts like this! > > is there any difference using cherrypy's wsgi server vs. say > paste.httpserver? Probably not except of course in the performance characteristics of the various servers. I still am thinking whether CherryPy can be used more than just in the WSGI sense, and whether this would be useful. Exploring the facilities paste offers for gluing WSGI together sounds like a good plan though. Regards, Martijn ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Re: zope3 instance with no zodb
Chris Withers wrote: Hi All, I remember Shane asking this a while ago and seem to remember the answer was "no", but I'm hoping that's changed. Is it possible to have a Zope 3 instance that has no zodb backing at all? I've been mocking up an app, currently in Zope 2, and have ended up using PostGresSQL as the data store (haven't done an rdb app in ages, foreign key constraints are nice, etc) and it occurred to me that with sqlalchemy, zsqlalchemy and some views that I don't actually need a zodb. Is this possible? Maybe not exactly what you want, but a mappingstorage creates a db stub in RAM -- cf http://blog.d2m.at/2006/10/27/look-ma-no-hands/ for an example. Michael -- http://zope.org/Members/d2m http://planetzope.org ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] zope3 instance with no zodb
Hi All, I remember Shane asking this a while ago and seem to remember the answer was "no", but I'm hoping that's changed. Is it possible to have a Zope 3 instance that has no zodb backing at all? I've been mocking up an app, currently in Zope 2, and have ended up using PostGresSQL as the data store (haven't done an rdb app in ages, foreign key constraints are nice, etc) and it occurred to me that with sqlalchemy, zsqlalchemy and some views that I don't actually need a zodb. Is this possible? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com