-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy path0001_initial.py
More file actions
66 lines (60 loc) · 3.99 KB
/
0001_initial.py
File metadata and controls
66 lines (60 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Generated by Django 5.1.4 on 2025-04-20 21:07
import colorfield.fields
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Community',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('name', models.CharField(max_length=300)),
('hostname', models.CharField(max_length=256)),
('description', models.TextField()),
('landing_page_primary_color', colorfield.fields.ColorField(blank=True, default=None, help_text='Used for the background of the landing page. Depending on the contrast, it will be used to decide if the text should be white or black.', image_field=None, max_length=25, null=True, samples=None)),
('landing_page_secondary_color', colorfield.fields.ColorField(blank=True, default=None, help_text='Used for the logo color, borders and, if not specified, the hover effect of the links.', image_field=None, max_length=25, null=True, samples=None)),
('landing_page_hover_color', colorfield.fields.ColorField(blank=True, default=None, help_text='Optional. Used when hovering the links. If empty, it will use the secondary color.', image_field=None, max_length=25, null=True, samples=None)),
('landing_page_custom_logo_svg', models.TextField(blank=True, help_text='Optional. If empty, it will use the Python Italia logo with the community name below. Copy your SVG code here.', null=True)),
],
options={
'verbose_name_plural': 'Communities',
},
),
migrations.CreateModel(
name='CommunityMember',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('role', models.CharField(choices=[('ADMIN', 'Admin')], default='ADMIN', max_length=300)),
('community', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='members', to='community.community')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='community_memberships', to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Link',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('url', models.URLField()),
('label', models.CharField(max_length=300)),
('community', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='links', to='community.community')),
],
options={
'abstract': False,
},
),
]