Skip to content

Commit 3c26499

Browse files
committed
update to django 2.2
1 parent 20942e5 commit 3c26499

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

seo/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Migration(migrations.Migration):
1919
('description', models.CharField(default=b'', max_length=200, verbose_name='Description', blank=True)),
2020
('keywords', models.CharField(default=b'', max_length=1000, verbose_name='Keywords', blank=True)),
2121
('object_id', models.PositiveIntegerField()),
22-
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
22+
('content_type', models.ForeignKey(on_delete=models.deletion.CASCADE, to='contenttypes.ContentType')),
2323
],
2424
options={
2525
'verbose_name': 'SEO fields',

seo/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ class Meta:
1919
keywords = models.CharField(verbose_name=_('Keywords'),
2020
max_length=1000, default='', blank=True)
2121

22-
content_type = models.ForeignKey(ContentType)
22+
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
2323
object_id = models.PositiveIntegerField()
2424
content_object = GenericForeignKey('content_type', 'object_id')
2525

26-
def __unicode__(self):
26+
def __str__(self):
2727
return self.title
2828

2929

@@ -39,5 +39,5 @@ class Meta:
3939
def get_absolute_url(self):
4040
return self.url
4141

42-
def __unicode__(self):
42+
def __str__(self):
4343
return self.url

0 commit comments

Comments
 (0)