|
| 1 | +# Generated by Django 5.1.4 on 2025-04-20 21:07 |
| 2 | + |
| 3 | +import colorfield.fields |
| 4 | +import django.db.models.deletion |
| 5 | +import django.utils.timezone |
| 6 | +import model_utils.fields |
| 7 | +from django.conf import settings |
| 8 | +from django.db import migrations, models |
| 9 | + |
| 10 | + |
| 11 | +class Migration(migrations.Migration): |
| 12 | + |
| 13 | + initial = True |
| 14 | + |
| 15 | + dependencies = [ |
| 16 | + migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
| 17 | + ] |
| 18 | + |
| 19 | + operations = [ |
| 20 | + migrations.CreateModel( |
| 21 | + name='Community', |
| 22 | + fields=[ |
| 23 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 24 | + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), |
| 25 | + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), |
| 26 | + ('name', models.CharField(max_length=300)), |
| 27 | + ('hostname', models.CharField(max_length=256)), |
| 28 | + ('description', models.TextField()), |
| 29 | + ('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)), |
| 30 | + ('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)), |
| 31 | + ('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)), |
| 32 | + ('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)), |
| 33 | + ], |
| 34 | + options={ |
| 35 | + 'verbose_name_plural': 'Communities', |
| 36 | + }, |
| 37 | + ), |
| 38 | + migrations.CreateModel( |
| 39 | + name='CommunityMember', |
| 40 | + fields=[ |
| 41 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 42 | + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), |
| 43 | + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), |
| 44 | + ('role', models.CharField(choices=[('ADMIN', 'Admin')], default='ADMIN', max_length=300)), |
| 45 | + ('community', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='members', to='community.community')), |
| 46 | + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='community_memberships', to=settings.AUTH_USER_MODEL)), |
| 47 | + ], |
| 48 | + options={ |
| 49 | + 'abstract': False, |
| 50 | + }, |
| 51 | + ), |
| 52 | + migrations.CreateModel( |
| 53 | + name='Link', |
| 54 | + fields=[ |
| 55 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 56 | + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), |
| 57 | + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), |
| 58 | + ('url', models.URLField()), |
| 59 | + ('label', models.CharField(max_length=300)), |
| 60 | + ('community', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='links', to='community.community')), |
| 61 | + ], |
| 62 | + options={ |
| 63 | + 'abstract': False, |
| 64 | + }, |
| 65 | + ), |
| 66 | + ] |
0 commit comments