def load_raw_data(self):
"""
Load the model by executing its raw sql load query.
Temporarily drops any constraints or indexes on the model.
"""
try:
self.drop_constraints_and_indexes()
except ValueError as e:
print(e)
print('Constrained fields: %s' % self.constrained_fields)
print('Indexed fields: %s' % self.indexed_fields)
dropped = False
else:
dropped = True
c = connection.cursor()
try:
c.execute(self.raw_data_load_query)
finally:
c.close()
if dropped:
self.add_constraints_and_indexes()
managers.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录