Omkar008 commited on
Commit
6a48853
1 Parent(s): a6d429f

Update models/models.py

Browse files
Files changed (1) hide show
  1. models/models.py +8 -6
models/models.py CHANGED
@@ -2,26 +2,28 @@ import json
2
  from typing import Optional, List, Dict
3
 
4
  class Attachment:
5
- def __init__(self, filename: str, data: str,attachment_len:int):
 
6
  self.filename = filename
7
  self.data = data
8
- self.attachment_len = attachment_len
9
 
10
 
11
 
12
  class Message:
13
- def __init__(self, message_id: str, body: Optional[str], attachments: Optional[List[Attachment]], company: str , body_len:int):
14
  self.id = message_id
 
15
  self.body = body
16
  self.attachments = attachments
17
  self.company = company
18
- self.body_len = body_len
19
 
20
  def to_json(self):
21
  return {
22
  "id": self.id,
 
23
  "body": self.body,
24
  "attachments": [attachment.__dict__ for attachment in self.attachments] if self.attachments else None,
25
- "company": self.company,
26
- "body_len" : self.body_len,
27
  }
 
2
  from typing import Optional, List, Dict
3
 
4
  class Attachment:
5
+ def __init__(self, attachment_len:int,filename: str, data: str):
6
+ self.attachment_len = attachment_len
7
  self.filename = filename
8
  self.data = data
9
+
10
 
11
 
12
 
13
  class Message:
14
+ def __init__(self, message_id: str, body_len:int, body: Optional[str], attachments: Optional[List[Attachment]], company: str ):
15
  self.id = message_id
16
+ self.body_len = body_len
17
  self.body = body
18
  self.attachments = attachments
19
  self.company = company
20
+
21
 
22
  def to_json(self):
23
  return {
24
  "id": self.id,
25
+ "body_len" : self.body_len,
26
  "body": self.body,
27
  "attachments": [attachment.__dict__ for attachment in self.attachments] if self.attachments else None,
28
+ "company": self.company
 
29
  }