fixed problem with lazy tables and self references
This commit is contained in:
+10
-2
@@ -7174,7 +7174,12 @@ def index():
|
||||
table = table_class(self, tablename, *fields, **args)
|
||||
table._actual = True
|
||||
self[tablename] = table
|
||||
table._create_references() # must follow above line to handle self references
|
||||
# fix self refrences
|
||||
for field in table:
|
||||
if field.requires == DEFAULT:
|
||||
field.requires = sqlhtml_validators(field)
|
||||
# must follow above line to handle self references
|
||||
table._create_references()
|
||||
|
||||
migrate = self._migrate_enabled and args_get('migrate',self._migrate)
|
||||
if migrate and not self._uri in (None,'None') \
|
||||
@@ -7591,7 +7596,10 @@ class Table(object):
|
||||
db._adapter.maxcharlength < field.length:
|
||||
field.length = db._adapter.maxcharlength
|
||||
if field.requires == DEFAULT:
|
||||
field.requires = sqlhtml_validators(field)
|
||||
try:
|
||||
field.requires = sqlhtml_validators(field)
|
||||
except AttributeError:
|
||||
pass
|
||||
self.ALL = SQLALL(self)
|
||||
|
||||
if hasattr(self,'_primarykey'):
|
||||
|
||||
Reference in New Issue
Block a user