]> git.parisson.com Git - teleforma.git/commitdiff
Add fifpl field to conference model dev-0888
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 17 Feb 2025 08:42:23 +0000 (09:42 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 17 Feb 2025 08:42:23 +0000 (09:42 +0100)
teleforma/migrations/0023_conference_fif_pl.py [new file with mode: 0644]
teleforma/models/core.py

diff --git a/teleforma/migrations/0023_conference_fif_pl.py b/teleforma/migrations/0023_conference_fif_pl.py
new file mode 100644 (file)
index 0000000..9cbc266
--- /dev/null
@@ -0,0 +1,18 @@
+# Generated by Django 3.2.23 on 2025-02-13 16:08
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('teleforma', '0022_seminar_fif_pl'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='conference',
+            name='fif_pl',
+            field=models.BooleanField(default=False, verbose_name='Eligible FIF-PL'),
+        ),
+    ]
index dcca11f050034d5867881d18cc1577fba924b7d6..e663087c762d57c2998aa49a59ae19df1ce1a0f5 100755 (executable)
@@ -910,6 +910,7 @@ class WebclassMixin(Model):
 
 class Conference(Displayable, WebclassMixin, ProductCodeMixin, SuggestionsMixin):
 
+    fif_pl          = models.BooleanField(_('Eligible FIF-PL'), default=False)
     new             = models.BooleanField(_('Nouveau'), default=False)
     private         = models.BooleanField(_('private'), help_text="Hide in shop", default=False)
     upcoming        = models.BooleanField("A venir (shop)", default=False)
@@ -1040,6 +1041,12 @@ class Conference(Displayable, WebclassMixin, ProductCodeMixin, SuggestionsMixin)
         Get a displayable title
         """
         return "%s : %s" % (self.title, date(self.date_begin, "DATE_FORMAT"))
+    
+    @property
+    def hours(self):
+        if self.duration:
+            return self.duration.as_seconds() // 3600
+        return 0
 
 
     def public_url(self):