Skip to content

Commit

Permalink
Typo fix and implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Gaynor committed Feb 20, 2013
1 parent 3e8ec0f commit 9c9e903
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django/db/backends/creation.py
Expand Up @@ -77,7 +77,7 @@ def sql_create_model(self, model, style, known_models=set()):
tablespace, inline=True)
if tablespace_sql:
field_output.append(tablespace_sql)
if f.rel:
if f.rel and f.db_constraint:
ref_output, pending = self.sql_for_inline_foreign_key_references(
model, f, known_models, style)
if pending:
Expand Down
2 changes: 1 addition & 1 deletion django/db/models/fields/related.py
Expand Up @@ -998,7 +998,7 @@ def __init__(self, to, to_field=None, rel_class=ManyToOneRel,
if 'db_index' not in kwargs:
kwargs['db_index'] = True

self.db_contraint = db_constraint
self.db_constraint = db_constraint
kwargs['rel'] = rel_class(to, to_field,
related_name=kwargs.pop('related_name', None),
limit_choices_to=kwargs.pop('limit_choices_to', None),
Expand Down
3 changes: 3 additions & 0 deletions tests/regressiontests/backends/models.py
Expand Up @@ -96,3 +96,6 @@ class Object(models.Model):
@python_2_unicode_compatible
class ObjectReference(models.Model):
obj = models.ForeignKey(Object, db_constraint=False)

def __str__(self):
return str(self.obj_id)

0 comments on commit 9c9e903

Please sign in to comment.