Skip to content

Commit 5ec7411

Browse files
committed
handling another corner case with default validators for reference fields
1 parent d15ca90 commit 5ec7411

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pydal/objects.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ def __init__(
21782178
self.update = update
21792179
self.authorize = authorize
21802180
self.autodelete = autodelete
2181-
if represent is None and type in ("list:integer", "list:string"):
2181+
if represent is None and self.type in ("list:integer", "list:string"):
21822182
represent = list_represent
21832183
self.represent = represent
21842184
self.compute = compute
@@ -2187,12 +2187,13 @@ def __init__(
21872187
self.custom_retrieve = custom_retrieve
21882188
self.custom_retrieve_file_properties = custom_retrieve_file_properties
21892189
self.custom_delete = custom_delete
2190-
if filter_in is None and type == "date":
2191-
filter_in = self._todate
2192-
elif filter_in is None and type == "time":
2193-
filter_in = self._totime
2194-
elif filter_in is None and type == "datetime":
2195-
filter_in = self._todatetime
2190+
if filter_in is None:
2191+
if self.type_name == "date":
2192+
filter_in = self._todate
2193+
elif self.type_name == "time":
2194+
filter_in = self._totime
2195+
elif self.type_name == "datetime":
2196+
filter_in = self._todatetime
21962197
self.filter_in = filter_in
21972198
self.filter_out = filter_out
21982199
self.custom_qualifier = custom_qualifier

0 commit comments

Comments
 (0)