schema.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:DjangoZeroToHero 作者: RayParra 项目源码 文件源码
def remove_field(self, model, field):
        if isinstance(field, GeometryField) and field.spatial_index:
            qn = self.connection.ops.quote_name
            sql = self.sql_drop_spatial_index % {
                'index': qn(self._create_spatial_index_name(model, field)),
                'table': qn(model._meta.db_table),
            }
            try:
                self.execute(sql)
            except OperationalError:
                logger.error(
                    "Couldn't remove spatial index: %s (may be expected "
                    "if your storage engine doesn't support them)." % sql
                )

        super(MySQLGISSchemaEditor, self).remove_field(model, field)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号