qrurls/models.py
changeset 63 9d1184cdbd16
parent 56 96e1c616a955
child 66 8ca335eab457
--- a/qrurls/models.py	Sat Aug 31 19:05:10 2013 +0300
+++ b/qrurls/models.py	Sat Aug 31 19:11:37 2013 +0300
@@ -46,6 +46,8 @@
             help_text="Changing this will break existing QR-codes!")
     publishing_time = models.TimeField(default=datetime.time(),
             help_text="Default time to publish new URLItems (in timezone)")
+    publishing_days = models.IntegerField(default=1,
+            help_text="Default interval for publishing new URLItems")
     title = models.CharField(max_length=1024, blank=True, null=True,
             help_text="Text to display together with images.")
 
@@ -111,8 +113,9 @@
         """publishing_time, with tzinfo on the correct timezone."""
         return self.publishing_time.replace(tzinfo=timezone.get_current_timezone())
     
-    # XXX: hardcoded for now
-    publishing_offset = datetime.timedelta(days=1)
+    @property
+    def publishing_offset (self) :
+        return datetime.timedelta(days=self.publishing_days)
 
     def publishing_schedule (self) :
         """Calculate initial URLItem.published values for feed."""