def notify(self, job): with connection.cursor() as cur: cur.execute('NOTIFY "{}", %s;'.format(self.notify_channel), [str(job.pk)])