Changeset 1371
- Timestamp:
- 12/23/10 12:49:11 (17 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
HelpIM3/branches/chatgroups/HelpIM/chatgroup/pages/ChatLog.py
r1370 r1371 3 3 from HelpIM.chat.db.databaseMetadata import ChatConversation 4 4 import datetime 5 from string import split 5 6 6 7 class Handler(EditPanel): … … 13 14 self.chatConv_DataElements = {'ChatgroupMeeting' : ['conv_id', 14 15 'conv_start_time', 15 'conv_messages'], 16 'conv_messages', 17 'chat_lines_total', 18 'chat_words_total'], 16 19 'ChatMessage' : ['conv_msg_id', 17 20 'conv_msg_time', … … 55 58 } 56 59 57 chat_conv_detail_panel = { 'detail_Panel': [ { 'panelName': 'Gesprek', 58 'panelText': "Algemene gegevens", 59 'dataTable': 'ChatgroupMeeting', 60 }, 61 [ chat_conv_id, 62 chat_conv_start_time 63 ] 64 ] 65 } 60 chat_conv_detail_panel = { 61 'detail_Panel': [ 62 { 63 'panelName': 'Gesprek', 64 'panelText': "Algemene gegevens", 65 'dataTable': 'ChatgroupMeeting', 66 }, 67 [ 68 chat_conv_id, 69 chat_conv_start_time, 70 {'detail_field': [[{'label': [{'name': 'Lines Total'}]}, 71 {'data_text': [{'valueTable': 'ChatgroupMeeting', 72 'valueAttr': 'chat_lines_total'}]} 73 ]]}, 74 {'detail_field': [[{'label': [{'name': 'Words Total'}]}, 75 {'data_text': [{'valueTable': 'ChatgroupMeeting', 76 'valueAttr': 'chat_words_total'}]} 77 ]]}, 78 ] 79 ] 80 } 66 81 67 82 … … 108 123 chat = self.site.getChatgroupMeetingById(self.site, self.getParam('conv_id')) 109 124 110 self.dbg('*')111 for msg in chat.conv_messages:112 self.log.debug(msg.conv_msg_text)113 114 125 chatData = self.site.pythonObjectAsTuple( 115 126 chat, 116 127 self.chatConv_DataElements, 117 128 escape=['conv_Question_answerText']) 129 130 chatData['ChatgroupMeeting'][0]['chat_lines_total'] = len(chat.conv_messages) 131 chat_words_total = 0 132 for msg in chat.conv_messages: 133 chat_words_total = chat_words_total + len(split(msg.conv_msg_text)) 134 chatData['ChatgroupMeeting'][0]['chat_words_total'] = chat_words_total 118 135 119 136 self.dbg(chatData)
