From: Radek Czajka Date: Tue, 1 Oct 2019 12:19:49 +0000 (+0200) Subject: Django 1.9 X-Git-Url: https://git.mdrn.pl/prawokultury.git/commitdiff_plain/dfcd58dbea27ffc187606d2e623e6a7902f88ad0?ds=sidebyside Django 1.9 --- diff --git a/chunks/migrations/0002_auto_20191001_1400.py b/chunks/migrations/0002_auto_20191001_1400.py new file mode 100644 index 0000000..8744b83 --- /dev/null +++ b/chunks/migrations/0002_auto_20191001_1400.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2019-10-01 12:00 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('chunks', '0001_initial'), + ] + + operations = [ + migrations.AlterModelOptions( + name='chunk', + options={'ordering': ('key',), 'verbose_name': 'chunk', 'verbose_name_plural': 'chunks'}, + ), + migrations.AlterField( + model_name='chunk', + name='key', + field=models.CharField(help_text='A unique name for this chunk of content', max_length=255, primary_key=True, serialize=False, verbose_name='key'), + ), + ] diff --git a/prawokultury/settings.d/50-contrib.py b/prawokultury/settings.d/50-contrib.py index 2481aa9..9e57637 100644 --- a/prawokultury/settings.d/50-contrib.py +++ b/prawokultury/settings.d/50-contrib.py @@ -21,7 +21,7 @@ CAS_RENAME_ATTRIBUTES = { HONEYPOT_FIELD_NAME='miut' -TAGGIT_AUTOSUGGEST_MODEL = ('questions', 'Tag') +TAGGIT_AUTOSUGGEST_MODELS = {"default": ('questions', 'Tag')} GETPAID_BACKENDS = ( 'getpaid.backends.payu', diff --git a/prawokultury/urls.py b/prawokultury/urls.py index 730b768..bcbc961 100644 --- a/prawokultury/urls.py +++ b/prawokultury/urls.py @@ -15,7 +15,6 @@ from migdal.urls import urlpatterns as migdal_urlpatterns from migdal.sitemap import sitemaps as migdal_sitemaps from questions.sitemap import sitemaps as question_sitemaps -admin.autodiscover() urlpatterns = [ url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')), @@ -30,7 +29,7 @@ urlpatterns = [ url(r'^admin/logout/$', django_cas_ng.views.logout), url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - url(r'^admin/', include(admin.site.urls)), + url(r'^admin/', admin.site.urls), ] urlpatterns += i18n_patterns( diff --git a/questions/migrations/0001_initial.py b/questions/migrations/0001_initial.py index 67986d8..f5627de 100644 --- a/questions/migrations/0001_initial.py +++ b/questions/migrations/0001_initial.py @@ -72,8 +72,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('object_id', models.IntegerField(verbose_name='Object id', db_index=True)), - ('content_type', models.ForeignKey(related_name='questions_tagitem_tagged_items', verbose_name='Content type', to='contenttypes.ContentType')), - ('tag', models.ForeignKey(related_name='items', to='questions.Tag')), + ('content_type', models.ForeignKey(related_name='questions_tagitem_tagged_items', on_delete=models.CASCADE, verbose_name='Content type', to='contenttypes.ContentType')), + ('tag', models.ForeignKey(related_name='items', to='questions.Tag', on_delete=models.CASCADE)), ], options={ 'abstract': False, diff --git a/questions/migrations/0002_auto_20191001_1400.py b/questions/migrations/0002_auto_20191001_1400.py new file mode 100644 index 0000000..2afff5a --- /dev/null +++ b/questions/migrations/0002_auto_20191001_1400.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2019-10-01 12:00 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('questions', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='question', + name='email', + field=models.EmailField(blank=True, max_length=254, null=True, verbose_name='contact e-mail'), + ), + ] diff --git a/questions/models.py b/questions/models.py index 43c6cc5..4187135 100644 --- a/questions/models.py +++ b/questions/models.py @@ -40,7 +40,7 @@ class Tag(TagBase): class TagItem(GenericTaggedItemBase): - tag = models.ForeignKey(Tag, related_name="items") + tag = models.ForeignKey(Tag, on_delete=models.CASCADE, related_name="items") class Question(models.Model): diff --git a/requirements.txt b/requirements.txt index 3a963c2..4ea433c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -i https://py.mdrn.pl/simple -Django>=1.8,<1.9 +Django>=1.9,<1.10 Pillow sorl-thumbnail==12.4.1 fnp-django-pagination==2.2.4 @@ -13,7 +13,7 @@ fnpdjango[textile]==0.4.1 python-slugify django-markupfield==1.4.3 django-gravatar2 -django-contrib-comments==1.6.0 +django-contrib-comments==1.7.3 django-comments-xtd==1.5.1 django-pipeline==1.6.14 @@ -26,7 +26,7 @@ pysolr django-piwik django-taggit==0.22.2 -django-taggit-autosuggest>=0.3.8 +django-taggit-autosuggest==0.3.6 django-getpaid==1.7.6 django-celery>=3.1,<3.2 diff --git a/shop/migrations/0001_initial.py b/shop/migrations/0001_initial.py index 09a9aa4..7b366eb 100644 --- a/shop/migrations/0001_initial.py +++ b/shop/migrations/0001_initial.py @@ -18,7 +18,7 @@ class Migration(migrations.Migration): ('price', models.DecimalField(verbose_name='price', max_digits=6, decimal_places=2)), ('cost_const', models.DecimalField(max_digits=6, decimal_places=2)), ('cost_per_item', models.DecimalField(default=0, max_digits=6, decimal_places=2)), - ('entry', models.OneToOneField(to='migdal.Entry')), + ('entry', models.OneToOneField(to='migdal.Entry', on_delete=models.CASCADE)), ], options={ 'ordering': ['entry'], @@ -37,7 +37,7 @@ class Migration(migrations.Migration): ('address', models.TextField(verbose_name='address', db_index=True)), ('payed_at', models.DateTimeField(db_index=True, null=True, verbose_name='payed at', blank=True)), ('language_code', models.CharField(max_length=2, null=True, blank=True)), - ('offer', models.ForeignKey(verbose_name='offer', to='shop.Offer')), + ('offer', models.ForeignKey(verbose_name='offer', on_delete=models.CASCADE, to='shop.Offer')), ], options={ 'ordering': ['-payed_at'], diff --git a/shop/migrations/0002_auto_20191001_1400.py b/shop/migrations/0002_auto_20191001_1400.py new file mode 100644 index 0000000..7ec1120 --- /dev/null +++ b/shop/migrations/0002_auto_20191001_1400.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2019-10-01 12:00 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shop', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='email', + field=models.EmailField(db_index=True, max_length=254, verbose_name='email'), + ), + ] diff --git a/shop/models.py b/shop/models.py index aca0703..47cace3 100644 --- a/shop/models.py +++ b/shop/models.py @@ -16,7 +16,7 @@ from . import app_settings class Offer(models.Model): """ A fundraiser for a particular book. """ - entry = models.OneToOneField(Entry) # filter publications! + entry = models.OneToOneField(Entry, models.CASCADE) # filter publications! price = models.DecimalField(_('price'), decimal_places=2, max_digits=6) cost_const = models.DecimalField(decimal_places=2, max_digits=6) cost_per_item = models.DecimalField(decimal_places=2, max_digits=6, default=0) @@ -45,7 +45,7 @@ class Order(models.Model): The payment was completed if and only if payed_at is set. """ - offer = models.ForeignKey(Offer, verbose_name=_('offer')) + offer = models.ForeignKey(Offer, models.CASCADE, verbose_name=_('offer')) items = models.IntegerField(verbose_name=_('items'), default=1) name = models.CharField(_('name'), max_length=127, blank=True) email = models.EmailField(_('email'), db_index=True)