Mercurial > public > sg101
comparison gpp/messages/management/commands/purge_messages.py @ 518:5171a5e9353b
For #194, add a celery task for purging deleted private messages.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 16 Dec 2011 01:17:35 +0000 |
parents | dbd703f7d63a |
children |
comparison
equal
deleted
inserted
replaced
517:666147a2cc08 | 518:5171a5e9353b |
---|---|
1 """ | 1 """ |
2 purge_messages is a custom manage.py command for the messages application. | 2 purge_messages is a custom manage.py command for the messages application. |
3 It is intended to be called from a cron job to purge messages that have been | 3 It is intended to be called from a cron job to purge messages that have been |
4 deleted by both sender and receiver. | 4 deleted by both sender and receiver. |
5 """ | 5 """ |
6 | 6 |
7 from django.core.management.base import NoArgsCommand | 7 from django.core.management.base import NoArgsCommand |
14 | 14 |
15 def handle_noargs(self, **options): | 15 def handle_noargs(self, **options): |
16 Message.objects.filter(sender_delete_date__isnull=False, | 16 Message.objects.filter(sender_delete_date__isnull=False, |
17 receiver_delete_date__isnull=False).delete() | 17 receiver_delete_date__isnull=False).delete() |
18 | 18 |
19 | |
20 # vim: ts=4 sw=4 |