From 6c24b00fe3fd0c6d336c5ec351c2008a60d3c0f0 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Tue, 27 Feb 2024 19:01:31 +1100 Subject: [PATCH] fossy: Add created_time to CommunityTrackProposal model Also move templates into app. --- conservancy/fossy/admin.py | 3 +-- ...003_communitytrackproposal_created_time.py | 20 +++++++++++++++++++ conservancy/fossy/models.py | 1 + .../{ => fossy}/templates/fossy/base.html | 0 .../fossy/community_track_proposal_form.html | 0 .../{ => fossy}/templates/fossy/thanks.html | 0 6 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 conservancy/fossy/migrations/0003_communitytrackproposal_created_time.py rename conservancy/{ => fossy}/templates/fossy/base.html (100%) rename conservancy/{ => fossy}/templates/fossy/community_track_proposal_form.html (100%) rename conservancy/{ => fossy}/templates/fossy/thanks.html (100%) diff --git a/conservancy/fossy/admin.py b/conservancy/fossy/admin.py index 0322b63a..e0ed9fbd 100644 --- a/conservancy/fossy/admin.py +++ b/conservancy/fossy/admin.py @@ -5,5 +5,4 @@ from .models import CommunityTrackProposal @admin.register(CommunityTrackProposal) class CommunityTrackProposalAdmin(admin.ModelAdmin): - list_display = ['title', 'primary_proposer'] - pass + list_display = ['created_time', 'title', 'primary_proposer'] diff --git a/conservancy/fossy/migrations/0003_communitytrackproposal_created_time.py b/conservancy/fossy/migrations/0003_communitytrackproposal_created_time.py new file mode 100644 index 00000000..b18184b6 --- /dev/null +++ b/conservancy/fossy/migrations/0003_communitytrackproposal_created_time.py @@ -0,0 +1,20 @@ +# Generated by Django 3.2.19 on 2024-02-27 02:56 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fossy', '0002_auto_20230130_1841'), + ] + + operations = [ + migrations.AddField( + model_name='communitytrackproposal', + name='created_time', + field=models.DateTimeField(auto_now_add=True, default=datetime.datetime(2023, 3, 19, 0, 0)), + preserve_default=False, + ), + ] diff --git a/conservancy/fossy/models.py b/conservancy/fossy/models.py index a6936cbf..289de1e3 100644 --- a/conservancy/fossy/models.py +++ b/conservancy/fossy/models.py @@ -4,6 +4,7 @@ from django.db import models class CommunityTrackProposal(models.Model): + created_time = models.DateTimeField(auto_now_add=True) uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) title = models.CharField('Track title', max_length=255) description = models.TextField( diff --git a/conservancy/templates/fossy/base.html b/conservancy/fossy/templates/fossy/base.html similarity index 100% rename from conservancy/templates/fossy/base.html rename to conservancy/fossy/templates/fossy/base.html diff --git a/conservancy/templates/fossy/community_track_proposal_form.html b/conservancy/fossy/templates/fossy/community_track_proposal_form.html similarity index 100% rename from conservancy/templates/fossy/community_track_proposal_form.html rename to conservancy/fossy/templates/fossy/community_track_proposal_form.html diff --git a/conservancy/templates/fossy/thanks.html b/conservancy/fossy/templates/fossy/thanks.html similarity index 100% rename from conservancy/templates/fossy/thanks.html rename to conservancy/fossy/templates/fossy/thanks.html