zakird/celerybeat-mongo — pull request #9 by noirbizarre (2014-08-25 08:35:23+00:00)
Title: Fix model

This PR fix the unbound reference to gettext (removed).

It allows to subclass ``PeriodicTask.Crontab`` and ``PeriodicTask.Interval`` making possible to override the ``__unicode__`` yourself and write:
```python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from celerybeatmongo.models import PeriodicTask as BasePeriodicTask
from i18n import lazy_gettext as _

__all__ = ('PeriodicTask', )

class PeriodicTask(BasePeriodicTask):
class Interval(BasePeriodicTask.Interval):
def __unicode__(self):
if self.every == 1:
return _('every {0.period_singular}').format(self)
return _('every {0.every} {0.period}').format(self)
```