Ignore:
Timestamp:
07/15/10 19:22:52 (22 months ago)
Author:
dart
Message:

Loreality:
o First JSON communication

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loreality/loreality/controllers/messager.py

    r2112 r2113  
    7272 
    7373        messages = pilot.messages  
    74         buf = "" 
     74        res = { 'messages':[] } 
     75 
    7576 
    7677        for m in messages: 
    77             buf += "%(date)s#%(from_)s#%(subject)s|"%m.__dict__ 
    78         if buf: 
    79             buf = buf[:-1] 
    80         return buf 
     78            p = pilot_q.filter_by(id=m.from_).first() 
     79            res['messages'].append({ 'date': m.date.strftime("%c"), 'from':p.name, 'subject':m.subject }) 
     80        return res 
    8181    #-------------------------------------------------------------- 
    8282    def getmsg(self, id): 
Note: See TracChangeset for help on using the changeset viewer.