Update models

This commit is contained in:
sonny 2020-05-24 12:15:41 +02:00
parent 61ddef3b63
commit 191eb94ece
2 changed files with 4 additions and 3 deletions

View file

@ -43,7 +43,7 @@ class User(AbstractUser):
task = models.OneToOneField(
PeriodicTask,
on_delete=models.SET_NULL,
on_delete=models.CASCADE,
null=True,
blank=True,
editable=False,

View file

@ -1,4 +1,5 @@
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext as _
from newsreader.core.models import TimeStampedModel
@ -9,7 +10,7 @@ class Post(TimeStampedModel):
title = models.CharField(max_length=200, blank=True, null=True)
body = models.TextField(blank=True, null=True)
author = models.CharField(max_length=40, blank=True, null=True)
publication_date = models.DateTimeField(blank=True, null=True)
publication_date = models.DateTimeField(default=timezone.now)
url = models.URLField(max_length=1024, blank=True, null=True)
read = models.BooleanField(default=False)
@ -18,7 +19,7 @@ class Post(TimeStampedModel):
CollectionRule, on_delete=models.CASCADE, editable=False, related_name="posts"
)
remote_identifier = models.CharField(
max_length=500, blank=True, null=True, editable=False
max_length=500, editable=False, blank=True, null=True
)
def __str__(self):