comparison roundup/cgi/form_parser.py @ 5067:e424987d294a

Add support for an integer type to join the existing number type. Commit patch supplied for issue2550886. This can be used for properties used for ordering, counts etc. where a decimal point isn't needed. Developed by Anthony (antmail). Doc updates written by John Rouillard.
author John Rouillard <rouilj@ieee.org>
date Sun, 05 Jun 2016 00:17:26 -0400
parents d2256fcfd81f
children cc4f4ee46d88
comparison
equal deleted inserted replaced
5066:d2256fcfd81f 5067:e424987d294a
133 file named by the form value is uploaded. This means we 133 file named by the form value is uploaded. This means we
134 try to set additional properties "filename" and "type" (if 134 try to set additional properties "filename" and "type" (if
135 they are valid for the class). Otherwise, the property 135 they are valid for the class). Otherwise, the property
136 is set to the form value. 136 is set to the form value.
137 137
138 For Date(), Interval(), Boolean(), and Number() 138 For Date(), Interval(), Boolean(), and Number(), Integer()
139 properties, the form value is converted to the 139 properties, the form value is converted to the
140 appropriate 140 appropriate
141 141
142 Any of the form variables may be prefixed with a classname or 142 Any of the form variables may be prefixed with a classname or
143 designator. 143 designator.
517 if not existing: 517 if not existing:
518 if isinstance(proptype, hyperdb.String): 518 if isinstance(proptype, hyperdb.String):
519 # some backends store "missing" Strings as empty strings 519 # some backends store "missing" Strings as empty strings
520 if existing == self.db.BACKEND_MISSING_STRING: 520 if existing == self.db.BACKEND_MISSING_STRING:
521 existing = None 521 existing = None
522 elif isinstance(proptype, hyperdb.Number): 522 elif isinstance(proptype, hyperdb.Number) or isinstance(proptype, hyperdb.Integer):
523 # some backends store "missing" Numbers as 0 :( 523 # some backends store "missing" Numbers as 0 :(
524 if existing == self.db.BACKEND_MISSING_NUMBER: 524 if existing == self.db.BACKEND_MISSING_NUMBER:
525 existing = None 525 existing = None
526 elif isinstance(proptype, hyperdb.Boolean): 526 elif isinstance(proptype, hyperdb.Boolean):
527 # likewise Booleans 527 # likewise Booleans

Roundup Issue Tracker: http://roundup-tracker.org/