|
1 | | -# $Id: client.py,v 1.120 2003-06-24 03:30:30 richard Exp $ |
| 1 | +# $Id: client.py,v 1.121 2003-06-24 03:51:15 richard Exp $ |
2 | 2 |
|
3 | 3 | __doc__ = """ |
4 | 4 | WWW request handler (also used in the stand-alone server). |
@@ -1506,16 +1506,8 @@ def parsePropsFromForm(self, num_re=re.compile('^\d+$')): |
1506 | 1506 | The form value is a comma-separated list of |
1507 | 1507 | designators. The item corresponding to each |
1508 | 1508 | designator is linked to the property given by simple |
1509 | | - form variable. |
1510 | | -
|
1511 | | -XXX Used to add a link to new items created during edit. |
1512 | | -XXX These are collected up and returned in all_links. This will |
1513 | | -XXX result in an additional linking operation (either Link set or |
1514 | | -XXX Multilink append) after the edit/create is done using |
1515 | | -XXX all_props in _editnodes. The <propname> on the current item |
1516 | | -XXX will be set/appended the id of the newly created item of |
1517 | | -XXX class <designator> (where <designator> must be |
1518 | | -XXX <classname>-<N>). |
| 1509 | + form variable. These are collected up and returned in |
| 1510 | + all_links. |
1519 | 1511 |
|
1520 | 1512 | None of the above (ie. just a simple form value) |
1521 | 1513 | The value of the form variable is converted |
@@ -1605,8 +1597,8 @@ def parsePropsFromForm(self, num_re=re.compile('^\d+$')): |
1605 | 1597 | default_nodeid = self.nodeid |
1606 | 1598 |
|
1607 | 1599 | # we'll store info about the individual class/item edit in these |
1608 | | - all_required = {} # one entry per class/item |
1609 | | - all_props = {} # one entry per class/item |
| 1600 | + all_required = {} # required props per class/item |
| 1601 | + all_props = {} # props present per class/item |
1610 | 1602 | all_propdef = {} # note - only one entry per class |
1611 | 1603 | all_links = [] # as many as are required |
1612 | 1604 |
|
@@ -1695,11 +1687,6 @@ def parsePropsFromForm(self, num_re=re.compile('^\d+$')): |
1695 | 1687 | all_required[this] = extractFormList(form[key]) |
1696 | 1688 | continue |
1697 | 1689 |
|
1698 | | - # get the required values list |
1699 | | - if not all_required.has_key(this): |
1700 | | - all_required[this] = [] |
1701 | | - required = all_required[this] |
1702 | | - |
1703 | 1690 | # see if we're performing a special multilink action |
1704 | 1691 | mlaction = 'set' |
1705 | 1692 | if d['remove']: |
@@ -1919,17 +1906,20 @@ def parsePropsFromForm(self, num_re=re.compile('^\d+$')): |
1919 | 1906 |
|
1920 | 1907 | props[propname] = value |
1921 | 1908 |
|
1922 | | - # register this as received if required? |
1923 | | - if propname in required and value is not None: |
1924 | | - required.remove(propname) |
1925 | | - |
1926 | 1909 | # check to see if we need to specially link a file to the note |
1927 | 1910 | if have_note and have_file: |
1928 | 1911 | all_links.append(('msg', '-1', 'files', [('file', '-1')])) |
1929 | 1912 |
|
1930 | 1913 | # see if all the required properties have been supplied |
1931 | 1914 | s = [] |
1932 | 1915 | for thing, required in all_required.items(): |
| 1916 | + # register the values we got |
| 1917 | + got = all_props.get(thing, {}) |
| 1918 | + for entry in required: |
| 1919 | + if got.get(entry, ''): |
| 1920 | + required.remove(entry) |
| 1921 | + |
| 1922 | + # any required values not present? |
1933 | 1923 | if not required: |
1934 | 1924 | continue |
1935 | 1925 | if len(required) > 1: |
|
0 commit comments