1.1 --- a/MoinForms.py Mon Dec 03 01:47:09 2012 +0100
1.2 +++ b/MoinForms.py Wed Dec 05 00:58:20 2012 +0100
1.3 @@ -228,6 +228,8 @@
1.4 getFormStructure(body, request, path and ("%s/%s" % (path, section_name)) or section_name, section)
1.5 elif attributes.has_key("message"):
1.6 getFormStructure(body, request, path, structure)
1.7 + elif attributes.has_key("not-message"):
1.8 + getFormStructure(body, request, path, structure)
1.9
1.10 # Get field details from other kinds of region.
1.11
1.12 @@ -305,6 +307,7 @@
1.13 elif format == "form":
1.14 section_name = attributes.get("section")
1.15 message_name = attributes.get("message")
1.16 + absent_message_name = attributes.get("not-message")
1.17
1.18 # Sections are groups of fields in their own namespace.
1.19
1.20 @@ -326,6 +329,12 @@
1.21 elif message_name and section.has_key(message_name):
1.22 output.append(getFormOutput(body, section, path))
1.23
1.24 + # Not-message regions are conditional on a particular field being
1.25 + # absent. They reference the current namespace.
1.26 +
1.27 + elif absent_message_name and not section.has_key(absent_message_name):
1.28 + output.append(getFormOutput(body, section, path))
1.29 +
1.30 # Inspect and include other regions.
1.31
1.32 else: