Re: [Zope3-Users] Get Started
Hi, On Tue, Oct 10, 2006 at 05:59:55PM -0300, Luiz Fernando Bernardes Ribeiro wrote: Hello all, Is there any tool to automate the bootstrap of a new project? Something like ArcheGen XML? To generates all the initial Interfaces, Implementation classes and the configure.zcml? Maybe. I wrote a script which creates a new application but I don't know, if it's still working with a current Zope release. https://svnserv.cbs.mpg.de/svn/edv/EDV/zope3-mpgsite/lib/python/mpgsite/tools/zag I've not used it for a long time. There are no warranties but feel free to try. flamewar_start_reason tal:content=It's written in Perl :-) / Regards, Frank ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] ForbiddenAttribute on locate method
Le mercredi 11 octobre 2006 00:52 +0200, Thierry FLORAC a crit: Hi, I try to setup a little application but have a probably little problem with a ForbiddenAttribute exception on location.locate method. Here is my setup : class IPhoto(IContainer,IContained): Photo handling interface ... image = Bytes(...) ... class Photo(Folder): Photo handling class ... image = None def __init__(self, image=None): super(Photo,self).__init__() self.__parent__ = self.__name__ = None if image: self.image = image ... class IEvent(IContained): Event handling interface ... class Event(Persistent): Event handling class ... def __init__(self): super(Event,self).__init__() self.__parent__ = self.__name__ = None In my event creation form (derived from formlib.AddForm), I put something like this, without a problem : def create(self, data): event = Event() if data.has_key('image'): event.image = Photo(image=data['image']) location.locate(event.image, event, 'image') form.applyChanges(event, self.form_fields, data) return event event.image access can then be granted easily in an URL through a z3c.traverser plug-in and everything works fine... until now ! Because when I'm trying to make the same thing in an edit form to update an existing event, an exception is raised : def edit(self, action, data): changed = False event = self.context if data.has_key('image'): event.image = Photo(image=data['image']) location.locate(event.image, event, 'image') changed = True return super(EventEditForm,self).edit(action, data) or changed Here is the traceback : Traceback (most recent call last): File /usr/local/zope/3.3.0/lib/python/zope/publisher/publish.py, line 133, in publish result = publication.callObject(request, obj) File /usr/local/zope/3.3.0/lib/python/zope/app/publication/zopepublication.py, line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File /usr/local/zope/3.3.0/lib/python/zope/publisher/publish.py, line 108, in mapply return debug_call(obj, args) - __traceback_info__: security proxied zope.app.publisher.browser.viewmeta.NewsEventEditForm instance at 0xa677e20c File /usr/local/zope/3.3.0/lib/python/zope/publisher/publish.py, line 114, in debug_call return obj(*args) File /usr/local/zope/3.3/lib/python/zope/formlib/form.py, line 751, in __call__ self.update() File /usr/local/zope/3.3/lib/python/zope/formlib/form.py, line 732, in update result = action.success(data) File /usr/local/zope/3.3/lib/python/zope/formlib/form.py, line 582, in success return self.success_handler(self.form, self, data) File /var/local/zope/3.3/lib/python/ulthar/forms/forms.py, line 104, in handle_edit_action self.edit_action(action,data) File /var/local/zope/3.3/lib/python/ulthar/forms/forms.py, line 107, in edit_action if not self.edit(action, data): File /var/local/zope/3.3/lib/python/usf/news/browser/event.py, line 85, in edit location.locate(event.image, event, 'image') File /usr/local/zope/3.3.0/lib/python/zope/location/location.py, line 71, in locate object.__parent__ = parent ForbiddenAttribute: ('__parent__', gallery.photo.Photo object at 0xa678f62c) Hi, I finally solved this stupid problem by myself... Switching location.locate method call from EditForm view to Event class was just enough... Thierry Florac -- Chef de projet intranet/internet Office National des Forts - Dpartement Informatique 2, Avenue de Saint-Mand 75570 PARIS Cedex 12 Ml : [EMAIL PROTECTED] Tl. : +33 01.40.19.59.64 Fax. : +33 01.40.19.59.85 ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Get Started
2006/10/11, FB [EMAIL PROTECTED]: Maybe. I wrote a script which creates a new application but I don't know, ifit's still working with a current Zope release. https://svnserv.cbs.mpg.de/svn/edv/EDV/zope3-mpgsite/lib/python/mpgsite/tools/zag I've not used it for a long time. There are no warranties but feel free to try. flamewar_start_reason tal:content=It's written in Perl :-) / Yeah, that's blasphemy indeed! :D Hopefully a more generic tool, a la ArcheGenXML, will emerge for Zope 3. Best, -- Miklós Prisznyák Principal Consultant, owner http://www.jegenye.com ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: Get Started
Jegenye 2001 Bt (Miklós Prisznyák) wrote: 2006/10/11, FB [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Maybe. I wrote a script which creates a new application but I don't know, if it's still working with a current Zope release. https://svnserv.cbs.mpg.de/svn/edv/EDV/zope3-mpgsite/lib/python/mpgsite/tools/zag I've not used it for a long time. There are no warranties but feel free to try. flamewar_start_reason tal:content=It's written in Perl :-) / Yeah, that's blasphemy indeed! :D Hopefully a more generic tool, a la ArcheGenXML, will emerge for Zope 3. I've seen a few people suggest tools like that for Zope 3. I generally think it's a good idea. However, us core developers usually prefer our emacs/vi/... And our efforts are currently geared towards making Zope 3 simpler to get started with -- without any special tools (sprint coming up this weekend). So let me be clear and use my ever so famous German bluntness: don't expect anything IDE/GUI-ish from us any time soon. This is open source, the best way to ensure something will be done is to start the initiative yourselves. I think there are enough GUI-mavens in the Zope 3 community now to have enough momentum to actually produce something like that. Shane Hathaway tried a while back with a ZCML GUI editor (http://codespeak.net/svn/z3/zopejam/) but he gave up. There was also an effort to extend AGX so that it can spit out Zope3-style code. I think that effort has been stalled, too. BUT: times have changed since then. Lots of people want these things. So I can only encourage you guys to get to together and think about what you want to produce. Philipp ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] virtual hosting
Hello friends, as I can have virtual hosting of easy form? like in zope2 -- Hector Miuler Malpica Gallegos [EMAIL PROTECTED] signature.asc Description: Esta parte del mensaje está firmada digitalmente ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] virtual hosting
On Wed, 2006-10-11 at 04:57 -0500, Hector Miuler Malpica Gallegos wrote: Hello friends, as I can have virtual hosting of easy form? like in zope2 -- Hector Miuler Malpica Gallegos [EMAIL PROTECTED] Sure. VirtualHost * ServerName zope3.theshire RewriteRule ^(/?.*) http://localhost:8031/++vh++http:zope3.theshire:80/++$1 [P,L] /VirtualHost Hope that helps. Darryl ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Get Started
On Wed, Oct 11, 2006 at 11:45:37AM +0200, Philipp von Weitershausen wrote: Jegenye 2001 Bt (Mikl??s Priszny??k) wrote: 2006/10/11, FB [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Maybe. I wrote a script which creates a new application but I don't know, if it's still working with a current Zope release. https://svnserv.cbs.mpg.de/svn/edv/EDV/zope3-mpgsite/lib/python/mpgsite/tools/zag I've not used it for a long time. There are no warranties but feel free to try. flamewar_start_reason tal:content=It's written in Perl :-) / Yeah, that's blasphemy indeed! :D Hopefully a more generic tool, a la ArcheGenXML, will emerge for Zope 3. I've seen a few people suggest tools like that for Zope 3. I generally think it's a good idea. However, us core developers usually prefer our emacs/vi/... And our efforts are currently geared towards making Zope 3 simpler to get started with -- without any special tools (sprint coming up this weekend). I usually like a good editor as well. But since I am lazy I would love a tool that produces the skeleton of files that can easily be generated from something like an UML file. That would let me concentrate on the interesting parts instead of having to type the same kind of stuff every time... -- __ Nothing is as subjective as reality Reinoud van Leeuwen[EMAIL PROTECTED] http://www.xs4all.nl/~reinoud __ ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Intended scope of viewlets?
Thanks again. I think I understand why I was having difficulty with this. It seems that under this model, views are tied directly to skins, and if you wish to change skins, you change the template registration, and probably some CSS resource registrations, rather than simply specifying another skin using ++skin++. I suppose, however, that I could create a lower level layer that I did all of my skin-independent view registrations on. I think I will try to write up all of my experiences with viewlets and post it somewhere, as it seems like they are very powerful once you can understand how to properly separate concerns with them. Alec On 10/10/06, Jürgen Kartnaller [EMAIL PROTECTED] wrote: Hi Alec. Alec Munro wrote: One more thing. When using this masterpage idea, what is the pattern for creating new pages? For example, I would traditionally have: MyObject/SubjectOne.html MyObject/SubjectTwo.html MyObject/SubjectThree.html Registered with: page for=IMyObject name=SubjectOne.html template=subjectone.pt / ... Where subjectone.pt would probably start with something like the following: html metal:use-macro=views/standard_macros/view Obviously, the above no longer applies, so what's the equivalent? My initial thought, if I am sticking as close to the above paradigm as possible, would be to have registrations for each that all reference the same class, being the one that implements the interface my masterpage is registered for. Something like the following: page for=IMyObject name=SubjectOne.html class=.MySkin.SimplePage / page for=IMyObject name=SubjectTwo.html class=.MySkin.SimplePage / ... In some ways, this makes sense to me, but it leaves me unsure how to properly differentiate the content on each page, without implementing something on each ViewletManager that detects the name of the page requested, and returns the appropriate content. Unless of course I can register Viewlets or ViewletManagers to specific page names? Thats what the view parameter in the viewlet directive is doing :) My guess is that the above pattern simply isn't applicable to the use of viewlets, and there is something else I should be using. I will investigate uses of viewlets, but if anyone knows the answer offhand, I would very much appreciate it. Simply derive a new view class from SimplePage and use that class when registering a new page. class AnotherPage(SimplePage): pass Now you can register a new page. Note taht we do not need to define the template because it is already defined for SimplePage. page for=IMyObject name=SubjectTwo.html class=.MySkin.AnotherPage permission=... / You can now register your viewlets on that class (page) : viewlet name=anotherViewlet for=IMyObject view=.MySkin.AnotherPage manager=... class=... layer=your skin permission=... / Also note that all viewlets registered for SimplePage are also visible in the new page. You register globally visible viewlets on your SimplePage. Its simple and powerful, isn't it ? The most important thing you must see is the ability to register a viewlet on the context, the view, the manager and the request. This gives you a lot of control over the viewlet. Here is the code I'm using for my viewletmanager to have more control over the visibility of viewlets. I use this manager im my main template. class ContentViewletManager(WeightOrderedViewletManager): interface.implements(IContentViewletManager) def filter(self, viewlets): viewlets = super(ContentViewletManager, self).filter(viewlets) return [(name, viewlet) for name, viewlet in viewlets if getattr(viewlet, 'available', True)] If the viewlet provides the property 'available' it can control if it is visible or not. Among other things I use this often to have a dependency on user login. IUnauthenticatedPrincipal.providedBy(self.request.principal) Thanks again, Alec Munro On 10/10/06, Alec Munro [EMAIL PROTECTED] wrote: You were correct, because my skin was inheriting from z3c.layer.minimal.IMinimalBrowserLayer, which as best I can tell, doesn't inherit from the default layer (there's probably a ZCML directive to set this somewhere though), my pages/templates/viewlets/etc weren't available to be looked up. I made my skin inherit from IDefaultBrowserLayer, and everything's peachy. Thanks everyone, for all your help so far. Alec On 10/7/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think the layer attribute may be missing. browser:page name=my.project.index.html for=* class=.myskin.SimplePage permission=zope.Public layer=.interfaces.MySkin / browser:template template=myskin_master.pt for=.interfaces.ISimplePage layer=.interfaces.MySkin / Kevin Smith - Original Message From: Alec Munro [EMAIL
[Zope3-Users] Call for Members of Panels on Web Technologies
Talks at previous PyCons have tended to be of the lecture format. I'd like to see if we can get some panel discussions going and am looking for participants. At PyCon 2005 in D.C. Michelle Levesque gave a wonderful talk, PyWebOff, contrasting a few of the web frameworks. However, it is a lot of work to research many of them, so how about instead we just invite some experts for the various frameworks to debate them instead? And answer tough questions from the audience? For updating, links to the following rough outlines are at: http://us.pycon.org/TX2007/TalkIdeas We need some moderators to work up more questions, and to coordinate with the panelists. Hey, it may be easier than preparing your own presentation and slides. I'd like to see three talk panels: --- Panel - Web Frameworks Frameworks * Django * Zope 2 * Zope 3 * Twisted Web * Quixote * TurboGears Questions Put To the Panel * When did the framework come into existence and what problem was it created to solve? * What are its strengths and maturity level? What is it ideal to use for? * What are its weaknesses? What would you NOT use it for? --- Panel - Web Templating Languages Templates Covered * Zope TAL, TALES, METAL * Twisted STAN * Cheetah * Myghty * Django's Template Language * TurboGears Kid * Quixote Python Template Language (PTL) Questions to Put to the Panelists * Python code in your HTML, or HTML in your code? * Which can and cannot be handed off to a graphics designer? * Where do they stand in performance? in Caching? * Which can work with less than a page i.e. Zope viewlets, widgets? * Which frameworks let me plug in my choice of template language? (initially show the audience a representative sample of each) --- Panel - Object Relational Mappers (ORMs) Mappers Covered * SQLObject * SQLAlchemy * Django ORM Questions Put to Panelists * Natural or artificial keys? * Support for existing database schemas or must I do it your way? * How is the performance? * How smart is it in handling complex schema? * Any support for access control security at the object level? * What flavor and degree of transaction support is offered? Per thread, per context, autocommit? -Jeff Co-Chair PyCon 2007 ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Recursion using viewlets.
Hi List, After a very thorough schooling in the use of viewlets in my other thread, I thought it might be better to start a new one for this topic. What's the recommended practice for dealing with recursion using viewlets? In my case, I have a hierarchy of objects, each implementing IContainSomething, and I want to display the entire hierarchy. I'm sure this is a simple case, and there's probably even good example code freely available somewhere, but I haven't yet found it. Thanks again! Alec ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] virtual hosting
I do not have apache, I have zope3: ( seemed to /virtual_hosting of zope2 : 01domainzope3.com /miuler/01 02domainzope3.com /miuler/02 El mié, 11-10-2006 a las 22:05 +1300, Darryl Cousins escribió: On Wed, 2006-10-11 at 04:57 -0500, Hector Miuler Malpica Gallegos wrote: Hello friends, as I can have virtual hosting of easy form? like in zope2 -- Hector Miuler Malpica Gallegos [EMAIL PROTECTED] Sure. VirtualHost * ServerName zope3.theshire RewriteRule ^(/?.*) http://localhost:8031/++vh++http:zope3.theshire:80/++$1 [P,L] /VirtualHost Hope that helps. Darryl signature.asc Description: Esta parte del mensaje está firmada digitalmente ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] ReadOnly svn access not working
I'm aware there are some current issues with www.zope.org. but just in case this has been missed... svn ls svn://svn.zope.org/repos/main svn: Can't connect to host 'svn.zope.org': Connection refused Thanks -Tom ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users