Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
f36e5d68
Kaydet (Commit)
f36e5d68
authored
Eyl 12, 2017
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Eyl 12, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Used sqlite3.Connection.load_extension() instead of query execution for SpatiaLite loading.
üst
0dbcd0e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
base.py
django/contrib/gis/db/backends/spatialite/base.py
+3
-6
No files found.
django/contrib/gis/db/backends/spatialite/base.py
Dosyayı görüntüle @
f36e5d68
...
@@ -3,7 +3,7 @@ from ctypes.util import find_library
...
@@ -3,7 +3,7 @@ from ctypes.util import find_library
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.exceptions
import
ImproperlyConfigured
from
django.db.backends.sqlite3.base
import
(
from
django.db.backends.sqlite3.base
import
(
DatabaseWrapper
as
SQLiteDatabaseWrapper
,
SQLiteCursorWrapper
,
DatabaseWrapper
as
SQLiteDatabaseWrapper
,
)
)
from
.client
import
SpatiaLiteClient
from
.client
import
SpatiaLiteClient
...
@@ -46,16 +46,13 @@ class DatabaseWrapper(SQLiteDatabaseWrapper):
...
@@ -46,16 +46,13 @@ class DatabaseWrapper(SQLiteDatabaseWrapper):
'SpatiaLite requires SQLite to be configured to allow '
'SpatiaLite requires SQLite to be configured to allow '
'extension loading.'
'extension loading.'
)
)
# Loading the SpatiaLite library extension on the connection, and returning
# Load the SpatiaLite library extension on the connection.
# the created cursor.
cur
=
conn
.
cursor
(
factory
=
SQLiteCursorWrapper
)
try
:
try
:
c
ur
.
execute
(
"SELECT load_extension(
%
s)"
,
(
self
.
spatialite_lib
,)
)
c
onn
.
load_extension
(
self
.
spatialite_lib
)
except
Exception
as
exc
:
except
Exception
as
exc
:
raise
ImproperlyConfigured
(
raise
ImproperlyConfigured
(
'Unable to load the SpatiaLite library extension "
%
s"'
%
self
.
spatialite_lib
'Unable to load the SpatiaLite library extension "
%
s"'
%
self
.
spatialite_lib
)
from
exc
)
from
exc
cur
.
close
()
return
conn
return
conn
def
prepare_database
(
self
):
def
prepare_database
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment