Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Django 2.0 support (#4)
Browse files Browse the repository at this point in the history
* Add requirements for Django 2.0

* Prepare notes for django 2.o

* Changed a thing

* Had some jokers from the distant past come in and review
  • Loading branch information
Woodzyowl authored Dec 5, 2018
1 parent 805ac89 commit 55238a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions notes/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
import django.db.models.deletion


class Migration(migrations.Migration):
Expand All @@ -23,8 +24,8 @@ class Migration(migrations.Migration):
('content', models.TextField(verbose_name='Content')),
('public', models.BooleanField(default=True, verbose_name='Public')),
('object_id', models.PositiveIntegerField()),
('author', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True)),
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
('author', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=django.db.models.deletion.CASCADE)),
('content_type', models.ForeignKey(to='contenttypes.ContentType', on_delete=django.db.models.deletion.CASCADE)),
],
options={
'verbose_name': 'Note',
Expand Down
4 changes: 2 additions & 2 deletions notes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Note(TimeStampedModel):
"""
content = models.TextField(_('Content'))
public = models.BooleanField(_('Public'), default=True)
author = models.ForeignKey(User, blank=True, null=True)
content_type = models.ForeignKey(ContentType)
author = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE)
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey("content_type", "object_id")

Expand Down

0 comments on commit 55238a2

Please sign in to comment.