[Zope3-dev] Schema, widget and form refactoring (was Re: [Zope3-checkins] CVS:Zope3/src/zope/schema - _bootstrapfields.py:1.19.2.1)

Stuart Bishop zen@shangri-la.dropbear.id.au
Wed, 23 Jul 2003 11:51:13 +1000


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>> Okay...I see this. I think we need to create one of these complex
>> widgets asap and plug it into an ftest. It's going to pose problems, 
>> for
>> my branch, or the head.
>
> They tend to be less than trivial to create.  I'll see what I can do
> about getting something released that can be used to create tests.  We
> have a widget for a VocabularyUniqueListField that supports control
> over the order of the list and which has been tested with multiple
> query helpers.  Complex enough?  ;-)

Is the example using the Tuple and Object schema fields detailed
in src/zope/app/browser/form/widgets.txt suitable?

I'll try to scare up time to write the functional tests for
the existing Wizard code, so Garrett knows what else he is breaking.
In particular, in editwizard.py, I'm calling getWidgetsData with
strict=True, and I need it to throw a validation error if a required
field is missing. This is so the Wizard knows if it can move onto the
next/previous pane or not. When I'm calling applyWidgetsChanges,
I'm expecting it to not throw any exceptions because all the data
has already been validated.

If anyone wants to play, here is an example addwizard and editwizard
(and their corresponding addform/editform):

   <browser:addwizard
     schema=".DVD.IDVD"
     content_factory=".DVD.DVD"
     arguments="title region aspect_ratio"
     name="zopeproducts.dvd"
     menu="add_content" title="DVD Details"
     description="Details about a DVD Movie"
     permission="zope.ManageContent"
     use_session="no">
     <browser:pane fields="title subtitle" label="The First Add Pane 
Label" />
     <browser:pane fields="region aspect_ratio test1"
         label="Second Add Label"/>
     <browser:pane fields="test2" label="3rd Add Label" />
   </browser:addwizard>

   <browser:editwizard
     schema=".DVD.IDVD"
     name="edit.html"
     menu="zmi_views"
     permission="zope.ManageContent"
     use_session="no">
     <browser:pane fields="title subtitle" label="The First Pane Label" 
/>
     <browser:pane fields="region aspect_ratio" label="Second label"/>
     <browser:pane fields="test1 test2" label="tThird label"/>
   </browser:editwizard>

   <!--
   <browser:addform
       schema=".DVD.IDVD"
       content_factory=".DVD.DVD"
       arguments="title region aspect_ratio"
       name="zopeproducts.dvd"
       menu="add_content" title="DVD Details"
       description="Details about a DVD Movie"
       permission="zope.ManageContent"
       label="Form Label" />

   <browser:editform
     schema=".DVD.IDVD"
     name="edit.html"
     menu="zmi_views"
     permission="zope.ManageContent"
     label="The label of the form"
     />
   -->

- -- 
Stuart Bishop <zen@shangri-la.dropbear.id.au>
http://shangri-la.dropbear.id.au/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)

iD8DBQE/HeoWh8iUz1x5geARAnqJAKDYIN1iTpnUsxqJkYdsS10/JZp4sACg9Ie1
nzAmxySKSsaziESv8EfC0eg=
=Svv+
-----END PGP SIGNATURE-----