diff options
author | Matthew Lemon <y@yulqen.org> | 2024-12-31 16:01:12 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-12-31 16:01:12 +0000 |
commit | c74ea9e6b4af97be26029334868fa3264032c2d3 (patch) | |
tree | 6d0dcc825f9c4d70f543eeb1817d664e5e358320 /alphabetlearning/resources/migrations/0001_initial.py | |
parent | b00665b30423e4818afafdec305202797638e145 (diff) |
Major refactoring and removal of junk
This commit includes significant refactoring, cleanup, and updates across various components of the Django project. The following changes were made:
- **Database Migration Updates:**
- Removed unnecessary migrations in the `alphabetlearning.contrib.sites` and `alphabetlearning.payments` apps, consolidating them into cleaner initial migration files.
- Altered the `Site` model in `alphabetlearning.contrib.sites` to streamline its fields and default settings.
- Introduced new models in `alphabetlearning.payments` related to email signups and verification, reflecting a shift in focus and better alignment with current business logic.
- **Django Settings Changes:**
- Updated the database settings to use SQLite for local development, while commenting out production-specific configurations.
- Managed third-party dependencies within `requirements.txt` and `pyproject.toml`, ensuring alignment with the latest Django version (5.1.4) and removing obsolete dependencies (e.g., `celery`, `django-celery-beat`, `flower`, etc.).
- **Docker and Compose Clean-up:**
- Removed old Dockerfiles and unnecessary services from the `docker-compose` configuration, streamlining the local and production setups.
- Updated the Dockerfile configuration for local development, focusing on essential services only.
- **General Code Clean-up:**
- Removed unused tasks, views, tests, and files related to the Celery and Redis frameworks.
- Cleaned up various model definitions and their related migrations for consistency and clarity.
- **Documentation and Comments:**
- Updated comments and code documentation where necessary to reflect the changes made during this cleanup process.
This major refactor aims to enhance project maintainability and streamline the development experience while preparing for future feature expansions and improvements.
Diffstat (limited to 'alphabetlearning/resources/migrations/0001_initial.py')
-rw-r--r-- | alphabetlearning/resources/migrations/0001_initial.py | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/alphabetlearning/resources/migrations/0001_initial.py b/alphabetlearning/resources/migrations/0001_initial.py index 812c98f..9112f51 100644 --- a/alphabetlearning/resources/migrations/0001_initial.py +++ b/alphabetlearning/resources/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.0.4 on 2024-05-13 21:41 +# Generated by Django 5.1.4 on 2024-12-31 15:26 import django.db.models.deletion from django.db import migrations, models @@ -19,16 +19,22 @@ class Migration(migrations.Migration): ('file_name', models.CharField(max_length=255)), ('file_size', models.IntegerField()), ], + options={ + 'verbose_name_plural': 'PDF Resources', + }, ), migrations.CreateModel( name='Resource', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=255)), + ('stripe_product_id', models.CharField(max_length=100)), ('thumbnail_filenames', models.JSONField(default=list, verbose_name='Thumbnail filenames')), - ('description', models.TextField(max_length=1000)), - ('age_range', models.CharField(choices=[('3-5', '3-5'), ('5-7', '5-7'), ('7-11', '7-11'), ('11-14', '11-14'), ('14-16', '14-16'), ('16+', '16+'), ('Age not applicable', 'Age not applicable')], default='5-7', max_length=20)), + ('description', models.TextField(help_text='\n <strong>Markdown acceptable here!</strong>This is your opportunity to clearly explain what\n your resource is all about! It’s worth remembering that you are using the space to\n communicate to two different audiences. Firstly, think about what fellow teachers\n would like to know, such as exactly what the resource contains and how it could be used in\n the classroom. Secondly, the words you include on this page are also talking to internal and\n external search engines. External search engines, like Google, show the first 155 characters\n of the resource description, so make sure you take advantage\n of these characters by using lots of relevant keywords as part of an enticing pitch.\n', max_length=5000)), + ('card_description', models.TextField(blank=True, default='', help_text="If you enter text here, it will be used in the 'card' description box on the home page. Max 1000 characters.", max_length=1000)), + ('age_range', models.CharField(choices=[('Preschool (3-4yrs)', 'Preschool (3-4yrs)'), ('Nursery (2-5yrs)', 'Nursery (2-5yrs)'), ('Reception (4-5yrs)', 'Reception (4-5yrs)'), ('Year 1 (5-6yrs)', 'Year 1 (5-6yrs)'), ('Year 2 (6-7yrs)', 'Year 2 (6-7yrs)'), ('Early Years (0-5yrs)', 'Early Years (0-5yrs)'), ('Keystage 1 (5-7yrs)', 'Keystage 1 (5-7yrs)'), ('Keystage 2 (7-11yrs)', 'Keystage 2 (7-11yrs)'), ('Age not applicable', 'Age not applicable')], default='5-7', max_length=20)), ('curriculum', models.CharField(blank=True, choices=[('No curriculum', 'No curriculum'), ('English', 'English'), ('Scottish', 'Scottish')], default='English', max_length=20, null=True)), + ('feature_slot', models.IntegerField(blank=True, choices=[(1, 1), (2, 2), (3, 3)], default=0, null=True, unique=True)), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ], @@ -40,12 +46,26 @@ class Migration(migrations.Migration): ('name', models.CharField(max_length=255)), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), + ('colour_css_class', models.CharField(blank=True, max_length=56, null=True)), + ('badge_foreground_colour', models.CharField(blank=True, max_length=56, null=True)), ], options={ 'verbose_name_plural': 'Resource Categories', }, ), migrations.CreateModel( + name='ResourceSubcategory', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + options={ + 'verbose_name_plural': 'Resource Subcategories', + }, + ), + migrations.CreateModel( name='ResourceType', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), @@ -53,6 +73,9 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ], + options={ + 'verbose_name_plural': 'Resource Types', + }, ), migrations.CreateModel( name='PDFPageSnapshot', @@ -62,6 +85,9 @@ class Migration(migrations.Migration): ('file_name', models.CharField(max_length=255)), ('pdf_file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pdf_page_snapshots', to='resources.pdfresource')), ], + options={ + 'verbose_name_plural': 'PDF Page Snapshots', + }, ), migrations.AddField( model_name='pdfresource', @@ -70,13 +96,13 @@ class Migration(migrations.Migration): ), migrations.AddField( model_name='resource', - name='additional_resource_category', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='additional_resource_category', to='resources.resourcecategory'), + name='main_resource_category', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='main_resource_category', to='resources.resourcecategory'), ), migrations.AddField( model_name='resource', - name='main_resource_category', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='main_resource_category', to='resources.resourcecategory'), + name='subcategories', + field=models.ManyToManyField(blank=True, related_name='additional_resource_category', to='resources.resourcesubcategory'), ), migrations.AddField( model_name='resource', |