don't always import sql
This commit is contained in:
parent
c2f220677b
commit
cbcc055e86
|
@ -49,7 +49,6 @@ from wcs.workflows import Workflow, CommentableWorkflowStatusItem, \
|
|||
SendmailWorkflowStatusItem, ChoiceWorkflowStatusItem, \
|
||||
template_on_formdata
|
||||
import fields
|
||||
import sql
|
||||
|
||||
class FormField:
|
||||
### only used to unpickle form fields from older (<200603) versions
|
||||
|
@ -144,6 +143,7 @@ class FormDef(StorableObject):
|
|||
if hasattr(sys.modules['formdef'], self.url_name.title()):
|
||||
return getattr(sys.modules['formdef'], self.url_name.title())
|
||||
if get_publisher().has_site_option('postgresql') and get_cfg('postgresql', {}):
|
||||
import sql
|
||||
table_name = 'formdata_' + self.url_name.replace('-', '_')
|
||||
cls = new.classobj(self.url_name.title(), (sql.SqlFormData,),
|
||||
{'_formdef': self,
|
||||
|
@ -160,6 +160,7 @@ class FormDef(StorableObject):
|
|||
if not self.url_name:
|
||||
self.url_name = new_url_name
|
||||
if get_publisher().has_site_option('postgresql') and get_cfg('postgresql', {}):
|
||||
import sql
|
||||
sql.do_formdef_tables(self)
|
||||
elif new_url_name != self.url_name:
|
||||
# title changed, url will be changed only if there are not yet any
|
||||
|
|
Loading…
Reference in New Issue