diff --git a/src/fellchensammlung/migrations/0039_alter_rescueorganization_last_checked.py b/src/fellchensammlung/migrations/0039_alter_rescueorganization_last_checked.py new file mode 100644 index 0000000..7813595 --- /dev/null +++ b/src/fellchensammlung/migrations/0039_alter_rescueorganization_last_checked.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2025-03-09 16:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fellchensammlung', '0038_rescueorganization_last_checked'), + ] + + operations = [ + migrations.AlterField( + model_name='rescueorganization', + name='last_checked', + field=models.DateTimeField(auto_now_add=True, verbose_name='Datum der letzten Prüfung'), + ), + ] diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index 7c44057..ac18e2a 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -122,7 +122,7 @@ class RescueOrganization(models.Model): website = models.URLField(null=True, blank=True, verbose_name=_('Website')) updated_at = models.DateTimeField(auto_now=True) created_at = models.DateTimeField(auto_now_add=True) - last_checked = models.DateTimeField(verbose_name=_('Datum der letzten Prüfung')) + last_checked = models.DateTimeField(auto_now_add=True, verbose_name=_('Datum der letzten Prüfung')) internal_comment = models.TextField(verbose_name=_("Interner Kommentar"), null=True, blank=True, ) description = models.TextField(null=True, blank=True, verbose_name=_('Beschreibung')) # Markdown allowed external_object_identifier = models.CharField(max_length=200, null=True, blank=True, @@ -161,6 +161,10 @@ class RescueOrganization(models.Model): time_since_last_checked = timezone.now() - self.last_checked return time_since_as_hr_string(time_since_last_checked) + @property + def species_urls(self): + return SpeciesSpecificURL.objects.filter(organization=self) + # Admins can perform all actions and have the highest trust associated with them # Moderators can make moderation decisions regarding the deletion of content