Sorry I posted a older/bugged version, here goes the right one, inside
the run function:

 def run(self, wait=True):
        if not self.disabled:
            if not self.check_is_running() and self.is_due():
                if self.end_run and self.end_run < self.next_run:
                    self.disabled = True #could also delete
                    self.save()
                else:
                        p = subprocess.Popen(['python', get_manage_py(),
'run_job', str(self.pk)])
                        if wait:
                            p.wait()
                        return p
        return None

On 30 mar, 16:45, Tim Daniel <redarrow...@hotmail.com> wrote:
> Well I've implemented the UNTIL functionality by myself adding a field
> end_run in models.py:
>
> end_run = models.DateTimeField(_("end run"), blank=True, null=True,
> help_text=_("If you don't set this the job will be running
> eternally"))
>
> Later in the handle_run function where te next_run is calculated I
> added this (last three lines):
>
>         if self.force_run:
>             self.force_run = False
>         else:
>                         self.next_run = self.rrule.after(run_date)
>                         if self.end_run:
>                             if self.end_run > self.next_run:
>                                 self.disabled = True #Could also delete
>
> It's a workaround and the ideal solution would have been passing this
> as a param to the rrule, but it works and it's simple.
>
> On 29 mar, 18:48, Tim Daniel <redarrow...@hotmail.com> wrote:
>
> > Hi there,
>
> > I've tried to contact with the people related to the django-
> > chronograph project, but without success.
>
> > When you create a new job there is a field called Params, there you
> > should be able to specify when your job is run following the rrule
> > rules.
> > So the only parameter that seems to work is the one given in the
> > example, interval. Now I want to know if somebody has figured out how
> > to specify all the other parameters, overall DTSTART and UNTIL. To
> > specify when the job should start, but more important, when it should
> > stop. Because you can tell the application when to start using other
> > fields(first run) but there is no way to fix the until param.
>
> > "Comma-separated list of rrule parameters. e.g: interval:15"
>
> > Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to