2018-06-23 19:08:56 +00:00
|
|
|
# Generated by Django 2.0.6 on 2018-06-23 19:07
|
|
|
|
from decimal import Decimal
|
|
|
|
|
|
|
|
import django.db.models.deletion
|
|
|
|
import djmoney.models.fields
|
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations
|
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
2019-08-31 22:27:36 +00:00
|
|
|
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
|
2018-06-23 19:08:56 +00:00
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2019-08-31 22:27:36 +00:00
|
|
|
name="Membership",
|
2018-06-23 19:08:56 +00:00
|
|
|
fields=[
|
2019-08-31 22:27:36 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"modified",
|
|
|
|
models.DateTimeField(auto_now=True, verbose_name="modified"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"created",
|
|
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"can_vote",
|
|
|
|
models.BooleanField(
|
|
|
|
default=False,
|
|
|
|
help_text="Indicates that the user has a democratic membership of the organization.",
|
|
|
|
verbose_name="can vote",
|
|
|
|
),
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
],
|
|
|
|
options={
|
2019-08-31 22:27:36 +00:00
|
|
|
"verbose_name": "membership",
|
|
|
|
"verbose_name_plural": "memberships",
|
2018-06-23 19:08:56 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2019-08-31 22:27:36 +00:00
|
|
|
name="Organization",
|
2018-06-23 19:08:56 +00:00
|
|
|
fields=[
|
2019-08-31 22:27:36 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"modified",
|
|
|
|
models.DateTimeField(auto_now=True, verbose_name="modified"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"created",
|
|
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created"),
|
|
|
|
),
|
|
|
|
("name", models.CharField(max_length=64, verbose_name="name")),
|
2018-06-23 19:08:56 +00:00
|
|
|
],
|
|
|
|
options={
|
2019-08-31 22:27:36 +00:00
|
|
|
"verbose_name": "organization",
|
|
|
|
"verbose_name_plural": "organizations",
|
2018-06-23 19:08:56 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2019-08-31 22:27:36 +00:00
|
|
|
name="Subscription",
|
2018-06-23 19:08:56 +00:00
|
|
|
fields=[
|
2019-08-31 22:27:36 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"modified",
|
|
|
|
models.DateTimeField(auto_now=True, verbose_name="modified"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"created",
|
|
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"active",
|
|
|
|
models.BooleanField(
|
|
|
|
default=False,
|
|
|
|
help_text="Automatically set by payment system.",
|
|
|
|
verbose_name="active",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("starts", models.DateField()),
|
|
|
|
("ends", models.DateField()),
|
|
|
|
(
|
|
|
|
"renewed_subscription",
|
|
|
|
models.ForeignKey(
|
|
|
|
blank=True,
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
|
|
to="membership.Subscription",
|
|
|
|
verbose_name="renewed subscription",
|
|
|
|
),
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
],
|
|
|
|
options={
|
2019-08-31 22:27:36 +00:00
|
|
|
"verbose_name": "subscription",
|
|
|
|
"verbose_name_plural": "subscriptions",
|
2018-06-23 19:08:56 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2019-08-31 22:27:36 +00:00
|
|
|
name="SubscriptionType",
|
2018-06-23 19:08:56 +00:00
|
|
|
fields=[
|
2019-08-31 22:27:36 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"modified",
|
|
|
|
models.DateTimeField(auto_now=True, verbose_name="modified"),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"created",
|
|
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created"),
|
|
|
|
),
|
|
|
|
("name", models.CharField(max_length=64, verbose_name="name")),
|
|
|
|
(
|
|
|
|
"fee_currency",
|
|
|
|
djmoney.models.fields.CurrencyField(
|
|
|
|
choices=[("DKK", "DKK")],
|
|
|
|
default="XYZ",
|
|
|
|
editable=False,
|
|
|
|
max_length=3,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"fee",
|
|
|
|
djmoney.models.fields.MoneyField(
|
|
|
|
decimal_places=2, default=Decimal("0.0"), max_digits=16
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"fee_vat_currency",
|
|
|
|
djmoney.models.fields.CurrencyField(
|
|
|
|
choices=[("DKK", "DKK")],
|
|
|
|
default="XYZ",
|
|
|
|
editable=False,
|
|
|
|
max_length=3,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"fee_vat",
|
|
|
|
djmoney.models.fields.MoneyField(
|
|
|
|
decimal_places=2, default=Decimal("0"), max_digits=16
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"duration",
|
|
|
|
models.PositiveSmallIntegerField(
|
|
|
|
choices=[(1, "annual")], default=1, verbose_name="duration"
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"organization",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
|
|
to="membership.Organization",
|
|
|
|
),
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
],
|
|
|
|
options={
|
2019-08-31 22:27:36 +00:00
|
|
|
"verbose_name": "subscription type",
|
|
|
|
"verbose_name_plural": "subscription types",
|
2018-06-23 19:08:56 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
2019-08-31 22:27:36 +00:00
|
|
|
model_name="subscription",
|
|
|
|
name="subscription_type",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
|
|
related_name="memberships",
|
|
|
|
to="membership.SubscriptionType",
|
|
|
|
verbose_name="subscription type",
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2019-08-31 22:27:36 +00:00
|
|
|
model_name="subscription",
|
|
|
|
name="user",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2019-08-31 22:27:36 +00:00
|
|
|
model_name="membership",
|
|
|
|
name="organization",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT,
|
|
|
|
to="membership.Organization",
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2019-08-31 22:27:36 +00:00
|
|
|
model_name="membership",
|
|
|
|
name="user",
|
|
|
|
field=models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL
|
|
|
|
),
|
2018-06-23 19:08:56 +00:00
|
|
|
),
|
|
|
|
]
|