summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/mapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-09-19 13:12:08 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-09-19 16:27:51 -0400
commit80aeba3d5e0269eb689d991ca0b8e281715113ed (patch)
tree0c6096a8b9b1612a3b05ecf06b831d92938b071f /lib/sqlalchemy/orm/mapper.py
parent371f1a82c5981156a359f690923840d2627c9a6f (diff)
downloadsqlalchemy-80aeba3d5e0269eb689d991ca0b8e281715113ed.tar.gz
- Added a new type-level modifier :meth:`.TypeEngine.evaluates_none`
which indicates to the ORM that a positive set of None should be persisted as the value NULL, instead of omitting the column from the INSERT statement. This feature is used both as part of the implementation for :ticket:`3514` as well as a standalone feature available on any type. fixes #3250 - add new documentation section illustrating the "how to force null" use case of #3250 - alter our change from #3514 so that the class-level flag is now called "should_evaluate_none"; so that "evaluates_none" is now a generative method.
Diffstat (limited to 'lib/sqlalchemy/orm/mapper.py')
-rw-r--r--lib/sqlalchemy/orm/mapper.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index 21577f5ea..5ade4b966 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -1921,7 +1921,7 @@ class Mapper(InspectionAttr):
table,
frozenset(
col.key for col in columns
- if col.type.evaluates_none
+ if col.type.should_evaluate_none
)
)
for table, columns in self._cols_by_table.items()
@@ -1936,7 +1936,7 @@ class Mapper(InspectionAttr):
col.key for col in columns
if not col.primary_key and
not col.server_default and not col.default
- and not col.type.evaluates_none)
+ and not col.type.should_evaluate_none)
)
for table, columns in self._cols_by_table.items()
)