group = db.ReferenceProperty(Group) class IssueProjectURL(Base): issue = db.ReferenceProperty(Issue) project_url = db.ReferenceProperty(ProjectURL) status = db.StringProperty(required=False) def get_status_image(self): return { "not_fixed": "not-fixed", "fixed": "fixed" }.get(self.status, "") def get_status_display(self): from issues.forms import issue_project_url_statuses return dict(issue_project_url_statuses).get(self.status) def __str__(self): return str(self.project_url) class Log(Base): timestamp = db.DateTimeProperty() issue = db.ReferenceProperty(Issue) text = db.TextProperty() creator = db.ReferenceProperty(User) from notifications import registry registry.register(Issue, "Issue")
from notifications import registry from notifications.dispatch import Sender from django.utils.translation import ugettext_noop as _ registry.register('questions') notifier = Sender({ 'create_topic': _("{{target.asker.nickname}} asks a question " "[{{target.title}}]({{url}}). "), 'update_topic': _("{{target.asker.nickname}} updates the question " "[{{target.title}}]({{url}}). "), "open_topic": _("{{target.asker.nickname}} opens the question " "[{{target.title}}]({{url}}). "), "close_topic": _("{{target.asker.nickname}} closes the question " "[{{target.title}}]({{url}}). "), 'create_reply': _("{{target.author.nickname}} posts a" " reply on [{{target.topic.title}}]({{url}})."), }, module='questions')
if self.server: strng = "%s on server %s" % (strng, self.server) elif self.raw: strng = self.raw else: strng = self.error_timestamp.isoformat() if self.uid: strng = "%s" % (strng) return strng @property def description(self): return self.msg or "" def save(self, *args, **kw): created = not getattr(self, "id", None) self.put() if created and not "dont_send_signals" in kw: if os.environ.get('SERVER_SOFTWARE', '').startswith('Dev'): # send the signal, otherwise we have to clicking buttons # to process the queue from error.views import send_signal send_signal(None, self.id) else: # enqueue the send notification # if development taskqueue.add(url=reverse("error-created", args=[self.id,])) from notifications import registry registry.register(Error, "Error")
class IssueProjectURL(Base): issue = db.ReferenceProperty(Issue) project_url = db.ReferenceProperty(ProjectURL) status = db.StringProperty(required=False) def get_status_image(self): return { "not_fixed": "not-fixed", "fixed": "fixed" }.get(self.status, "") def get_status_display(self): from issues.forms import issue_project_url_statuses return dict(issue_project_url_statuses).get(self.status) def __str__(self): return str(self.project_url) class Log(Base): timestamp = db.DateTimeProperty() issue = db.ReferenceProperty(Issue) text = db.TextProperty() creator = db.ReferenceProperty(User) from notifications import registry registry.register(Issue, "Issue")
strng = self.raw else: strng = self.error_timestamp.isoformat() if self.uid: strng = "%s" % (strng) return strng @property def description(self): return self.msg or "" def save(self, *args, **kw): created = not getattr(self, "id", None) self.put() if created and not "dont_send_signals" in kw: if os.environ.get('SERVER_SOFTWARE', '').startswith('Dev'): # send the signal, otherwise we have to clicking buttons # to process the queue from error.views import send_signal send_signal(None, self.id) else: # enqueue the send notification # if development taskqueue.add(url=reverse("error-created", args=[ self.id, ])) from notifications import registry registry.register(Error, "Error")