Ignore:
Timestamp:
Nov 9, 2011, 6:44:36 PM (11 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Children:
155:8b2ed9549399, 159:bbb746f79718
Message:

Allow wokkel.data_form.Form to be used as a read-only dict.

In [1334124db2fd] wokkel.pubsub.PubSubRequest.options was changed to be a
Form instead of dictionary, which makes existing code using that field to be
incompatible.

To reduce the impact of that change, this change implements various methods in
wokkel.data_form.Form to emulate a read-only dictionary. It now maps the
name of each field to its value, similar to the dictionary returned from
getValues. The latter is now identical to dict(form).

  • * *

Address incompatible change concerning PubSubRequest?.options.

In changeset [1334124db2fd], PubSubRequest.options was changed to hold the
wokkel.data_form.Form that represents the data form sent in the original
request. This makes it easier to type check the form in a step separate from
parsing the request. However, this is an incompatible change.

To remedy this, we move the form to optionsForm and make options a property
that returns the values of the form.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/disco.py

    r103 r105  
    210210                item = data_form.Form.fromElement(child)
    211211
    212             if item:
     212            if item is not None:
    213213                info.append(item)
    214214
Note: See TracChangeset for help on using the changeset viewer.