[Zope3-Users] zope.formlib view action is calling two times ?

2007-09-04 Thread Baiju M

Hi,
  I have a view class like this:

class EditTestPage(form.EditForm):
   form_fields = form.Fields(ITestPage)
   template = namedtemplate.NamedTemplate('page_edit')
   output = 

   actions = form.Actions(
   form.Action('Save', success='handle_save_action'),
   form.Action('Preview', success='handle_preview_action'),
   )

   def handle_save_action(self, action, data):
   if form.applyChanges(self.context, self.form_fields, data):
   self.status = 'Object updated'
   else:
   self.status = 'No changes'
   self.request.response.redirect('.')

   def handle_preview_action(self, action, data):
   print Test
   self.output = Test

When I click 'Preview' or 'Save' button, the actions are called two 
times, any idea ?


Regards,
Baiju M

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: How to assign a role or permission to users programatically?

2007-09-04 Thread Christian Klinger

Hi Yuan,

iirc you can subscribe to the

zope.app.authentication.interfaces.IAuthenticatedPrincipalCreated

event.

In your event you can do something like this:

def authenticated_principal_created(event):
principal = event.principal
principal.groups.append('zope.Manager')

hth

Christian




Dear list,

I have written a custom authenticator plugin to authenticate users
against a Postgres database. The question is, once a user is
authenticated, what role or permission does she/he get?

If I would like to give the permission 'site.MemberPermission' to all
users when they log in. I don't want to store the permission a a
persistent folder like object, but just assign them on the fly when
the log in.

what shall I do?

Thanks for helping.





___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Confirming member generated objects?

2007-09-04 Thread Christian Klinger

Hi Maken,

maybe the hurry.workflow fits in your usecase.

See the documentation here 
http://codespeak.net/svn/z3/hurry.workflow/trunk/src/hurry/workflow/workflow.txt


Christian


Hi!
In many applications members can add content but with the restriction 
that it needs to be confirmed
by a manager before it becomes active and accessible to anybody else. 
I'm trying to accomplish this
with an idea of mine, but I'm very open to other ideas of course :) 
Basically, lets say I have a site 'mysite'
and an item container 'items'. And an Item is the content component of 
my app. When people add items in


 /mysite/items/+/ztest.Item

... my idea is that it is then actually only added e.g in an 
'unconfirmed' folder in the site manager of mysite.
This, I'm trying to achieve by subclassing AddForm and overriding the 
add method (since add is the only

interesting here, the rest is dotted in the code below:)):

#
class ItemMemberAddForm(AddForm):
form_fields = ...
label = ...

def create(self, data):
...

def add(self, object):
con = queryUtility(IItemContainer, u'unconfirmed')
o = 
IAdding(con).add(object)# How to 
add it??

self._finished_add = True
return o
#


The 'unconfirmed' folder is registered as a utility for easy access. 
Obviously the code above isn't working

and i'm not even sure I know what I'm doing with the IAdding :O
I think I'm in the difficult phase of the Z-learning curve... just 
learnt the basics and now anything beyond the

basics seem really complicated :)
When I do manage to pull this off, it shouldn't be too hard moving 
confirmed objects to /mysite/items (I looked
at zope.copypastemove for this, but first I want to get the adding 
working..)


Any thoughts on my idea/code or any other things related to confirming 
member generated content are very

much appreciated!

Regards
Seteva


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] most useful zope 3 libraries

2007-09-04 Thread Markus Leist
Hi,

here the following modules/components are used (from my site.zcml):
---
[...]
  include package=zope.sendmail/
  include package=zope.contentprovider /
  include package=zope.viewlet /
  include package=zope.app.apidoc/
  include package=zope.app.onlinehelp/
  include package=zope.app.preference /
  include package=zope.app.pythonpage/
  include package=zope.app.renderer/
  include package=zope.app.workflow/
  include package=zope.app.authentication /
  include package=zope.app.boston /
  include package=zope.app.catalog/
  include package=zope.app.intid /
  include package=zope.app.keyreference /
  include package=zope.app.pluggableauth /
  include package=zope.app.schema /
  include package=zope.app.server /
  include package=zope.app.session /
  include package=zope.app.twisted /
  include package=zope.app.wfmc /
  include package=zope.app.securitypolicy /

  include package=zc.resourcelibrary/
  include package=zc.table/

  include package=z3c.form /
  include package=z3checkins /
  include package=z3c.layer.pagelet /
  include package=z3c.macro /
  include package=z3c.pagelet /
[...]
---

this would be my vote ...

Markus

Am Dienstag 04 September 2007 um 04:43 Uhr schrieb Carlos de la Guardia 
[EMAIL PROTECTED]:
 Hi,
 
 the other day I commented on my blog [1] about the lack of information on
 the Zope3 wiki about popular/important libraries or modules (I wanted to say
 products but I hear that's passé). Since I brought this up, I though the
 least I could do was to create a page about this myself, but I need help,
 because I'm just a Zope 3 beginner.
 
 Could some of you please mention your favorite or most useful libraries for
 Zope 3? I will research some of those mentioned and create a wiki page based
 on this information.
 
 Thanks a lot.
 
 Carlos de la Guardia
 
 [1]
 http://blog.delaguardia.com.mx/index.php?op=ViewArticlearticleId=77blogId=1
 

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re[2]: [Zope3-Users] most useful zope 3 libraries

2007-09-04 Thread Adam Groszer
Hello Christophe,

Something like this was proposed by Stephan some 1.5 year ago.
He did some quite detailed specs for it.

Tuesday, September 4, 2007, 8:45:15 AM, you wrote:

 Carlos de la Guardia a écrit :
 Hi,

 the other day I commented on my blog [1] about the lack of information
 on the Zope3 wiki about popular/important libraries or modules (I wanted
 to say products but I hear that's passé). Since I brought this up, I
 though the least I could do was to create a page about this myself, but
 I need help, because I'm just a Zope 3 beginner.

 Could some of you please mention your favorite or most useful libraries
 for Zope 3? I will research some of those mentioned and create a wiki
 page based on this information.

 Thanks a lot.

 Carlos de la Guardia

 That's a really good idea! I wanted to do this once my current job is 
 finished.
 We can already browse the modules on pypi,
 but it would be good to have a page that summarizes all the useful zope3-only
 packages, with a user point-of-view, common use cases for each package, with
 schemas and screen captures (if there are widgets).

 And not only for 3rd-party packages, but also for the core zope3 packages. I
 regularly discover new components in it.
 I will surely help

 Christophe
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users

-- 
Best regards,
 Adammailto:[EMAIL PROTECTED]
--
Quote of the day:
I don't know who my grandfather was; I am much more concerned to know what his 
grandson will be. 
- Abraham Lincoln 

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Confirming member generated objects?

2007-09-04 Thread Stephan Richter
On Monday 03 September 2007 17:59, Maken Seteva wrote:
 Any thoughts on my idea/code or any other things related to  
 confirming member generated content are very
 much appreciated!

Your use case is usually solved using a workflow framework. There are two 
workflow frameworks for Zope 3: zope.wfmc/zope.app.wfmc and hurry.workflow 
(as Christian pointed out).

WfMC is a very advanced workflow engine based on design by a workflow 
coalition. hurry.workflow is state-based and much simpler to use but bears 
restrictions of non-generality. I would choose a framework based on your 
experience level.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Database authentication service

2007-09-04 Thread Stephan Richter
On Friday 24 August 2007 11:33, Yuan HOng wrote:
 Is there a package providing relational database based authentication
 service for zope 3 already lying around somewhere or do I have write
 one?

As far as I know there is no SQL-based authentication plugin. But since the 
authentication system is pluggable, it's the matter of writing a plugin. You 
can use the LDAP version as a start:

http://svn.zope.org/ldappas/

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] z3c.form, style-attribute of TextWidget, TextAreaWidget

2007-09-04 Thread Stephan Richter
On Thursday 30 August 2007 08:50, Andreas Reuleaux wrote:
 The widgets do have a style-Attribute after all and this used
 to work in formlib. - However this has no effect when rendering:

Forget formlib and the other older form stuff. ;-) z3c.form does not use that 
at all.

Note that we usually solve the problem you are heaving by specifying the input 
element's id as the CSS selector:

input#form-widgets-firstName {
  width: 105px;
}

 [EMAIL PROTECTED](~/z3eggs/z3c.form-1.6.0-py2.4.egg/z3c/form/browser)$ diff
 -u text_input.pt.ORIG text_input.pt --- text_input.pt.ORIG  2007-08-30
 01:05:52.0 +0200
 +++ text_input.pt   2007-08-30 13:59:30.0 +0200
 @@ -26,4 +26,5 @@
 accesskey view/accesskey;
 onselect view/onselect;
 size view/size;
 -   maxlength view/maxlength /
 +   maxlength view/maxlength;
 +   style view/style /
 [EMAIL PROTECTED](~/z3eggs/z3c.form-1.6.0-py2.4.egg/z3c/form/browser)$

 Is there any particular reason why this style attribute was left out or is
 this just a bug? - The same for textarea_input.pt

Bug. It is now fixed in the trunk for all widgets.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Confirming member generated objects?

2007-09-04 Thread Jeff Kowalczyk
Stephan Richter wrote:
 Your use case is usually solved using a workflow framework. There are
 two workflow frameworks for Zope 3: zope.wfmc/zope.app.wfmc and
 hurry.workflow (as Christian pointed out).
 
 WfMC is a very advanced workflow engine based on design by a workflow
 coalition. hurry.workflow is state-based and much simpler to use but
 bears restrictions of non-generality. I would choose a framework based
 on your experience level.

Stephan,

I'm interested to learn more about the no-framework event approach
described in Re: Community opinion about workflow engine (March 2007)
http://article.gmane.org/gmane.comp.web.zope.plone.devel/14826

It seems that approach allows workflow-like behavior to be added
incrementally, rather than committing to a state and transition design
from the start.

If you're inclined to expand upon that description of the pattern, it
would make for very useful documentation for workflow-related FAQs.

Thanks.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] z3c.form, checkboxes for Bool fields - thanks a lot, now: z3c.form egg from svn

2007-09-04 Thread Andreas Reuleaux
On Tue, Sep 04, 2007 at 06:35:29PM -0400, Stephan Richter wrote:
 On Saturday 01 September 2007 19:36, Andreas Reuleaux wrote:
  Is there a way to have only one checkbox generated? - like this:
 
     [ ] Invitation
 
  That's what I want.
 
 I have implemented this widget now. It is available in the z3c.form trunk and 
 I updated the All widgets demo as well showing the new widget.



OK, thanks a lot. 

Next question now: how do I tell zc.buildout to build an egg from svn
for z3c.form? - I have tried this (adrn ist my application):


  buildout.cfg
  
  ...
  find-links =
  http://download.zope.org/distribution/
  svn://svn.zope.org/repos/main/z3c.form/trunk#egg=z3c.form-dev
  ...

   eggs =
  adrn
  z3c.form==dev
  ...


  setup.py
  
  ...
  install_requires = [...
  'z3c.form==dev'
  ...
  ]


However I get 

  [EMAIL PROTECTED](~/work/adrn)$ ./bin/buildout 
  Develop: '/home/reuleaux/work/adrn/.'
  Installing adrbuch.
  Download error: unknown url type: svn -- Some packages may not be found!
  Getting distribution for 'z3c.form==dev'.
  Installing z3c.form dev
  Caused installation of a distribution:
  z3c.form 1.6.0
  with a different version.
  Got None.
  While:
Installing adrbuch.
  Error: There is a version conflict.
  We already have: z3c.form 1.6.0
  but adrn 0.1 requires 'z3c.form==dev'.
  [EMAIL PROTECTED](~/work/adrn)$

  

-Andreas
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] zope.formlib view action is calling two times ?

2007-09-04 Thread Stephan Richter
On Tuesday 04 September 2007 02:00, Baiju M wrote:
 When I click 'Preview' or 'Save' button, the actions are called two
 times, any idea ?

You should use z3c.form. :-)

(Sorry, I would love to help, but I am just not supporting formlib 
anymore. ;-)

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Still trying am to build an EditForm

2007-09-04 Thread Stephan Richter
On Sunday 02 September 2007 15:39, Florian Lindner wrote:
 I have also tried some variations of the above like not using z3c:pagelet
 but an normal page directive, registered it without an layer directive and
 so on.

 So please... whats wrong there?

Do you have z3c.formui installed and the ZCML linked up?

Does Andreas' package help you?

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] most useful zope 3 libraries

2007-09-04 Thread Stephan Richter
On Monday 03 September 2007 22:43, Carlos de la Guardia wrote:
 Could some of you please mention your favorite or most useful libraries for
 Zope 3? I will research some of those mentioned and create a wiki page
 based on this information.

Here are some that I think are cool and/or I use a lot:

jquery.javascript
ldapadapter
lovely.remotetask
lovely.tag
z3c.baseregistry
z3c.configurator
z3c.coverage
z3c.csvvocabulary
z3c.datagenerator
z3c.form
z3c.formui
z3c.formjs
z3c.layer
z3c.macro
z3c.menu
z3c.pagelet
z3c.pdftemplate
z3c.quickentry
z3c.rml
z3c.sampledata
z3c.traverser
z3c.viewtemplate
z3c.zrtresource
hurry.query
zc.catalog
zc.queue
zc.sourcefactory
zope.testbrowser
zope.ucol

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users