Package expedient :: Package common :: Package timer :: Module models :: Class JobManager
[hide private]
[frames] | no frames]

Class JobManager

source code


Instance Methods [hide private]
 
schedule_post_syncdb(self, period, callable)
Schedule a new periodic job after syncdb is done.
source code
 
schedule(self, period, callable)
Schedule a new periodic job.
source code
 
unschedule(self, callable)
Removes periodic scheduling of a job.
source code
 
get_for(self, callable)
Get the job corresponding the callable.
source code

Inherited from django.db.models.manager.Manager: __init__, aggregate, all, annotate, complex_filter, contribute_to_class, count, create, dates, db_manager, defer, distinct, exclude, exists, extra, filter, get, get_empty_query_set, get_or_create, get_query_set, in_bulk, iterator, latest, none, only, order_by, raw, reverse, select_related, update, using, values, values_list

Inherited from django.db.models.manager.Manager (private): _copy_to_model, _insert, _set_creation_counter, _update

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from django.db.models.manager.Manager: creation_counter

Properties [hide private]

Inherited from django.db.models.manager.Manager: db

Inherited from object: __class__

Method Details [hide private]

schedule_post_syncdb(self, period, callable)

source code 

Schedule a new periodic job after syncdb is done.

You will need to use this function for scheduling if you are getting errors saying that the time_job table does not exist in the database.

See JobManager.schedule.

schedule(self, period, callable)

source code 

Schedule a new periodic job.

New job will call callable every period seconds. If callable is already registered with another job, this function will raise an JobAlreadyScheduled exception.

This method cannot be used to schedule jobs before syncdb has been done (i.e. for example outside a function context). For that you need to use Job.objects.schedule_post_syncdb. See JobManager.schedule_post_syncdb.

Parameters:
  • period (integer) - time between runs in seconds.
  • callable (Callable) - function to call for executing the job.
Returns:
The new Job instance.
Raises:

unschedule(self, callable)

source code 

Removes periodic scheduling of a job.

Parameters:
  • callable (Callable.) - The callable which was used to schedule the job.
Raises: