sqltest inconsistency
Bug #143776 reported by
José Henrique Reis
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Products.ZSQLMethods |
Invalid
|
Wishlist
|
Unassigned |
Bug Description
Some time ago Dieter Maurer changed the sqlvar behaviour to map Python None to SQL NULL for all types (issue 556). I think that sqltest should have the same behavior, so parameters explicitly passed as None are mapped to SQL null.
This would bring consistency between sqlvar and sqltest and would allow to greater flexibility in the construction of zsql methods, like in this example:
update table
set <dtml-sqlgroup>
<dtml-sqltest abc type="nb" optional>
<dtml-sqltest dof type="nb" optional>
</dtml-sqlgroup>
where ghi = <dtml-sqlvar ghi type="nb">
if called with 'abc="123", ghi="789 this would result in:
update table
set (abc = '123', dof = null)
where ghi = '789'
Changed in zope2: | |
importance: | Medium → Wishlist |
status: | New → Confirmed |
affects: | zope2 → products.zsqlmethods |
To post a comment you must log in.
Sorry, my example are wrong. The correct is:
if called with 'abc="123", dof=None, ghi="789 this would result in:
update table
set (abc = '123', dof = null)
where ghi = '789'