diff --git a/django/db/backends/postgresql_psycopg2/introspection.py b/django/db/backends/postgresql_psycopg2/introspection.py
index aef0bf0..a38a13a 100644
a
|
b
|
class DatabaseIntrospection(BaseDatabaseIntrospection):
|
128 | 128 | kc.constraint_name, |
129 | 129 | kc.column_name, |
130 | 130 | c.constraint_type, |
131 | | array(SELECT table_name::text || '.' || column_name::text FROM information_schema.constraint_column_usage WHERE constraint_name = kc.constraint_name) |
| 131 | array(SELECT table_name::text || '.' || column_name::text |
| 132 | FROM information_schema.constraint_column_usage |
| 133 | WHERE constraint_name = kc.constraint_name) |
132 | 134 | FROM information_schema.key_column_usage AS kc |
133 | 135 | JOIN information_schema.table_constraints AS c ON |
134 | 136 | kc.table_schema = c.table_schema AND |
diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py
index db22dba..fd94837 100644
a
|
b
|
class BaseDatabaseSchemaEditor(object):
|
491 | 491 | new_db_params = new_field.db_parameters(connection=self.connection) |
492 | 492 | new_type = new_db_params['type'] |
493 | 493 | if (old_type is None and old_field.rel is None) or (new_type is None and new_field.rel is None): |
494 | | raise ValueError("Cannot alter field %s into %s - they do not properly define db_type (are you using PostGIS 1.5 or badly-written custom fields?)" % ( |
495 | | old_field, |
496 | | new_field, |
497 | | )) |
| 494 | raise ValueError( |
| 495 | "Cannot alter field %s into %s - they do not properly define " |
| 496 | "db_type (are you using PostGIS 1.5 or badly-written custom " |
| 497 | "fields?)" % ( |
| 498 | old_field, |
| 499 | new_field, |
| 500 | ), |
| 501 | ) |
498 | 502 | elif old_type is None and new_type is None and (old_field.rel.through and new_field.rel.through and old_field.rel.through._meta.auto_created and new_field.rel.through._meta.auto_created): |
499 | 503 | return self._alter_many_to_many(model, old_field, new_field, strict) |
500 | 504 | elif old_type is None and new_type is None and (old_field.rel.through and new_field.rel.through and not old_field.rel.through._meta.auto_created and not new_field.rel.through._meta.auto_created): |
501 | 505 | # Both sides have through models; this is a no-op. |
502 | 506 | return |
503 | 507 | elif old_type is None or new_type is None: |
504 | | raise ValueError("Cannot alter field %s into %s - they are not compatible types (you cannot alter to or from M2M fields, or add or remove through= on M2M fields)" % ( |
505 | | old_field, |
506 | | new_field, |
507 | | )) |
| 508 | raise ValueError( |
| 509 | "Cannot alter field %s into %s - they are not compatible types " |
| 510 | "(you cannot alter to or from M2M fields, or add or remove " |
| 511 | "through= on M2M fields)" % ( |
| 512 | old_field, |
| 513 | new_field, |
| 514 | ) |
| 515 | ) |
508 | 516 | |
509 | 517 | self._alter_field(model, old_field, new_field, old_type, new_type, old_db_params, new_db_params, strict) |
510 | 518 | |
diff --git a/django/utils/lorem_ipsum.py b/django/utils/lorem_ipsum.py
index b91fecf..19bf899 100644
a
|
b
|
from __future__ import unicode_literals
|
6 | 6 | |
7 | 7 | import random |
8 | 8 | |
9 | | COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' |
| 9 | COMMON_P = ( |
| 10 | 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod ' |
| 11 | 'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim ' |
| 12 | 'veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea ' |
| 13 | 'commodo consequat. Duis aute irure dolor in reprehenderit in voluptate ' |
| 14 | 'velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint ' |
| 15 | 'occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' |
| 16 | 'mollit anim id est laborum.' |
| 17 | ) |
10 | 18 | |
11 | 19 | WORDS = ('exercitationem', 'perferendis', 'perspiciatis', 'laborum', 'eveniet', |
12 | 20 | 'sunt', 'iure', 'nam', 'nobis', 'eum', 'cum', 'officiis', 'excepturi', |
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index 5715d57..3d94f22 100644
a
|
b
|
def templatize(src, origin=None):
|
618 | 618 | filemsg = '' |
619 | 619 | if origin: |
620 | 620 | filemsg = 'file %s, ' % origin |
621 | | raise SyntaxError("Translation blocks must not include other block tags: %s (%sline %d)" % (t.contents, filemsg, t.lineno)) |
| 621 | raise SyntaxError( |
| 622 | "Translation blocks must not include other block tags: " |
| 623 | "%s (%sline %d)" % (t.contents, filemsg, t.lineno) |
| 624 | ) |
622 | 625 | elif t.token_type == TOKEN_VAR: |
623 | 626 | if inplural: |
624 | 627 | plural.append('%%(%s)s' % t.contents) |
diff --git a/setup.cfg b/setup.cfg
index f6a4a2b..5ef789c 100644
a
|
b
|
install-script = scripts/rpm-install.sh
|
4 | 4 | |
5 | 5 | [flake8] |
6 | 6 | exclude=build,.git,./django/utils/dictconfig.py,./django/utils/unittest.py,./django/utils/lru_cache.py,./django/utils/six.py,./django/conf/app_template/*,./django/dispatch/weakref_backports.py |
7 | | ignore=E123,E128,E265,E501,W601 |
| 7 | ignore=E123,E128,E265,W601 |
| 8 | max-line-length = 120 |
8 | 9 | |
9 | 10 | [metadata] |
10 | 11 | license-file = LICENSE |