Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Django v3 #102

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ language: python
matrix:
fast_finish: true
include:
- python: 3.6
- python: 3.7
- python: 3.8
- python: 3.9
# allow_failures:
# - python: 3.9
- python: 3.10
# Cache pip packages for us so builds are faster
cache: pip
# We want to use MySQL
Expand Down
2 changes: 0 additions & 2 deletions alexia/api/v1/test/test_authorization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from alexia.test import APITestCase

from ..common import format_authorization
Expand Down
2 changes: 0 additions & 2 deletions alexia/api/v1/test/test_billing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from alexia.apps.billing.models import Order
from alexia.test import APITestCase

Expand Down
2 changes: 0 additions & 2 deletions alexia/api/v1/test/test_common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

import datetime

from django.utils import timezone
Expand Down
2 changes: 0 additions & 2 deletions alexia/api/v1/test/test_juliana.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

import datetime

from django.test.testcases import SimpleTestCase
Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import django.utils.timezone
from django.db import migrations, models

Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0002_auto_20150127_1314.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models

Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0003_auto_20150203_0018.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models

Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0004_auto_20150203_0239.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0005_auto_20150326_0118.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations


Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0006_auto_20150401_2006.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models

Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0007_auto_20150402_0047.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0008_order_rfidcard.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0009_alter_order_rfidcard.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0010_alter_order_amount.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0011_alter_order_purchase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0012_auto_20160412_1420.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-12 12:20
from __future__ import unicode_literals

import django.db.models.deletion
from django.db import migrations, models

Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0013_auto_20160419_1133.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-19 09:33
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0014_auto_20170116_1927.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-16 18:28
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0015_auto_20170116_2251.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-16 21:51
from __future__ import unicode_literals

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/billing/migrations/0016_rfid_cards_set_null.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-06 21:45
from __future__ import unicode_literals

import django.db.models.deletion
from django.db import migrations, models

Expand Down
11 changes: 0 additions & 11 deletions alexia/apps/billing/models.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
from __future__ import unicode_literals

from decimal import Decimal

from django.conf import settings
from django.db import models
from django.db.models import Q
from django.urls import reverse
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _

from alexia.apps.organization.models import Organization
from alexia.apps.scheduling.models import Event
from alexia.core.validators import validate_color


@python_2_unicode_compatible
class ProductGroup(models.Model):
organization = models.ForeignKey(
Organization,
Expand All @@ -37,7 +33,6 @@ def get_absolute_url(self):
return reverse('productgroup_detail', args=[self.pk])


@python_2_unicode_compatible
class PriceGroup(models.Model):
organization = models.ForeignKey(
Organization,
Expand Down Expand Up @@ -65,7 +60,6 @@ def get_absolute_url(self):
return reverse('pricegroup_detail', args=[self.pk])


@python_2_unicode_compatible
class SellingPrice(models.Model):
pricegroup = models.ForeignKey(PriceGroup, verbose_name=_('price group'), on_delete=models.CASCADE)
productgroup = models.ForeignKey(ProductGroup, verbose_name=_('product group'), on_delete=models.CASCADE)
Expand All @@ -86,7 +80,6 @@ def get_absolute_url(self):
return self.pricegroup.get_absolute_url()


@python_2_unicode_compatible
class Product(models.Model):
name = models.CharField(_('name'), max_length=32)
shortcut = models.CharField(_('shortcut'), max_length=1, null=False, blank=True)
Expand Down Expand Up @@ -193,7 +186,6 @@ def get_price(self, event):
return self.temporaryproduct.price


@python_2_unicode_compatible
class RfidCard(models.Model):
identifier = models.CharField(_('identifier'), unique=True, max_length=50)
is_active = models.BooleanField(_('is active'), default=False)
Expand All @@ -213,7 +205,6 @@ def owner(self):
owner.short_description = _('owner')


@python_2_unicode_compatible
class Authorization(models.Model):
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
Expand Down Expand Up @@ -265,7 +256,6 @@ def is_valid(self):
return self.start_date <= timezone.now() <= self.end_date


@python_2_unicode_compatible
class Order(models.Model):
event = models.ForeignKey(Event, on_delete=models.PROTECT, related_name='orders', verbose_name=_('event'))
authorization = models.ForeignKey(
Expand Down Expand Up @@ -318,7 +308,6 @@ def debtor(self):
debtor.short_description = _('debtor')


@python_2_unicode_compatible
class Purchase(models.Model):
order = models.ForeignKey(Order, on_delete=models.CASCADE, related_name='purchases', verbose_name=_('order'))
product = models.CharField(_('product'), max_length=32)
Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _

Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/consumption/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

from crispy_forms.helper import FormHelper
from django import forms
from django.core.exceptions import ValidationError
Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/consumption/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-06 11:09
from __future__ import unicode_literals

import django.db.models.deletion
from django.db import migrations, models

Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/consumption/migrations/0002_auto_20161206_1438.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-06 13:38
from __future__ import unicode_literals

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/consumption/migrations/0003_auto_20161206_1514.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-06 14:14
from __future__ import unicode_literals

import django.db.models.deletion
from django.db import migrations, models

Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/consumption/migrations/0004_auto_20161207_1624.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-12-07 15:24
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-15 12:26
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
7 changes: 0 additions & 7 deletions alexia/apps/consumption/models.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
from __future__ import unicode_literals

from django.conf import settings
from django.core.validators import MinValueValidator
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _

from alexia.apps.scheduling.models import Event


@python_2_unicode_compatible
class ConsumptionProduct(models.Model):
name = models.CharField(_('name'), max_length=32)
is_active = models.BooleanField(_('is currently active'), default=True)
Expand Down Expand Up @@ -42,7 +38,6 @@ class Meta:
verbose_name_plural = _('consumption products by weight')


@python_2_unicode_compatible
class ConsumptionForm(models.Model):
event = models.OneToOneField(
Event,
Expand Down Expand Up @@ -129,7 +124,6 @@ class Meta:
abstract = True


@python_2_unicode_compatible
class WeightEntry(Entry):
product = models.ForeignKey(
WeightConsumptionProduct,
Expand Down Expand Up @@ -181,7 +175,6 @@ def is_doubtful(self):
return bool(change_percentage >= 25)


@python_2_unicode_compatible
class UnitEntry(Entry):
product = models.ForeignKey(
ConsumptionProduct,
Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/organization/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models

Expand Down
2 changes: 0 additions & 2 deletions alexia/apps/organization/migrations/0004_location_color.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-07 08:45
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


Expand Down
Loading