[FIX] fields: support fields with store=False
Fix method `to_column` to not create columns for non-stored fields.
This commit is contained in:
+2
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user