Guys, I'm trying to create a loop to send notification by dango-notification for all new posts. What i'd like to do is send a notification for the posts added after the last visit of the members. Phrased otherwise I just want to send (update) users about new posts, not about old ones. Users read notifications automatically when logged in.
My attempts: 1) From http://docs.djangoproject.com/en/1.0/ref/models/querysets/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none a = blog.item d = User.objects.all d = user.last_login q = Post.objects.extra(select={'is_recent': "created_at < '2006-01-01'"}) for a in q.filter(item=a): notification.send(User.objects.all(), "blog_post_match", {"post": blog}) This fails, it ignores the created_at < '2006-01-01' at all and sends the notification. The idea was to alter this to created_at > d 2) As described here http://docs.djangoproject.com/en/1.0/ref/models/querysets/#in a = blog.item d = User.objects.all d = user.last_login inner_qs = User.objects.all().values('last_login').query entries = Post.objects.filter(created_at=inner_qs) for a in entries.filter(item=a): notification.send(User.objects.all(), "blog_post_match", {"post": blog})) This results in Exception Type: IndexError at /blog/new/ Exception Value: tuple index out of range Secondly it's impossible to filter(created_at>inner_qs) Any suggestions about a constructive way to send notifications after adding a new post? With notification and not with RSS.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.