Re: AW: [Zope3-Users] PAU / credentials / authentication

2007-09-06 Thread Rupert Redington
Roger Ineichen wrote: > Hi > >> An: Hermann Himmelbauer >> Cc: zope3-users@zope.org >> Betreff: Re: [Zope3-Users] PAU / credentials / authentication > > [...] > >> # My event subscriber will be passed a reference to the site >> object # from which we can get the sitemanager sitemanager = >> ev

Re: [Zope3-Users] PAU / credentials / authentication

2007-09-06 Thread Rupert Redington
Hermann Himmelbauer wrote: > Hi, > After thoroughly studying Philipp's book and the PAU-doctests, I > unfortunately > still have no clue how to do my authentication. My (simple) scenario is the > following: > > - I wrote a Zope package that can be added as a site > - I have one Zope instance wi

Re: [Zope3-Users] Default Skins for certain sites - how?

2007-06-21 Thread Rupert Redington
Hi Hermann, I do this by registering a subscriber for zope.app.publication.interfaces.IBeforeTraverseEvent: the handler sets the skin: (note that my site objects have a site_skin attribute which allows me to switch skins.) def skinTraverseSubscriber(event): """ Sets the skin during travers

Re: [Zope3-Users] Re: Evolution of ZoDB after changing python modules structure (moving content classes to another module)

2007-06-12 Thread Rupert Redington
Aleksander Kowalczyk wrote: > On 6/8/07, Alek Kowalczyk <[EMAIL PROTECTED]> wrote: >> >> Alek Kowalczyk <[EMAIL PROTECTED]> writes: >> >> > >> > Hi, >> > I moved my content class from mypackage.mymodule.MyContentClass into >> > mypackage.mysubpackage.mymodule.MyContentClass. >> > But when started Z

Re: [Zope3-Users] "Wrong contained type" - why?

2007-05-02 Thread Rupert Redington
For me it was a problem with my vocabulary which works in this form... class ClipboardVocabFactory(object): implements(IVocabularyFactory) def __call__(self, context): terms = [(x.title, x) for x in \ Session().query(ArchiveObject).select()] voc = SimpleVocabulary.fromIte

Re: [Zope3-Users] "Wrong contained type" - why?

2007-04-26 Thread Rupert Redington
Hermann Himmelbauer wrote: > Hi, > As already mentioned before, I use interfaces that contain lists of other > interfaces via the following syntax: > > emails = List(value_type=Object(schema=IEmail)) > > In my formlib-based class, I have use the following, so that the widgets are > displayed co

Re: [Zope3-Users] Re: UnicodeEncodeErrors from zope/app/maildir.py

2006-11-29 Thread Rupert Redington
Raphael Ritz wrote: > Well, there are the "officials" like: > > http://unicode.org > http://en.wikipedia.org/wiki/Unicode > > but you want probably something more like > > http://www.joelonsoftware.com/articles/Unicode.html > > and for Python in particular I found > > http://w

[Zope3-Users] Annotations factory

2006-11-28 Thread Rupert Redington
I've just made my first annotation adapter using zope.annotation.factory, but I find myself needing access to some attributes of the adapted object. Using the older pattern I would gain access to the original object through the context passed to the __init__ of my adapter. The annotations factory d

[Zope3-Users] UnicodeEncodeErrors from zope/app/maildir.py

2006-11-28 Thread Rupert Redington
I write this in expectation of needing to kick myself quite soon... I collect some data from a form, using a Text schema/widget, get my IMailDelivery utility (which uses queued delivery) and pass my from and to addresses and the message data I collected from the form (with a subject line and a co

Re: [Zope3-Users] filter possibilities

2006-09-26 Thread Rupert Redington
I'm no expert on this... In fact I often find myself struggling to get cataloging in Zope3 to do what I want in a painless way (which is probably why hurry exists...). Experts please correct me if I'm doing anything objectionable... I'm assuming that you've got an IntIds utility and a catalog, and

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

2006-06-21 Thread Rupert Redington
Philipp von Weitershausen wrote: > > That already sounds like bad design. Why would the local utility worry > about URLs at all? > It probably is :-) The utility is responsible for generating a PDF snapshot of a view - as seen by the invoking user at the point when the utility is invoked. To d

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

2006-06-21 Thread Rupert Redington
John Smith wrote: > --- Rupert Redington <[EMAIL PROTECTED]> wrote: > >> I realise that I shouldn't use zapi anymore... apart > > > Good gracious! > > No zapi? > > How did I miss that? Where do I get my utilities, > parents, roots, adapter

[Zope3-Users] Formlib and fieldsets

2006-06-21 Thread Rupert Redington
Hi All, I can't find anything in Formlib to indicate that there's a well trodden path to handling fieldsets in formlib. I'm not really sure what the best way to do this is. Clearly the formlib form templates that I can see in Zope 3.2 don't contain any code for handling fieldsets - but that doesn

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

2006-06-21 Thread Rupert Redington
Philipp von Weitershausen wrote: > Marco Mariani wrote: >> Rupert Redington wrote: >>> from zope.security.management import getInteraction >>> >>> request = getInteraction().participations[0] >>> >>> Why this works is outlined (IIRC) in zop

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

2006-06-21 Thread Rupert Redington
Hi John, When I'm looking for the request object from somewhere like that I use 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 fo

Re: [Zope3-Users] Create RSS feed

2006-06-01 Thread Rupert Redington
Tarek Ziadé wrote: > Achim Domma wrote: > >> Hi, >> >> I want to provide an RSS for a content object which is a site. Seems >> to me, like this should be a generic functionality so I wonder if >> there is already some product which I did not found!? >> >> regards, >> Achim >> >> __

Re: [Zope3-Users] ViewletManager

2006-03-29 Thread Rupert Redington
Hi David, should do it... Rupert David Johnson wrote: > Has anyone used a viewlet manager? I think I understand how to define one, > but I don't think I understand how to make it show up on a page. Is it a > skin thing or some tal code? I'm think it must work something like: > > > > >

Re: [Zope3-Users] Grants to unathenticatedPrincipal[Resolved]

2006-03-20 Thread Rupert Redington
Frank Burkhardt wrote: > Hi, > > On Sat, Mar 18, 2006 at 10:32:39AM +0000, Rupert Redington wrote: >> When I try to make a permission or role based grant to zope.anybody >> through zcml I fail with: >> >> File "/home/rupert/Zope3/lib/python/zope/app/

[Zope3-Users] Grants to unathenticatedPrincipal

2006-03-18 Thread Rupert Redington
When I try to make a permission or role based grant to zope.anybody through zcml I fail with: File "/home/rupert/Zope3/lib/python/zope/app/security/principal.py", line 50, in checkPrincipal raise ValueError("Undefined principal id", principal_id) zope.configuration.config.ConfigurationExecuti

Re: [Zope3-Users] Check permissions

2006-03-17 Thread Rupert Redington
from zope.security.management import checkPermission if checkPermission('zope.ManageContent', self.context): """ ... """ Cheers, Rupert Frank Burkhardt wrote: > Hi, > > how can I test, if the current principal (e.g. by being member in a special > group) has a given permission on a given c

Re: [Zope3-Users] Problem with the Zope3 book Example (Can't Browse Interface in Zope 3.2)

2006-02-27 Thread Rupert Redington
Siddhartha Azad wrote: > Hi all, > I recently bought the "Web component Devlopment with > Zope3" book and downloaded the worldcookery example. I > tried to deploy the example (chapter 5) into my Zope > 3.2 instance and restarted it. The book says that I > should click on "Manage Site" and go to "Si

Re: [Zope3-Users] zodb objects backup

2006-02-25 Thread Rupert Redington
Alen Stanisic wrote: > On Sat, 2006-02-25 at 07:52 -0600, Andreas Jung wrote: >> --On 26. Februar 2006 00:04:39 +1100 Alen Stanisic >> <[EMAIL PROTECTED]> wrote: >> >>> Hello, >>> >>> what would be the best way of taking a backup of persistent objects >>> inside Data.fs with possibility to rebuild

Re: [Zope3-Users] Trying to use browser:form -> 404

2006-02-10 Thread Rupert Redington
Florian Lindner wrote: > > Also specifying an interface and calling the view from an object implementing > this interface does not make it work. > >> FYI - Florian, it appears we're doing something very similar - mines a >> signup/registration form too! Do you intend to submit the form data to

Re: [Zope3-Users] Trying to use browser:form -> 404

2006-02-10 Thread Rupert Redington
Florian Lindner wrote: > Am Freitag, 10. Februar 2006 15:18 schrieb Garanin Michael: >> I simulate this for Buddy from buddydemo (see attached) ==> it is normal >> work for Buddy-object! >> >> I think you make mistakes: >> 1) __init__ for 'view' always get 3-parameters (self, context, request) > >

Re: [Zope3-Users] Trying to use browser:form -> 404

2006-02-10 Thread Rupert Redington
Garanin Michael wrote: > В Птн, 10/02/2006 в 14:22 +0100, Florian Lindner пишет: >> Am Freitag, 10. Februar 2006 14:05 schrieb Garanin Michael: >>> Do you register the 'centershock'skin? >>> Write this part of zcml-code, please. >> Yes, there are a number of page directives that use the centershock

[Zope3-Users] Javascript and custom widgets

2006-02-09 Thread Rupert Redington
I'm missing something... again... I've started writing some widgets for my current project, some of which will make use of some javascript. I'd like to load a script in the head of the page when such a widget is being used (so that a window.onload function can parse the dom tree and apply the rel

Re: [Zope3-Users] passing data to nextURL()

2006-02-07 Thread Rupert Redington
> How would you do it in another framework? > > One solution would be to pass along a nextURL field name. Would that work for > you? > > Regards, > Stephan You're right, of course, passing the return url in a hidden form field is the usual solution. I've always felt it's slightly inelegant t

Re: [Zope3-Users] Best way to add a Principal to PAU

2006-02-07 Thread Rupert Redington
Florian Lindner wrote: > Am Sonntag, 5. Februar 2006 22:37 schrieb Stephan Richter: >> On Sunday 05 February 2006 12:34, Florian Lindner wrote: >>> I've managed to add a principal to a principal folder inside a PAU: >>> >>> pau = getUtility(IAuthentication) >>> pfolder = pau.keys()[0] >>> pri

Re: [Zope3-Users] Still trying to figure out PAU

2006-02-03 Thread Rupert Redington
Florian Lindner wrote: > Am Freitag, 3. Februar 2006 04:07 schrieb Gary Poster: >> On Feb 2, 2006, at 4:41 PM, Florian Lindner wrote: >>> Hello, >>> I'm still desperately trying to figure out the >>> PluggableAuthentication. >> Since no one has replied, I'll try my "30-second remediation" >> techni

Re: [Zope3-Users] "Forbidden Attribute" errors whilst adapting to schema

2006-02-03 Thread Rupert Redington
Dominik Huber wrote: > I prefer the trusted adapter because they encapslulate the adapter > inside a security proxy. Then the trusted > adapter has full access to the underlying object. That simplifies the > security story very much because you handle it on the adation level. If > you use locatabl

Re: [Zope3-Users] "Forbidden Attribute" errors whilst adapting to schema

2006-02-03 Thread Rupert Redington
Dominik Huber wrote: > Rupert Redington wrote: > >> > for=".interfaces.ILink" >> provides=".interfaces.ILinkDetails" >> factory=".link.LinkDetails" >> trusted="True" >> /> >>

[Zope3-Users] "Forbidden Attribute" errors whilst adapting to schema

2006-02-03 Thread Rupert Redington
Morning (if it is for you)... I've been trying to write an adapter which stores data submitted by a schema generated form into the annotations on an object. I've been guided in this by both Stephan's and Philipp's books (though neither provide an example of what I'm trying to do). My unit tests in

[Zope3-Users] passing data to nextURL()

2006-01-25 Thread Rupert Redington
I'm currently writing a blogging application in zope3, and enjoying the learning curve after some years working with zope/plone. I need for users to add comments to items (so I've got a content class and the requisite browser:addform entries etc) all of which works fine. My problem is that after