convert-to-sql: handle "formdef.Url-Name" objects (#6580)

This commit is contained in:
Thomas NOËL 2015-02-26 15:14:39 +01:00
parent d6f824c447
commit ea77b4cdef
1 changed files with 1 additions and 1 deletions

View File

@ -111,13 +111,13 @@ class CmdConvertToSql(Command):
print ('converting %s' % formdef.name).ljust(num_columns-1)
sql.do_formdef_tables(formdef, rebuild_views=True)
data_class = formdef.data_class(mode='files')
delattr(sys.modules['formdef'], formdef.url_name.title())
count = data_class.count()
# load all objects a first time, to allow the migrate() code to be
# run and the eventual changes properly saved.
for id in data_class.keys():
formdata = data_class.get(id)
delattr(sys.modules['formdef'], formdef.url_name.title())
# once this is done, reload and store everything in postgresql
sql_data_class = formdef.data_class(mode='sql')