[Zope-CMF] Formlib implementation for folder contents

2008-06-22 Thread Charlie Clark

Hi,

now that I've had a couple of months practice with browser views in  
general and formlib in particular and also because I've got a  
particular itch to scratch I've started on a formlib version of  
folder_contents and I've now got a skeleton version of the form. Well,  
I've got the form at least!


What I've done so far:

* a view based on EditForm (haven't quite mastered redirects in  
PageForm) but not using setUpEditWidgets - I pass the field values in  
as 'data'. Fields are distinguished from each other using the prefix  
argument


   field = form.FormField(f, n, item.id) # using an interface
   self.form_fields += form.FormFields(field)

* turned the buttons into actions - probably the easiest part :-)

* generate fields (Boolean for the checkboxes)

* use a custom template to iterate through the folder items and call  
the appropriate widgets. Although this works it's a bit clumsy. This  
is the rather stripped-down HTML and I'm anticipating renaming on the  
form.



  tal:attributes="action request/ACTUAL_URL">
  

  Select
  Name
  Last Modified
  Position

  
Checkbox




  
  





While I can probably tidy this up to use a method in the view I'm not  
convinced it's entirely the right way to do this. But it works!


I'll continue working - the actions themselves should be most  
straightforward on this but would appreciate any comments.


Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Re: [dev] newstyle content creation

2008-06-22 Thread Charlie Clark


Am 02.05.2008 um 13:50 schrieb yuppie:

Did some more refactoring. If your factory can handle all the input,  
ContentAddFormBase's 'create' method should be sufficient. If not,  
you need a 'create' method like the one in FileAddView.



Done quite a lot of Add Forms based on your work and we ended up  
extended the base view to implement form_fields and require the sub  
classes to provide the portal_type and the schema or list of fields.


@property
def form_fields(self):
fields = form.FormFields(
TextLine(
__name__='portal_type',
default=self.portal_type)
)
# allow sub-classes to pass in sequences of schema
if isinstance(list, self.schema):
for s in self.schema:
fields += form.FormFields(s)
else:
fields += form.FormFields(self.schema)
return fields

I'm not sure if it's overkill to be able to handle a list of fields  
but we've found it makes views a lot easier to work with. What do you  
think?


Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] CMF Tests: 9 OK

2008-06-22 Thread CMF Tests Summarizer
Summary of messages to the cmf-tests list.
Period Sat Jun 21 11:00:00 2008 UTC to Sun Jun 22 11:00:00 2008 UTC.
There were 9 messages: 9 from CMF Tests.


Tests passed OK
---

Subject: OK : CMF-1.6 Zope-2.8 Python-2.3.6 : Linux
From: CMF Tests
Date: Sat Jun 21 21:50:13 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-June/009110.html

Subject: OK : CMF-1.6 Zope-2.9 Python-2.4.4 : Linux
From: CMF Tests
Date: Sat Jun 21 21:51:43 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-June/009111.html

Subject: OK : CMF-2.0 Zope-2.9 Python-2.4.4 : Linux
From: CMF Tests
Date: Sat Jun 21 21:53:13 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-June/009112.html

Subject: OK : CMF-2.0 Zope-2.10 Python-2.4.4 : Linux
From: CMF Tests
Date: Sat Jun 21 21:54:44 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-June/009113.html

Subject: OK : CMF-2.1 Zope-2.10 Python-2.4.4 : Linux
From: CMF Tests
Date: Sat Jun 21 21:56:14 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-June/009114.html

Subject: OK : CMF-2.1 Zope-2.11 Python-2.4.4 : Linux
From: CMF Tests
Date: Sat Jun 21 21:57:45 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-June/009115.html

Subject: OK : CMF-trunk Zope-2.10 Python-2.4.4 : Linux
From: CMF Tests
Date: Sat Jun 21 21:59:15 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-June/009116.html

Subject: OK : CMF-trunk Zope-2.11 Python-2.4.4 : Linux
From: CMF Tests
Date: Sat Jun 21 22:00:45 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-June/009117.html

Subject: OK : CMF-trunk Zope-trunk Python-2.4.4 : Linux
From: CMF Tests
Date: Sat Jun 21 22:02:15 EDT 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-June/009118.html

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests