      class Meta:
          app_label = 'gis'
          db_table = 'spatial_ref_sys'
          managed = False
  
  
  def add_spatial_version_related_fields(sender, **kwargs):
      """
      Adds fields after establishing a database connection to prevent database
      operations at compile time.
      """
      if connection_created.disconnect(add_spatial_version_related_fields, sender=DatabaseWrapper):
          spatial_version = connection.ops.spatial_version[0]
          if spatial_version >= 4:
              SpatialiteSpatialRefSys.add_to_class('srtext', models.CharField(max_length=2048))
              SpatialiteGeometryColumns.add_to_class('type', models.IntegerField(db_column='geometry_type'))
          else:
              SpatialiteGeometryColumns.add_to_class('type', models.CharField(max_length=30))
  connection_created.connect(add_spatial_version_related_fields, sender=DatabaseWrapper)
 
</s> remove                 # No `srtext` field in the `spatial_ref_sys` table in SpatiaLite < 4
                if not spatialite or connection.ops.spatial_version[0] >= 4:
                    self.assertTrue(srs.wkt.startswith(sd['srtext']))
 </s> add                 self.assertTrue(srs.wkt.startswith(sd['srtext'])) </s> remove from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper
from django.db import connection, models
from django.db.backends.signals import connection_created
 </s> add from django.db import models </s> remove                            'WHERE f_table_name=%%s AND f_geometry_column=%%s' % type_col,
 </s> add                            'WHERE f_table_name=%s AND f_geometry_column=%s', </s> remove http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html
 </s> add 
      class Meta:
          app_label = 'gis'
          db_table = 'spatial_ref_sys'
          managed = False















keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
 Fixed #25645 -- Dropped support for SpatiaLite < 4.0. 
django/contrib/gis/db/backends/spatialite/models.py