Re: [Zope] how to check a user role with data entred by user?
K, ill try to explain in more detail. :) What I want to do is this: I create 2 roles in zope - manager and client for example. I than create 2 users - zoe and don. Zoe has password A and role manager and don has password B and role client. Now I go to the log in page of my site, it has 2 fields - username and password. What I want to do is this: If the user puts in the fileds zoe and A I want to be able to identify the user zoe with the role manager And if he puts don and B I want to identify him with the role client, anything else he puts in I want to consider him as an anonymus user. I hope this clears things up :) -Original Message- From: Lennart Regebro [mailto:rege...@gmail.com] Sent: Thursday, March 05, 2009 11:33 PM To: Dvir Bar-lev Cc: zope@zope.org Subject: Re: [Zope] how to check a user role with data entred by user? On Thu, Mar 5, 2009 at 09:21, Dvir Bar-lev wrote: > What I did was this, I created a folder in the ZMI and there I created a > user folder(acl_users), in the user folder I defined 2 new roles. > > Now, I have a log in form where the user fills out user name and password, I > want to check if the data he entered matches 1 of the roles I defined in > the ZMI . I can't find any info or example how to do it, not on the web nor > in the documentation. This is a classic case of you not telling is what you want to do. Why do you want to check if the data he enters matches on of the roles? You do that with if entered_data in (role1, role2): which I suspect isn't what you are asking at all. :) Tell us what you are trying to achieve. -- Lennart Regebro: Pythonista, Barista, Notsotrista. http://regebro.wordpress.com/ +33 661 58 14 64 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] trivial: hello world with filesystem based egg sources
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Your question makes little sense. The term "egg sources" has nothing to do how to develop something for Zope. In Zope land you either write a Zope 2 Product (the traditional old way) or as a python package - depending on your needs and use case. We don't write eggs - we write packages and distribute them usually as source code distribution. An *egg* is basically only an setuptools *deployment* format. So you don't write eggs, you write proper Python packages. - -aj On 07.03.2009 23:21 Uhr, David Zejda wrote: > Hello, > > I try to develop something in the egg way, but still missing a point. > > I have a nice, fresh chrooted env with python, zope, plone etc. For > installation I used buildout. Zope works neatly. > > In the home dir of chroot there is subdir of my project with subdirs > like bin (scripts buildout, instance..), eggs, fake-eggs, products, > src.. and in the root of project there is buildout.cfg. > > I'd like to start with easiest possible piece of python code in the egg > form (to be redistributable), which could be treated by zope. > > I started with paster -t plone and answered a few questions. It created > couple of dirs in src. I put the name of newly created directory to > buildout.cfg sections [buildout]/eggs, [buildout]/develop, > [instance]/zcml and rerun buildout. > > The path_to_chroot/src/projectname seems to be listed in the Debug > Information of Zope instance. > > And now, please, what to do now, to have a few python lines somewhere in > the egg dir, which the zope would know how to deal with? And on what url > will be the "hello world" available then? > > Thank you for a patience.. > With regards > David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) - -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: i...@zopyx.com - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK - E-Publishing, Python, Zope & Plone development, Consulting -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkmzaiMACgkQCJIWIbr9KYyLAgCfSQmI54Tm8IzGcWsmD7qBmfGQ EWsAoJErxADTP9uh2FqhvhXirki1Wqj3 =JcdG -END PGP SIGNATURE- begin:vcard fn:Andreas Jung n:Jung;Andreas org:ZOPYX Ltd. & Co. KG adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany email;internet:i...@zopyx.com title:CEO tel;work:+49-7071-793376 tel;fax:+49-7071-7936840 tel;home:+49-7071-793257 x-mozilla-html:FALSE url:www.zopyx.com version:2.1 end:vcard ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] trivial: hello world with filesystem based egg sources
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I try to develop something in the egg way, but still missing a point. I have a nice, fresh chrooted env with python, zope, plone etc. For installation I used buildout. Zope works neatly. In the home dir of chroot there is subdir of my project with subdirs like bin (scripts buildout, instance..), eggs, fake-eggs, products, src.. and in the root of project there is buildout.cfg. I'd like to start with easiest possible piece of python code in the egg form (to be redistributable), which could be treated by zope. I started with paster -t plone and answered a few questions. It created couple of dirs in src. I put the name of newly created directory to buildout.cfg sections [buildout]/eggs, [buildout]/develop, [instance]/zcml and rerun buildout. The path_to_chroot/src/projectname seems to be listed in the Debug Information of Zope instance. And now, please, what to do now, to have a few python lines somewhere in the egg dir, which the zope would know how to deal with? And on what url will be the "hello world" available then? Thank you for a patience.. With regards David -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJsvNP3oCkkciamVERAgNkAJ47T0+XeXwPTEINNHbFfIMVlWfKJgCgh6CS 7xxUW25bnAgBTpD7TeRSmno= =uENF -END PGP SIGNATURE- ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] question about use zc.async in Zope2
Hi all, In Plone2.5.5(with Zope2.9.6-final) I use zasync as my schedule task framework, it works well. Then I update my site to Plone3.1.7, and go further update to use Zope2.11.2 and ZODB3.9.0. Now I want to replace zasync with zc.async. As I know in Zope3 there is a event 'zope.app.appsetup.IDatabaseOpenedEvent' that you can subscribe to start your zc.async dispatcher. But in Zope2.11.2, the event never be fired, so I have to find other point to start the dispatcher. My method is start it when you first use it, see the snip following: === class AsyncTool( UniqueObject, SimpleItem, ActionProviderBase ): ... def addJob( self, *args ): ''' ''' self._startZCAsync() portal = getToolByName(self,'portal_url').getPortalObject() # get queue from portal root queue = zc.async.interfaces.IQueue( portal ) # insert a job job = queue.put( Job(...) ) def _startZCAsync( self ): # create volatile attributes if not hasattr( self, '_v_start_zcasync' ): self._v_start_zcasync = 0 if not self._v_start_zcasync: db = Zope2.DB # zc.async does not startup, start it now zc.async.configure.base() zc.async.configure.start( db, poll_interval=1, twisted=False ) self._v_start_zcasync = 1 === It works, but fragile. Any of my jobs execute failure will cause the 'volatile' attribute '_v_start_zcasync' lost, and dispatcher start process will run again, this cause error. So I want to know the right time to start zc.async dispatcher in Zope2? best regards eastxing ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )