Changeset 136:bfdb6e432cb8 for mailer/sender.py
- Timestamp:
- 07/05/07 15:23:03 (17 months ago)
- Files:
-
- 1 modified
-
mailer/sender.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mailer/sender.py
r134 r136 34 34 return res.last_inserted_ids()[0] 35 35 36 def mail_status(mail_id ):36 def mail_status(mail_id=None): 37 37 """getting mail status""" 38 def _small(mail): 39 return {'subject': mail.subject, 'date': mail.date, 40 'status': mail.status} 41 42 if mail_id is None: 43 return [_small(mail) for mail in 44 mailed_data.select().execute()] 45 38 46 res = mailed_data.select().execute(original_id=mail_id).fetchall() 39 47 if len(res) == 0: 40 48 # still in queue 41 return 'processing'49 return u'processing' 42 50 return res[0].status 43 51 52 def mail_queue_size(): 53 """return the queue size""" 54 return len(mail_data.select().execute().fetchall()) 55
