[FIX] fields: support fields with store=False

Fix method `to_column` to not create columns for non-stored fields.
This commit is contained in:
Raphael Collet
2015-07-02 16:56:04 +02:00
parent 04fb3dfcff
commit 72399a195a
+2 -3
View File
@@ -671,9 +671,8 @@ class Field(object):
def to_column(self):
""" Return a column object corresponding to `self`, or ``None``. """
if not self.store and self.compute:
# non-stored computed fields do not have a corresponding column
self.column = None
if not self.store and not self.column:
# non-stored fields do not have a corresponding column
return None
# determine column parameters