예제 #1
0
 def __create__(cls, user, title, message, category, event_uuid, icon=None):
     ''' Create a notification and save it to the database '''
     notification = Notification(
         user_id=user.id,
         event_uuid=event_uuid,
         title=unicode(title),
         message=unicode(message),
         category=category,
     )
     if icon is not None:
         notification.icon = icon
     dbsession.add(notification)
     dbsession.commit()
예제 #2
0
 def __create__(cls, user, title, message, category, event_uuid, icon=None):
     ''' Create a notification and save it to the database '''
     notification = Notification(
         user_id=user.id,
         event_uuid=event_uuid,
         title=unicode(title),
         message=unicode(message),
         category=category,
     )
     if icon is not None:
         notification.icon = icon
     dbsession.add(notification)
     dbsession.commit()
예제 #3
0
 def __anonymous__(cls, title, message, category, event_uuid, icon=None):
     ''' Creates anonysmous notification where user_id = NULL '''
     notification = Notification(
         user_id=None,
         event_uuid=event_uuid,
         title=unicode(title),
         message=unicode(message),
         category=category,
     )
     if icon is not None:
         notification.icon = icon
     dbsession.add(notification)
     dbsession.commit()
예제 #4
0
 def __anonymous__(cls, title, message, category, event_uuid, icon=None):
     ''' Creates anonysmous notification where user_id = NULL '''
     notification = Notification(
         user_id=None,
         event_uuid=event_uuid,
         title=unicode(title),
         message=unicode(message),
         category=category,
     )
     if icon is not None:
         notification.icon = icon
     dbsession.add(notification)
     dbsession.commit()