Re: [Zope3-Users] z3c.form, checkboxes for Bool fields

2007-09-07 Thread Darryl Cousins
Hi,


On Tue, 2007-09-04 at 18:35 -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.

Thanks Stephan.

Regards,
Darryl

 
 Regards,
 Stephan

___
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-05 Thread Andreas Reuleaux

Thanks again, works like a charm, i. e. both:

* your tree / buildout config with link to z3c.form from svn

* and the new checkbox.SingleCheckBoxFieldWidget

-Andreas

On Tue, Sep 04, 2007 at 10:40:32PM -0400, Stephan Richter wrote:
 On Tuesday 04 September 2007 21:13, Andreas Reuleaux wrote:
  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):
 
 My tree looks something like that:
 
 packages/
   z3c.form/   -- svn://svn.zope.org/repos/main/z3c.form/trunk
   z3c.formui/   -- svn://svn.zope.org/repos/main/z3c.form/trunk
   myprojects/
 z3c.form -- symlink to ../z3c.form
 
 In buildout.cfg of myproject, I have:
 
 [buildout]
 develop = . z3c.form
 
 Regards,
 Stephan
 -- 
 Stephan Richter
 CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
 Web2k - Web Software Design, Development and Training
 
 
 !DSPAM:46de72bc56542107185924!
___
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


[Zope3-Users] z3c.form, checkboxes for Bool fields

2007-09-01 Thread Andreas Reuleaux
In my interface I have Bool fields, say e. g. for invitation

  class IAdr(Interface)
...
invitation = Bool(
title=u'Invitation',
description=u'Invitation?',
required=False
)
 ...

Now when rendering the following edit-form

  class AdrEditForm(form.EditForm):
  fields = field.Fields(IAdr)
  ...

I get radio-boxes for invitation like so:

  (*) yes ( ) no

(by the way: this can also been seen in z3c.formdemo on the
All widgets page widgets.html)

Well nice - after all this reflects the behaviour of boolean
values: they can be either yes (True) or no (False).

Actually I preferred formlibs behaviour of rendering checkboxes
for Bools though, something like:

  [v]

I. e. a single checkbox that can either be checked [v] or not [ ]
should suffice for a boolean value. - This is shorter than
the radio buttons and just as good.

Now I was hoping that this was implemented in z3c.form.browser.checkbox
already:


  class AdrEditForm(form.EditForm):
  fields = field.Fields(IAdr)

  def MyFieldWidget(field, req):
return widget.FieldWidget(field, checkbox.CheckBoxWidget(req))

  fields['invitation'].widgetFactory = MyFieldWidget


However I get *two* checkboxes now

  [ ] yes [ ] no

for the one boolean field invitation - that's not exactly what
I was looking for: *one* checkbox should be enough for a Bool field
- and what should happen by the way, if I check both boxes  
([v] yes [v] no)?

I think there should be an easy way to do this. This is very
common after all. - Any hints? Have I overlooked something?

-Andreas

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