diff --git a/src/internal/forms.py b/src/internal/forms.py index 3bef524aa..bdec85a7f 100644 --- a/src/internal/forms.py +++ b/src/internal/forms.py @@ -7,6 +7,7 @@ from users.models import User from web.widgets import ( SemanticDateInput, + SemanticDateTimeInput, SemanticMultipleSelectInput, SemanticSearchableChoiceInput, ) @@ -192,7 +193,7 @@ class Meta: class QuoteForm(forms.ModelForm): class Meta: model = Quote - fields = ("quote", "quoted", "context", "date") + fields = ("quote", "quoted", "context", "time") widgets = { - "date": SemanticDateInput(), + "time": SemanticDateTimeInput(), } diff --git a/src/internal/migrations/0027_alter_quote_date.py b/src/internal/migrations/0027_alter_quote_date.py new file mode 100644 index 000000000..607b8dbde --- /dev/null +++ b/src/internal/migrations/0027_alter_quote_date.py @@ -0,0 +1,26 @@ +# Generated by Django 4.2.9 on 2025-10-09 15:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("internal", "0026_add_secret_permissions"), + ] + + operations = [ + migrations.RenameField( + model_name="quote", + old_name="date", + new_name="time", + ), + migrations.AlterField( + model_name="quote", + name="time", + field=models.DateTimeField(verbose_name="-time it was said"), + ), + migrations.AlterModelOptions( + name="quote", + options={"ordering": ("-time",)}, + ), + ] diff --git a/src/internal/models.py b/src/internal/models.py index 1f1def10a..b288de62c 100644 --- a/src/internal/models.py +++ b/src/internal/models.py @@ -362,7 +362,7 @@ class Quote(models.Model): help_text=_("The person who is quoted."), ) context = models.TextField(blank=True, max_length=500, verbose_name=_("context")) - date = models.DateField(verbose_name=_("date")) + time = models.DateTimeField(verbose_name=_("time it was said")) author = models.ForeignKey( to=User, on_delete=models.CASCADE, @@ -371,7 +371,7 @@ class Quote(models.Model): ) class Meta: - ordering = ("-date",) + ordering = ("-time",) def __str__(self): return _("“{quote}” —{quoted}").format(quote=self.quote, quoted=self.quoted) diff --git a/src/internal/templates/internal/quote_list.html b/src/internal/templates/internal/quote_list.html index 433536ffa..9d4383e2e 100644 --- a/src/internal/templates/internal/quote_list.html +++ b/src/internal/templates/internal/quote_list.html @@ -43,7 +43,7 @@