[Zope3-Users] Recipe with default values

2006-02-16 Thread Marco Mariani
In chapter 5.4 of the cooking book, Philipp says: [...] We could now implement a custom factory, for example one that allows us to set initial attribute values of the recipe. (We would normally extend the Recipe class with a constructor to do that, but let us implement a factory here for demon

Re: [Zope3-Users] Re: Recipe with default values

2006-02-21 Thread Marco Mariani
Philipp von Weitershausen wrote: I presume, this is what you want: class Recipe(Persistent): def __init__(self): self.creation_date = datetime.datetime.now() Thanks for the reply. That's the idea, but it works only if I don't add creation_field to the add view: When

[Zope3-Users] worldcookery.browser.widget.DynamicSequenceWidget

2006-02-24 Thread Marco Mariani
How should I modify the custom widget in the recipe examples to make it work with 3.2.0 ? As it is, the program does not work from chapter 7 onward I get this on zope.app.form.browser.SimpleInputWidget at every attempt to display the widget: instance = self._widget_factory(*args) TypeError

Re: [Zope3-Users] worldcookery.browser.widget.DynamicSequenceWidget

2006-03-21 Thread Marco Mariani
Ulrich P. Klein wrote: How should I modify the custom widget in the recipe examples to make it work with 3.2.0 ? As it is, the program does not work from chapter 7 onward I get this on zope.app.form.browser.SimpleInputWidget at every attempt to display the widget: instance = self._widget_fa

Re: [Zope3-Users] worldcookery.browser.widget.DynamicSequenceWidget

2006-03-21 Thread Marco Mariani
Stephan Richter wrote: On Friday 24 February 2006 03:43, Marco Mariani wrote: As it is, the program does not work from chapter 7 onward I get this on zope.app.form.browser.SimpleInputWidget at every attempt to display the widget: instance = self._widget_factory(*args) TypeError

[Zope3-Users] custom tuple widget

2006-03-29 Thread Marco Mariani
I'd like to create a custom widget for the "Starbucks problem" - my designation - where I need to set an attribute to a path of an external tree, which is stored on LDAP or DBMS. Basically, the content object has an attribute "store" which is a tuple of (state, city, store_no) and I would ma

Re: [Zope3-Users] ZODB storage ways

2006-04-03 Thread Marco Mariani
Andreas Jung wrote: I am searching for a way to change transparently the storage of ZODB from file-base to a relational database. In general, Zope books state, that this is possible. one solution: Unfortunately, pickles are not even remotely a S

[Zope3-Users] wfmc/README.txt ... now what?

2006-04-04 Thread Marco Mariani
Is there some example I could look at to use wfmc "in my forms"? The readme is well done and I like the package but ... how am I supposed to link process contexts to my content objects? Thanks ___ Zope3-users mailing list Zope3-users@zope.org http:

Re: [Zope3-Users] newbie question

2006-04-10 Thread Marco Mariani
张平 wrote: > Hi, > > I wanna develop a site for managing content using workflow, where can i > find any document about zope3 workflow, > You should look at the directory wfmc/README.txt in the SVN repository. It's the new workflow system. The one referred to in the book is also in SVN, but I thin

[Zope3-Users] Object Widgets

2006-04-18 Thread Marco Mariani
I'm trying to add an image field to the Recipe interface, but I don't know how to bind the "photo" attribute to the image widget. From reading the docs, I thought it was enough to specify the schema in the Object() field. I'm using Recipe because it's a well known example application, but I'd

[Zope3-Users] sequence of custom widgets

2006-05-12 Thread Marco Mariani
I've got a form which contains an object widget given by CustomWidgetFactory(ObjectWidget, MyClass) Now, how can I render a Sequence widget to store a list of MyClass instances? I suppose the (deprecated) ListSequenceWidget had this purpose? Or is it the subwidget parameter? I'm using formlib

Re: [Zope3-Users] sequence of custom widgets

2006-05-15 Thread Marco Mariani
Frank Burkhardt wrote: > some months ago, Phillip von Weitershausen wrote such a widget for > me. I'm > not using it anymore and I don't know, if it's still working. But > maybe it > will help: Thank you (and Phil), having a template surely come handy, but I have another problem. Even with the d

Re: [Zope3-Users] sequence of custom widgets

2006-05-15 Thread Marco Mariani
On Mon, May 15, 2006 at 10:43:56PM +0200, Marco Mariani wrote: > > form_fields['children'].custom_widget = > > CustomWidgetFactory(SequenceWidget, > > > > CustomWidgetFactory(ObjectWidget, Person)) Found it. Pas

Re: [Zope3-Users] Re: [Zope3-dev] Re: Zope 3 lacks Ajax capability?

2006-05-16 Thread Marco Mariani
Jim Washington wrote:From the docs: jsonserver is available at http://zif.hill-street.net/jsonserver From the docs: jsolait from http://jsolait.net is the recommended client-side javascript library. I guess I won't have problems with Mochikit instead, but why is it "recommended" ?

Re: [Zope3-Users] Re: [Zope3-dev] Re: Zope 3 lacks Ajax capability?

2006-05-16 Thread Marco Mariani
Jim Washington wrote: The last time I looked, MochiKit did JSON, but not JSON-RPC. Nor does the latest release. Point taken, tnx. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users

Re: [Zope3-Users] Re: Dynamic Typing: Are checks on interface compliance possible?

2006-05-18 Thread Marco Mariani
Reinhold Strobl wrote: > I think your approach could gain great popularity! Just wondering, what is the matter with PEP 245? According to it, "This PEP has not yet been discussed on python-dev", which is untrue, but it's been a while. ___ Zope3-users

Re: [Zope3-Users] Dynamic Typing: Are checks on interface compliance possible?

2006-05-18 Thread Marco Mariani
Stephan Richter wrote: > In addition there is the FieldProperty class, which can be used to enforce a > value. I have recently started to use it all the time. I really like it too. It also sets the attributes to the default values inside the tests, taking them from the interface definition inste

[Zope3-Users] ++skin++Boston bug

2006-05-23 Thread Marco Mariani
I'm using the Boston skin (from SVN) with Zope 3.3.0b1 My Object Widgets, that in Rotterdam are well rendered: +- Mother --+ | | | Name _ | | | +---+ +- Father --+ | | | Name _ | | | +---+

Re: [Zope3-Users] ++skin++Boston bug

2006-05-23 Thread Marco Mariani
[EMAIL PROTECTED] wrote: > Hi Marco > > [...] >> /me guesses this has to do with using the widget_row macro >> inside another widget_row, thus trying to render >> and the browser >> closes the fieldset, td and tr when it encounters a sequence. > > There is something wrong if you get a wi

Re: [Zope3-Users] Calling PageTemplate in Content object

2006-05-24 Thread Marco Mariani
On Wed, May 24, 2006 at 11:31:29AM -0500, David Johnson wrote: > from zope.pagetemplate.pagetemplatefile import PageTemplateFile > > class OrderView: > >def city(self): >return 'Fort Worth' > > class ProcessStep(StepFactory): > > implements(IProcessStep) > > orderform = Pa

Re: [Zope3-Users] Calling PageTemplate in Content object

2006-05-25 Thread Marco Mariani
David Johnson wrote: >>> orderform = PageTemplateFile('orderform.pt') >> maybe this attribute ought to be called "template" instead of "orderform" ? >> > > Does the name make a difference? Well, no, I was in a hurry, it makes a difference if you inherit from formlib but I see you don't defi

Re: [Zope3-Users] i18n questions

2006-06-01 Thread Marco Mariani
Stephan Richter wrote: >> - How do a write/register a negotiator that choose a language based on >> an attribute of the user object and then falls back to normal browser >> negotiation if that attribute isn't present? > > Just implement the right interface and register it. This is not too hard an

Re: [Zope3-Users] AJAX (was Uploading files)

2006-06-01 Thread Marco Mariani
Stephan Richter wrote: >> Just curious... what is it about AJAX that you hate? The implementation? >> The concept? Something else? > > About everything. JS has no good development tools, it is impossible to do > decent debugging and testing. (No, I do not consider the browser-based > debugger a

[Zope3-Users] IObjectModifiedEvent

2006-06-01 Thread Marco Mariani
I'm using 3.3 beta 1. I've never used events. I've subscribed to modification events on my objects: Unfortunately, modifiedObject() only gets called when new children are inserted (IMyObject provides IContainer) I do NOT get an event for changing an attribute on a MyObject instance or for

[Zope3-Users] Re: IObjectModifiedEvent

2006-06-01 Thread Marco Mariani
Philipp von Weitershausen wrote: > > >>> from zope.lifecycleevent.interfaces import ObjectModifiedEvent > > >>> from zope.event import notify > > >>> notify(ObjectModifiedEvent(myobj)) I see, thanks. I missed the notify() because I override handle_edit_action() without calling super(), and

Re: [Zope3-Users] Found a (perhaps obvious) page template speedup

2006-06-05 Thread Marco Mariani
Chris Withers wrote: The ZMI has a lot of widgets that people should want to re-use (generically: tree controls, file widgets, directory listings, etc, specifically: forms and configuration for the "generic" parts of zope) It sounds like you're advocating writing every bit of UI from scratch,

[Zope3-Users] list woes

2006-06-12 Thread Marco Mariani
I'm having this stripped-down use case. class IToy(Interface): name = TextLine(title=u"Toy") class Toy(Persistent): name = FieldProperty(IToy['name']) class IGadget(Interface): name = TextLine(title=u"Gadget") class Gadget(Persistent): name = FieldProperty(IGadget['name'])

Re: [Zope3-Users] list woes

2006-06-12 Thread Marco Mariani
Marco Mariani wrote: > class Gadget(Persistent): > name = FieldProperty(IGadget['name']) > > def __init__(self,toy): > super(Person, self).__init__(self) > Of course it's super(Gadget, self) This is not

Re: [Zope3-Users] Question about "ForbiddenAttribute"...

2006-06-12 Thread Marco Mariani
Thierry FLORAC wrote: >name="images.html" > for=".interfaces.IGalleryFolder" > allowed_interface=".interfaces.IGalleryPhoto" > template="folder_images.pt" > permission="zope.View" > class=".folder.FolderInfo" > menu="zmi_views" title="Images" /> > > But when trying t

Re: [Zope3-Users] Assigning roles to principals

2006-06-14 Thread Marco Mariani
How do I get the list of roles for the current principal? I've tried from zope.app.securitypolicy.principalrole import principalRoleManager principalRoleManager.getRolesForPrincipal(self.request.principal) and the list is empty I'm currently defining principals in principals.zcml tnx __

Re: [Zope3-Users] list woes

2006-06-14 Thread Marco Mariani
Marco Mariani wrote: > This creates the gadgets (one per each toy) but the Gadget.name > attributes, altough being created, are not persisted. > I'd like to understand if what I was trying to do with my objects should "just work", or if I misun

Re: [Zope3-Users] list woes

2006-06-14 Thread Marco Mariani
On Wed, Jun 14, 2006 at 03:22:29PM -0500, mats.nordgren wrote: > I'm not sure this is it or not but FieldProperty doesn't play nice with the > persistent list and dict, it will only accept the non persistent list. Oh, well, nice to know. > Instead of using FieldProperty, try to define it directl

Re: [Zope3-Users] list woes

2006-06-15 Thread Marco Mariani
Bernd Dorn wrote: > you reassign the attribute here, so the list is never persistent I thought about that, it's python 101 after all > in Person.__init__ do: self.gadgets=PersistentList() > > and then in growup: > > person.gadgets.extend([ Gadget(toy) for toy in baby.toys ]) Yes, indeed, what I tr

Re: [Zope3-Users] Access request object from content_factory

2006-06-21 Thread Marco Mariani
Rupert Redington wrote: > from zope.security.management import getInteraction > > request = getInteraction().participations[0] > > Why this works is outlined (IIRC) in zope/app/securitypolicy/zopepolicy.txt. > > There may well be better ways to fish for the request than this... any > offerings? >

[Zope3-Users] ldapadapter & friends

2006-06-21 Thread Marco Mariani
I'm using 3.3.0b1 trying to set up ldapadapter, ldappas & ldapauth from SVN, I see that ldapadapter uses deprecated ZCML and module locations While changing with , how am I supposed to replace this nameOnly parameter? Patch the source? Maybe it could be mentioned in http://kpug.zwiki.org/

Re: [Zope3-Users] Hook into edit-form post

2006-07-09 Thread Marco Mariani
Siddhartha Azad ha scritto: > My question is, what if I wanna do some intermediate > processing onto the values for ISidPage attribs that > the user entered into the form, before saving them? Is > there a way to provide a python class or a ZPT as a > hook when the actual post on these auto-generate

Re: [Zope3-Users] Hook into edit-form post

2006-07-10 Thread Marco Mariani
On Sun, Jul 09, 2006 at 10:47:42AM -0700, Siddhartha Azad wrote: > It updates fine, but I want the update to go through a > ZPT or some block of code once I press the "Change" > button (do the POST). > > Do you know if that is possible? "go through ZPT" as in "redirect to another page"? if so,

Re: [Zope3-Users] Zope3 workflow ?

2006-07-17 Thread Marco Mariani
Thierry Florac ha scritto: > I'm looking for components to support workflows in Zope3. > I've read into Zope3 Developer's Handbook a whole chapter about Zope3 > workflow components and utilities, but these classes don't seem to be > part of my current Zope3 release (3.3.0b1) anymore... > > Any link

Re: [Zope3-Users] testing setup

2006-07-18 Thread Marco Mariani
luis ha scritto: > I know there is a testbrowser, and I think I've read of another possibility > to somehow record a human interaction once, and then reply it in the test, > and somewhere I've seen a "TestRequest" as well...so > Look for zope.testrecorder in svn > what is the right way to do th