diff --git a/CHANGELOG.md b/CHANGELOG.md index a688249..7739925 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) since 0.4.1, and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## UNRELEASED (XXXX-YY-ZZ) + +### Added + +- SQLite is now a supported database engine for easier deployment; + use `"ENGINE": "django.db.backends.sqlite3"` in the settings to enable it; + the `"NAME"` setting is a relative path for the DB file, from the working directory + ## 1.3.0 (2024-11-02) This is a small release, with a few features and bugfixes. The code is now diff --git a/la_chariotte/order/migrations/0017_orderauthor_alter_order_author.py b/la_chariotte/order/migrations/0017_orderauthor_alter_order_author.py index 4de8599..167f8ab 100644 --- a/la_chariotte/order/migrations/0017_orderauthor_alter_order_author.py +++ b/la_chariotte/order/migrations/0017_orderauthor_alter_order_author.py @@ -22,18 +22,18 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("first_name", models.CharField(verbose_name="Prénom")), - ("last_name", models.CharField(verbose_name="Nom")), + ("first_name", models.CharField(max_length=256, verbose_name="Prénom")), + ("last_name", models.CharField(max_length=256, verbose_name="Nom")), ( "phone", - models.CharField( + models.CharField(max_length=256, help_text="Pour vous que l'organisateur·ice vous contacte en cas de besoin", verbose_name="Numéro de téléphone", ), ), ( "email", - models.CharField( + models.CharField(max_length=256, verbose_name="Pour vous que l'organisateur·ice vous contacte en cas de besoin" ), ), diff --git a/la_chariotte/order/migrations/0020_groupedorder_total_price_alter_orderauthor_email.py b/la_chariotte/order/migrations/0020_groupedorder_total_price_alter_orderauthor_email.py index a2398f6..16aebbe 100644 --- a/la_chariotte/order/migrations/0020_groupedorder_total_price_alter_orderauthor_email.py +++ b/la_chariotte/order/migrations/0020_groupedorder_total_price_alter_orderauthor_email.py @@ -17,7 +17,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="orderauthor", name="email", - field=models.CharField( + field=models.CharField(max_length=256, help_text="Pour vous que l'organisateur·ice vous contacte en cas de besoin", verbose_name="Adresse mail", ), diff --git a/la_chariotte/order/migrations/0021_alter_orderauthor_email_alter_orderauthor_phone.py b/la_chariotte/order/migrations/0021_alter_orderauthor_email_alter_orderauthor_phone.py index 1e836a9..088928c 100644 --- a/la_chariotte/order/migrations/0021_alter_orderauthor_email_alter_orderauthor_phone.py +++ b/la_chariotte/order/migrations/0021_alter_orderauthor_email_alter_orderauthor_phone.py @@ -12,7 +12,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="orderauthor", name="email", - field=models.CharField( + field=models.CharField(max_length=256, help_text="Pour que l'organisateur·ice vous contacte en cas de besoin", verbose_name="Adresse mail", ), @@ -20,7 +20,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="orderauthor", name="phone", - field=models.CharField( + field=models.CharField(max_length=256, help_text="Pour que l'organisateur·ice vous contacte en cas de besoin", verbose_name="Numéro de téléphone", ), diff --git a/la_chariotte/order/migrations/0025_groupedorder_code.py b/la_chariotte/order/migrations/0025_groupedorder_code.py index 47cba02..f9a477c 100644 --- a/la_chariotte/order/migrations/0025_groupedorder_code.py +++ b/la_chariotte/order/migrations/0025_groupedorder_code.py @@ -45,12 +45,12 @@ class Migration(migrations.Migration): migrations.AddField( model_name="groupedorder", name="code", - field=models.CharField(auto_created=True, null=True), + field=models.CharField(max_length=256, auto_created=True, null=True), ), migrations.RunPython(set_code_default, reverse_set_code_default), migrations.AlterField( model_name="groupedorder", name="code", - field=models.CharField(auto_created=True), + field=models.CharField(max_length=256, auto_created=True), ), ] diff --git a/la_chariotte/order/migrations/0030_alter_groupedorder_code_alter_orderauthor_email_and_more.py b/la_chariotte/order/migrations/0030_alter_groupedorder_code_alter_orderauthor_email_and_more.py new file mode 100644 index 0000000..892b4de --- /dev/null +++ b/la_chariotte/order/migrations/0030_alter_groupedorder_code_alter_orderauthor_email_and_more.py @@ -0,0 +1,46 @@ +# Generated by Django 4.2.19 on 2025-03-02 15:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("order", "0029_set_phone_mandatory_for_existing_orders"), + ] + + operations = [ + migrations.AlterField( + model_name="groupedorder", + name="code", + field=models.CharField(auto_created=True, max_length=256), + ), + migrations.AlterField( + model_name="orderauthor", + name="email", + field=models.CharField( + help_text="Pour que l'organisateur·ice vous contacte en cas de besoin", + max_length=256, + verbose_name="Adresse mail", + ), + ), + migrations.AlterField( + model_name="orderauthor", + name="first_name", + field=models.CharField(max_length=256, verbose_name="Prénom"), + ), + migrations.AlterField( + model_name="orderauthor", + name="last_name", + field=models.CharField(max_length=256, verbose_name="Nom"), + ), + migrations.AlterField( + model_name="orderauthor", + name="phone", + field=models.CharField( + help_text="Pour que l'organisateur·ice vous contacte en cas de besoin", + max_length=256, + verbose_name="Numéro de téléphone", + ), + ), + ] diff --git a/la_chariotte/order/models.py b/la_chariotte/order/models.py index 5450f72..fb3b4fe 100644 --- a/la_chariotte/order/models.py +++ b/la_chariotte/order/models.py @@ -25,7 +25,7 @@ class GroupedOrder(models.Model): max_length=100, null=True, blank=True, verbose_name="Lieu de livraison" ) description = models.TextField("Description", null=True, blank=True) - code = models.CharField(auto_created=True) + code = models.CharField(max_length=256, auto_created=True) is_phone_mandatory = models.BooleanField( default=False, verbose_name="Numéro de téléphone obligatoire" ) @@ -101,13 +101,15 @@ class GroupedOrder(models.Model): class OrderAuthor(models.Model): """Used when a user orders (with or without an account)""" - first_name = models.CharField(verbose_name="Prénom") - last_name = models.CharField(verbose_name="Nom") + first_name = models.CharField(max_length=256, verbose_name="Prénom") + last_name = models.CharField(max_length=256, verbose_name="Nom") phone = models.CharField( + max_length=256, verbose_name="Numéro de téléphone", help_text="Pour que l'organisateur·ice vous contacte en cas de besoin", ) email = models.CharField( + max_length=256, verbose_name="Adresse mail", help_text="Pour que l'organisateur·ice vous contacte en cas de besoin", ) diff --git a/la_chariotte/settings.py b/la_chariotte/settings.py index ab6dadc..ab194d3 100644 --- a/la_chariotte/settings.py +++ b/la_chariotte/settings.py @@ -85,8 +85,8 @@ WSGI_APPLICATION = "la_chariotte.wsgi.application" DATABASES = { "default": { - "ENGINE": "django.db.backends.postgresql", - "NAME": os.getenv("DB_NAME", "chariotte"), + "ENGINE": "django.db.backends.sqlite3", + "NAME": os.getenv("DB_NAME", "chariotte.sqlite3"), } }