feat: Auto add now the date oflast checked
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
1b5a0c71e0
commit
9ae64e8cb1
@ -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'),
|
||||||
|
),
|
||||||
|
]
|
@ -122,7 +122,7 @@ class RescueOrganization(models.Model):
|
|||||||
website = models.URLField(null=True, blank=True, verbose_name=_('Website'))
|
website = models.URLField(null=True, blank=True, verbose_name=_('Website'))
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
created_at = models.DateTimeField(auto_now_add=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, )
|
internal_comment = models.TextField(verbose_name=_("Interner Kommentar"), null=True, blank=True, )
|
||||||
description = models.TextField(null=True, blank=True, verbose_name=_('Beschreibung')) # Markdown allowed
|
description = models.TextField(null=True, blank=True, verbose_name=_('Beschreibung')) # Markdown allowed
|
||||||
external_object_identifier = models.CharField(max_length=200, null=True, blank=True,
|
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
|
time_since_last_checked = timezone.now() - self.last_checked
|
||||||
return time_since_as_hr_string(time_since_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
|
# Admins can perform all actions and have the highest trust associated with them
|
||||||
# Moderators can make moderation decisions regarding the deletion of content
|
# Moderators can make moderation decisions regarding the deletion of content
|
||||||
|
Loading…
x
Reference in New Issue
Block a user