diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index f26653f..435972c 100644
a
|
b
|
class BaseDatabaseWrapper(object):
|
310 | 310 | |
311 | 311 | def make_debug_cursor(self, cursor): |
312 | 312 | return util.CursorDebugWrapper(cursor, self) |
| 313 | |
| 314 | def backend_info(self): |
| 315 | """ |
| 316 | Returns the name and the version from the current database. |
| 317 | """ |
| 318 | return self._get_backend_info() |
313 | 319 | |
314 | 320 | class BaseDatabaseFeatures(object): |
315 | 321 | allows_group_by_pk = False |
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py
index 4fba304..861e801 100644
a
|
b
|
import decimal
|
10 | 10 | import warnings |
11 | 11 | import re |
12 | 12 | import sys |
| 13 | import sqlite3 |
13 | 14 | |
14 | 15 | from django.db import utils |
15 | 16 | from django.db.backends import * |
… |
… |
try:
|
26 | 27 | from pysqlite2 import dbapi2 as Database |
27 | 28 | except ImportError: |
28 | 29 | from sqlite3 import dbapi2 as Database |
| 30 | from sqlite3 import * |
29 | 31 | except ImportError as exc: |
30 | 32 | from django.core.exceptions import ImproperlyConfigured |
31 | 33 | raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc) |
… |
… |
class DatabaseWrapper(BaseDatabaseWrapper):
|
322 | 324 | # an in-memory db. |
323 | 325 | if self.settings_dict['NAME'] != ":memory:": |
324 | 326 | BaseDatabaseWrapper.close(self) |
| 327 | |
| 328 | def _get_backend_info(self): |
| 329 | return str(self.vendor) +" "+ (sqlite_version) |
325 | 330 | |
326 | 331 | FORMAT_QMARK_REGEX = re.compile(r'(?<!%)%s') |
327 | 332 | |
diff --git a/docs/releases/1.5.txt b/docs/releases/1.5.txt
index 51e64bd..5af94a3 100644
a
|
b
|
version compatible with Python 2.6.
|
33 | 33 | What's new in Django 1.5 |
34 | 34 | ======================== |
35 | 35 | |
| 36 | Backend info |
| 37 | ~~~~~~~~~~~~ |
| 38 | * It was added connection.backend_info() that returns the name and the version of the current database. |
| 39 | Authors of other backends should implement this in their custom backends. |
| 40 | |
| 41 | * Use of backend_info: |
| 42 | >>> from django.db import connection |
| 43 | >>> print (connection.backend_info()) |
| 44 | sqlite 3.7.2 |
| 45 | |
36 | 46 | Support for saving a subset of model's fields |
37 | 47 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
38 | 48 | |