X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/967eed676fc83d15b26149047f353ac61faa8217..bde2a16ae2669bea94ec0f23c60213a26d4881f4:/src/polls/models.py diff --git a/src/polls/models.py b/src/polls/models.py index 4b1882df2..ddf4003f8 100644 --- a/src/polls/models.py +++ b/src/polls/models.py @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.core.exceptions import ValidationError -from django.core.urlresolvers import reverse +from django.urls import reverse USED_POLLS_KEY = 'used_polls' @@ -42,7 +41,7 @@ class Poll(models.Model): class PollItem(models.Model): - poll = models.ForeignKey(Poll, related_name='items') + poll = models.ForeignKey(Poll, models.CASCADE, related_name='items') content = models.TextField(_('content')) vote_count = models.IntegerField(_('vote count'), default=0)