Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Django 2.0 #40

Merged
merged 4 commits into from
Jun 25, 2018
Merged

Support Django 2.0 #40

merged 4 commits into from
Jun 25, 2018

Conversation

Surgo
Copy link
Member

@Surgo Surgo commented Jun 21, 2018

Subject: Support Django 2.0

Feature or Bugfix

  • Feature
  • Bugfix

Relates

@Surgo Surgo self-assigned this Jun 21, 2018
@@ -23,5 +23,5 @@ class TestParentModel(models.Model):


class TestChildModel(models.Model):
parent = models.ForeignKey(TestParentModel)
parent = models.ForeignKey(TestParentModel, on_delete=models.CASCADE)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -159,8 +159,10 @@ def create_model(self, model):
definition += " %s" % col_type_suffix
params.extend(extra_params)
# FK
if field.rel and field.db_constraint:
to_table = field.rel.to._meta.db_table
if field.remote_field and field.db_constraint:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field.rel is deprecated in 1.9 and removed in 2.0.

https://docs.djangoproject.com/en/2.0/releases/1.9/#field-rel-changes

'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I also overlooked ;)

Copy link
Member

@shimizukawa shimizukawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct just one line.

if field.remote_field and field.db_constraint:
to_table = field.remote_field.to._meta.db_table
to_column = field.remote_field.to._meta.get_field(
field.remote_field.field_name).column
to_column = field.rel.to._meta.get_field(field.rel.field_name).column
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line must be removed because new code is provided at one line before.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh... sorry

'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I also overlooked ;)

Copy link
Member

@shimizukawa shimizukawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shimizukawa shimizukawa merged commit 5c467be into jazzband:master Jun 25, 2018
@shimizukawa shimizukawa mentioned this pull request Jul 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants