1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 19:01:42 +00:00

Add index

This commit is contained in:
xiez
2012-06-26 16:29:15 +08:00
parent 5b39f73488
commit df4ac6ab02
2 changed files with 3 additions and 4 deletions

View File

@@ -6,8 +6,7 @@ from seahub.notifications.models import UserNotification
def grpmsg_added_cb(sender, **kwargs): def grpmsg_added_cb(sender, **kwargs):
group_id = kwargs['group_id'] group_id = kwargs['group_id']
from_email = kwargs['from_email'] from_email = kwargs['from_email']
l = UserNotification.objects.filter(msg_type='group_msg', l = UserNotification.objects.filter(msg_type='group_msg', detail=group_id)
detail=group_id)
if len(l) == 0: if len(l) == 0:
group_members = ccnet_threaded_rpc.get_group_members(int(group_id)) group_members = ccnet_threaded_rpc.get_group_members(int(group_id))
for m in group_members: for m in group_members:

View File

@@ -6,8 +6,8 @@ class Notification(models.Model):
primary = models.BooleanField(default=False) primary = models.BooleanField(default=False)
class UserNotification(models.Model): class UserNotification(models.Model):
to_user = models.EmailField(max_length=255) to_user = models.EmailField(db_index=True, max_length=255)
msg_type = models.CharField(max_length=30) msg_type = models.CharField(db_index=True, max_length=30)
detail = models.TextField() detail = models.TextField()
class NotificationForm(ModelForm): class NotificationForm(ModelForm):