[Zope3-Users] closing external 8080 access when using apache proxy/rewrite
I'm running a site at 8080 accessed through apache using the normal proxy/rewrite methods detailed in philikon and srichter's books. I'm thinking about using apache authentication, so obviously I'd need to shut off any outside 8080 access that would bypass apache. **What is The Best Way to do this?** I've searched around without luck. Should I do something on the zope side? On the packet filtering side? Thanks, Joel PS. Apache config is annoying. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: redirects in a formlib EditForm
** What is the best way to use a formlib EditForm to redirect a user after applying changes without fully cloning a handle_edit_action method? ** I'm doing it this way : def render(self): if self.errors is None or self.errors: return super(EditPerson, self).render() self.request.response.redirect('..') Jürgen Thanks Jürgen! That works perfectly for me. Looking one step forward, I would like to redirect the user back to the previous page from whence they came (without using sessions). I figure I am going to need to stash that value on my EditForm class and then pull it up during the redirect in my render method. I've done my best to explore this, but I can't figure out where the previous page information will be available on my EditForm. ** Where should I stash previous page information for future redirects on my EditForm? ** Thanks, Joel ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: redirects in a formlib EditForm
On 2/26/06, Gary Poster [EMAIL PROTECTED] wrote: On Feb 26, 2006, at 4:17 PM, jürgen Kartnaller wrote: Joel Moxley wrote: ** What is the best way to use a formlib EditForm to redirect a user after applying changes without fully cloning a handle_edit_action method? ** I'm doing it this way : def render(self): if self.errors is None or self.errors: return super(EditPerson, self).render() self.request.response.redirect('..') Jürgen Thanks Jürgen! That works perfectly for me. Looking one step forward, I would like to redirect the user back to the previous page from whence they came (without using sessions). I figure I am going to need to stash that value on my EditForm class and then pull it up during the redirect in my render method. I've done my best to explore this, but I can't figure out where the previous page information will be available on my EditForm. ** Where should I stash previous page information for future redirects on my EditForm? ** That's also an unsolved use case I have. The 'default' template of 'FormBase' contains the slot 'extra_info' which could be filled with some hidden input fields. I defined a new template for my own EditForm. But now I would like to use the existing template in formlib 'pageform.pt' and fill the slot but don't know how. Is this a possible way and the right way ? How can I use the existing template ? It must be useable with metal:use-macro somehow. Yes, we write custom templates that use hidden input fields. We reuse the existing template by putting the default template on another attribute of the view class, and then saying 'metal:use- macro=view/...' For instance class MyForm(zope.formlib.form.EditForm): base_template = zope.formlib.form.EditForm.template template = (...a named template if you want, or just a page template directly...) Then in your template, you can refer to macros in the original like this: 'metal:use-macro=view/base_template/macros/extra_info' Notice that the pageform.pt *extends* the context/@@standard_macros/ view macro, so you can customize slots from your main template too. There are lots of other solutions, but that's the one I know of that I consider to be best ATM. Gary___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users Thanks. Ok, so now that I know the location on which to stash previous page information, _how_ do I get the previous page information? ** Ie, at what method in the edit form do I pull out the page from whence the user came? And most importantly, how do I get the page from whence the user came? Is it in the incoming request? I've been looking at the request object, but I did not see that information in there. ** So the idea is... page X - edit.html - apply - page X ... where page X can change. Thanks, J ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] redirects in a formlib EditForm
Hello list, I keep hearing about the wonders of formlib, so I've been trying to migrate one of my zcml browser:editform generated forms to formlib. Once I figured out how to select(...) fields to avoid problems with the __parent__ field on my interface, this worked acceptably. After edit changes are applied, I want to redirect the user to another page (ultimately, to the page from which they came). Before I did this with a changed method on my edit form class, but this did not work when I switched to formlib. Below you can see my approach. From within my changed method, I manually call handle_edit_action which gives a TypeError because the 'Action' object is not callable. Unfortunately, without handle_edit_action, the object never gets changed upon apply. ** What is the best way to use a formlib EditForm to redirect a user after applying changes without fully cloning a handle_edit_action method? ** Many thanks, Joel from zope.formlib import form from zope.formlib.form import action, haveInputWidgets class PitcherEditForm(form.EditForm): form_fields = form.Fields(interfaces.IPitcher).select('Last', 'First', 'ERA') @action(_(Apply), condition=haveInputWidgets) def changed(self, action, data): #TypeError: 'Action' object is not callable self.handle_edit_action(action, data) self.request.response.redirect('../../@@overview.html') ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] syncing object view after an attribute change
Hi all, I've been developing an app, and I keep running into this problem. Briefly, the object view loaded in my page will be one step out of sync with a change I make on the object. This seems to be something very basic that I am missing, but I have not been able to find an appropriate fix and instead rely on the simple workaround of pressing refresh in my browser. By way of an example, I have a parent container with child objects. In the container page template view, I have a simple input form that calls a function deleting all child objects. td colspan=7 tal:define=result view/formClearAll form input type=submit name=CLEAR_ALL value=Clear All/ /form /td When I press Clear All, the new page shows the views on the old child objects. When I press refresh, the new page now correctly has removed the child objects. Can someone please give me a pointer on how to remedy this and get my views back in sync? Thank you, Joel ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] introductory app idea: music filesystem browser
Hi all, Recently, I've been doing some thinking about cool ways to introduce a Python programmer to Zope3. Baiju has done a great job with his bookmarker app in his Zope3 in 30 Minutes. The upside (and what was it was designed for) is simplicity, but it's not especially useful or cool past the learning value. Likewise, Stephan's message board app is great for a very in-depth introduction to Zope3. The upside is that it covers most everything and the application itself could be useful; however it gets very involved very quickly, and I argue it would be biting off more than a someone simply exploring Zope3. I think the learning progression of Philipp's worldcookery app is excellent, but it might be outside of the scope of, again, someone doing a cursory exploration of Zope3. Imagine this for a second -- what if we wrote a very simple music filesystem browser? We would want to keep this at about the level of sophistication of the bookmarker app. I would argue that someone might see Zope3 and want to know what it was all about. What better way to show them by just providing a web interface to their Beastie Boys collection in a few hundred lines of code? Useful and cool! I bet with some simple tweaking of the mp3 id3 tags, we could load in album images from the web and so forth. The app could have a function for zipping together an album to allow an all-at-once download. And so forth. With some screencasts, this could be a fun little introductory app that someone could get in and out of in an hour. Just a thought. Joel ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Please Guido, pick me, pick me!
The Zope Foundation, which is probably coming pretty darn soon, might help catalyze contributors a bit. It will own the zope3.org domain, the zope.org domain, and probably lots more, and all of the software. But before or after the foundation, I think small steps are more likely to succeed than grand plans. Someone writing an impressive brochure-ware site about Zope 3 is going to be easier and more impressive than trying to get folks to agree on a grand Zope 3 software site. Someone assembling some of the word-smithing in this thread might even generate a simple impressive advocacy *page* that could be linked to from the front of zope.org. I thought Joel's post had some ring to it, for instance. Whether or not we have a Zope 3: Rebel Angel rename :-), it would be great to see Joel or Martin or someone step up to put some advocacy out there. If I can help with trying to figure out who to ask for what, let me know. As I see it, Zope 3's central marketing issue is the lack of a coherent online identity. There needs to be a single place that answers the following questions: 1) What is Zope 3? 2) Why use Zope 3? 3) How does Zope 3 compare to competing frameworks? 4) How do I get started? Largely, this is assembly of the Zope 3 FrontPage, philikon's first two chapters, and the appetizer quick start guides on worldcookery. However, I would also love to see a section on the lead developers answering Q1-Q3. And this would be in conjunction with conveying... Zope3's shtick: Zope3 is not flashy. Zope3 does not put pastel colors on its website. Zope3 is the no-nonsense, industrial strength platform. It's where you come when you want to do it right. It was coded with the most rigorous standards by a bunch of hard-nosed sons of bitches who don't have time for froofy marketing :). And so forth. This would come across in lead dev's answering Q1-Q3. And finally, the site should demonstrate the industrial strength quality with examples. Little snippets from developers of SchoolTool, corporate users, and so forth should demonstrate hey, we're for real, and we don't mess around -- you give me an animated screenshots, I raise you a XYZ transaction per day uber site. In a sense, we'd want to portray ourselves as the Chuck Norris[1] of web platforms :) Bottom line, a coherent online identity would go a long way. Instead of doing some snazzy marketings, let's communicate the character that Zope3 does have. It sounds like zope3.org under ZF might be the ideal way to do this, As for codenames, this is just one way we could help create a coherent online identity. I certainly think release names would be fun (and not distracting to the central Zope 3 brand we'd want). Overall, I think the time has come for communication of Zope 3 identity to move hand in hand with development. Joel [1] For those not familiar with Chuck Norris, he's a no-nonsense martial arts guy and the subject of these very amusing facts. http://www.4q.cc/chuck/index.php?topthirty ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Please Guido, pick me, pick me!
Stefane Fermigier wrote: Wade Leftwich wrote: Guido van Rossum is looking for a web app framework. http://blog.delaguardia.com.mx/index.php?op=ViewArticlearticleId=34blogId=1 Zope is conspicuous by its absence from the discussion. Hardly a mention, and no advocacy at all. Is Zope just too heavyweight for the project he has in mind? Or what? I don't think the point is trying to convince guido to use Zope for his pet project, the point is global advocacy: - Guido's word is considered gospel by many people (in that occurrence, I must confess that I have been profoundly disappointed by his attitude - his utter and a priori rejection of XML for a template language, that will be used 95% for the time to produce (X)HTML and the 5% remaining other variant of XML, with all that it implies in terms of validation, etc. is plainly stupid). - Like you noticed, Zope quasi-absence from the discussion is suspicious. Lennart did a reply on his blog (http://blogs.nuxeo.com/sections/blogs/lennart_regebro/2006_02_01_guido-webframeworks). Anyway, I'm saddened by both the quasi-absence of the Zope community in this debate, and also the badmouthing of Zope (even sometimes, the hatred) by some Python developpers taking part in the discussion. There are, however, some constructive remarks like Ian Bicking's: http://blogs.nuxeo.com/sections/blogs/lennart_regebro/2006_02_01_guido-webframeworks?post_id=if-mohammed-won-t-come S. I think this has to do with python being used both as a scripting language and as a language to create high-level components. There will always be a category of users looking for quick-and-dirty templating capabilities in web frameworks and others looking for more abstract components that address issues from a more abstract and certainly more complex perspective. In zope itself level the same opposition can be found between file-system vs TTW python-script-based development. I wonder how those who criticize zope3 for being too big a framework and too complex to understand, would figure out how to use Java-based web application frameworks... /JM I've followed the Guido blogs/discussion loosely. As a relative newcomer, this is my first real experience with the Python community's confusion of Zope2 and Zope3. I've seen on the list that people have been discussing renaming and other remedies to this problem. In my opinion, I think a little branding could go a long way. Instead of renaming the entire project, call it Zope3 Zebra or Zope3 Panther (clearly these are horrible, but you can see where I am going with this). Then create a dedicated website www.zope3zebra.org that basically links the Zope 3 book, tutorials, example code, and existing projects like SchoolTool on the front page. Clearly brand it as a industrial-strength, pythonic web framework and a complete rewrite from Zope2. Provide a link to all Python web frameworks and explain the advantages of industrial-strength, non-hackish code for people who want to do it right the first time. This front page will provide a jumping off point for zope3 devs and users. Does this make sense? It's only a small rebrand (and the Zope3 stays intact) and an assembly of components that already exist. Basically, you can use this occasion as a coming out party... Zope3 is here, and we're for real. Bottom line, I think the proof is in the pudding, and Zope3 quality is superb so it's not going anywhere. But a little better organization/marketing to the outside world could go a long way. Anyways, a thought. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] NameChooser functionality for IContainerNamesContainer
I successfully added a name chooser for objects added through an add form to my container. This involved implementing IContainerNamesContainer on my container, INameChooser on my NameChooser, registering each, and being sure to set my set_before_add fields in the addform registration. What is The Right Way (tm) to use this NameChooser functionality outside of the addform? In other words, I have a method that defines the container from a file as follows: self[name] = obj This obviously would overwrite duplicates, etc. I would prefer to have something as follows which would use the NameChooser machinery automatically (ie, without having to get the NameChooser adapter in my method). Is there a way I can do something along the lines of this? self.add(obj) Thanks, J ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Zwiki issues with Unicode text pasted from Word
Thank you Duncan and Gary for your informative replies yesterday. I'm working on understanding and implementing your input. In the meantime, I'm having an issue with my zwiki. I checked on google, and I do not find this as a known issue. I have not had time to extensively document the behavior, but I can report the following: My zwiki page bombed (System Error) when a user copied and pasted a paragraph from Microsoft Word into the edit form of the wiki page. After some quick debugging, I found two unicode characters to be the problem: Unicode characters 2103 and 2019 (right single quotation mark and en dash, respectively). Thus, whenever we have apostrophes and dashes in Word, they will kill the wiki page when copied in the edit form. Which is suboptimal :) I pasted the traceback here: http://paste.plone.org/289 which culminates in UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 4104: ordinal not in range(128) Clearly, the wiki just does not know how to encode these characters. Anyways, a workaround or fix would be very nice because one of the main reason I wanted the wiki was to not have to deal with revisions in Word. Thanks, Joel PS: This is zope-3.1final and zwiki-3.0.0 ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: worldcookery Christmas Dinner
I apologize for my replying to self, but I was re-reading Stephan's and then Philipp's book and realized that one portion of my email has been answered. Thus, I'm hoping to clarify my question to the list. Looking at the messageboard content class, I then did a grep on Philipp's worldcookery examples directory for btree -- sure enough, the last chapter before Expert level (14, aptly titled Containers), addresses RecipeFolders (what I had called RecipeContainers). It must have been late when I read that chapter because it did not reach to proper location in my memory :) Bottom line, I will re-summarize my original question below with this information in mind: * RecipeFolder Views. In a RecipeFolder page template file, how would you view both parameters on the parent RecipeFolder as well as specific child Recipes within the container? * RecipeFolder Controllers. How would you access an external python method for compiling statistics on this container and then update the view? Clearly, I'm still lacking some basic understanding in these areas, and I'm going to continue to push forward, and any guidance or suggestions of example code would be hugely appreciated. Again, thanks for your understanding and help. Best, Joel On 10/2/05, Joel Moxley [EMAIL PROTECTED] wrote: Hello yall, I'm a python guy who wanted to provide an interface for some baseball-related code to the web, so I naturally turned to Zope. I fumbled around for a while, but Philipp and Stephan's books got me on the right track. Philipp's book has been wonderful for learning Zope from scratch, I've read and re-read the first fourteen chapters (ie, everything but Expert stuff). In doing so, I created my own worldcookery-esque content management system. However, there are two significant holes in my knowledge that I want to address: 1) integrating buttons to run controller style scripts to tabulate and display statistics about multiple content objects, and 2) displaying nested content objects. For those of yall familiar with the worldcookery scheme, I wanted to do something along the lines of a Christmas Dinner. This would be a new content object, RecipeContainer, which contains the turkey recipe, the sweet potato recipe, and the cornbread recipe content objects. You would have a page template for displaying all the recipe content objects on a single page (preferably with minimize/maximize capabilities), an add/remove dialog for existing recipes in the database, and a button for accessing an external python script to compile and display statistics (like what would be the total time to prepare all dishes). In other words, a user might decide to also cook cornbread for Christmas dinner. Thus, the user would add a recipe for cornbread in the regular Add Recipe view. The user would then go to the ChristmasDinner RecipeContainer content object where they would select the cornbread recipe object from a dialog containing a list of possible recipes. The user would then press a button to access an external python script which would calculate the expected time that cooking Christmas dinner with cornbread in addition to the turkey and sweet potato. This expected time (and other statistics) would be displayed on the ChristmasDinner view along with the recipes. Right now, I'm looking at Stephan's book and the messageboard scheme to get ideas (ie, message content objects inside the messageboard), but I wanted to get input from yall about the best ways to do this. I realize this will probably seem obvious, but I am a true beginner in the scheme of things, and I'm hoping that my experience might help extend the worldcookery teaching paradigm. Many thanks, and go Zope 3! Joel ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users