Mercurial > kallithea
comparison rhodecode/model/notification.py @ 2109:8ecfed1d8f8b beta
utils/conf
- created temporary utils2
- made config.conf for storing some configurations
- fixed some dependency import problems
- code cleanup
- rc-extensions now properly work for celery
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 07 Mar 2012 02:18:22 +0200 |
parents | 0e27da019f84 |
children | 50aa7cb78cfe |
comparison
equal
deleted
inserted
replaced
2108:9e377342802c | 2109:8ecfed1d8f8b |
---|---|
30 import datetime | 30 import datetime |
31 | 31 |
32 from pylons.i18n.translation import _ | 32 from pylons.i18n.translation import _ |
33 | 33 |
34 import rhodecode | 34 import rhodecode |
35 from rhodecode.config.conf import DATETIME_FORMAT | |
35 from rhodecode.lib import helpers as h | 36 from rhodecode.lib import helpers as h |
36 from rhodecode.model import BaseModel | 37 from rhodecode.model import BaseModel |
37 from rhodecode.model.db import Notification, User, UserNotification | 38 from rhodecode.model.db import Notification, User, UserNotification |
38 | 39 |
39 log = logging.getLogger(__name__) | 40 log = logging.getLogger(__name__) |
174 notification.TYPE_MESSAGE: _('sent message'), | 175 notification.TYPE_MESSAGE: _('sent message'), |
175 notification.TYPE_MENTION: _('mentioned you'), | 176 notification.TYPE_MENTION: _('mentioned you'), |
176 notification.TYPE_REGISTRATION: _('registered in RhodeCode') | 177 notification.TYPE_REGISTRATION: _('registered in RhodeCode') |
177 } | 178 } |
178 | 179 |
179 DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S" | |
180 | |
181 tmpl = "%(user)s %(action)s %(when)s" | 180 tmpl = "%(user)s %(action)s %(when)s" |
182 if show_age: | 181 if show_age: |
183 when = h.age(notification.created_on) | 182 when = h.age(notification.created_on) |
184 else: | 183 else: |
185 DTF = lambda d: datetime.datetime.strftime(d, DATETIME_FORMAT) | 184 DTF = lambda d: datetime.datetime.strftime(d, DATETIME_FORMAT) |