~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

Viewing changes to django/db/backends/postgresql_psycopg2/creation.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone
  • Date: 2013-11-07 15:33:49 UTC
  • mfrom: (1.3.12)
  • Revision ID: package-import@ubuntu.com-20131107153349-e31sc149l2szs3jb
Tags: 1.6-1
* New upstream version. Closes: #557474, #724637.
* python-django now also suggests the installation of ipython,
  bpython, python-django-doc, and libgdal1.
  Closes: #636511, #686333, #704203
* Set package maintainer to Debian Python Modules Team.
* Bump standards version to 3.9.5, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import psycopg2.extensions
2
 
 
3
1
from django.db.backends.creation import BaseDatabaseCreation
4
2
from django.db.backends.util import truncate_name
5
3
 
11
9
    # If a column type is set to None, it won't be included in the output.
12
10
    data_types = {
13
11
        'AutoField':         'serial',
 
12
        'BinaryField':       'bytea',
14
13
        'BooleanField':      'boolean',
15
14
        'CharField':         'varchar(%(max_length)s)',
16
15
        'CommaSeparatedIntegerField': 'varchar(%(max_length)s)',
76
75
                output.append(get_index_sql('%s_%s_like' % (db_table, f.column),
77
76
                                            ' text_pattern_ops'))
78
77
        return output
79
 
 
80
 
    def set_autocommit(self):
81
 
        self._prepare_for_test_db_ddl()
82
 
 
83
 
    def _prepare_for_test_db_ddl(self):
84
 
        """Rollback and close the active transaction."""
85
 
        self.connection.connection.rollback()
86
 
        self.connection.connection.set_isolation_level(
87
 
                psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)