Skip to content

fix on_delete parameter for Django 2.0 #29

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions httpproxy/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Migration(migrations.Migration):
('order', models.PositiveSmallIntegerField(default=1)),
('name', models.CharField(max_length=100, verbose_name='naam')),
('value', models.CharField(max_length=250, null=True, verbose_name='value', blank=True)),
('request', models.ForeignKey(related_name='parameters', verbose_name='request', to='httpproxy.Request')),
('request', models.ForeignKey(related_name='parameters', verbose_name='request', to='httpproxy.Request', on_delete=models.CASCADE)),
],
options={
'ordering': ('order',),
Expand All @@ -52,7 +52,7 @@ class Migration(migrations.Migration):
('status', models.PositiveSmallIntegerField(default=200)),
('content_type', models.CharField(max_length=200, verbose_name='inhoudstype')),
('content', models.TextField(verbose_name='inhoud')),
('request', models.OneToOneField(verbose_name='request', to='httpproxy.Request')),
('request', models.OneToOneField(verbose_name='request', to='httpproxy.Request', on_delete=models.CASCADE)),
],
options={
'verbose_name': 'response',
Expand Down
6 changes: 3 additions & 3 deletions httpproxy/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.db import models
from django.utils.six.moves import urllib
from six.moves import urllib
from django.utils.translation import ugettext as _


Expand Down Expand Up @@ -68,7 +68,7 @@ class RequestParameter(models.Model):
('G', 'GET'),
('P', 'POST'),
)
request = models.ForeignKey(Request, verbose_name=_('request'), related_name='parameters')
request = models.ForeignKey(Request, verbose_name=_('request'), related_name='parameters', on_delete=models.CASCADE)
type = models.CharField(max_length=1, choices=REQUEST_TYPES, default='G')
order = models.PositiveSmallIntegerField(default=1)
name = models.CharField(_('name'), max_length=100)
Expand All @@ -89,7 +89,7 @@ class Response(models.Model):
The response that was recorded in response to the corresponding
:class:`~httpproxy.models.Request`.
"""
request = models.OneToOneField(Request, verbose_name=_('request'))
request = models.OneToOneField(Request, verbose_name=_('request'), on_delete=models.CASCADE)
status = models.PositiveSmallIntegerField(default=200)
content_type = models.CharField(_('content type'), max_length=200)
content = models.TextField(_('content'))
Expand Down
2 changes: 1 addition & 1 deletion httpproxy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re

from django.http import HttpResponse
from django.utils.six.moves import urllib
from six.moves import urllib
from django.views.generic import View

from httpproxy.recorder import ProxyRecorder
Expand Down