diff options
Diffstat (limited to 'jsonfactory.py')
| -rw-r--r-- | jsonfactory.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/jsonfactory.py b/jsonfactory.py index be70996..6703ef2 100644 --- a/jsonfactory.py +++ b/jsonfactory.py @@ -2,15 +2,18 @@ import json class JSONFactory(object): + running_id = 1 + @staticmethod def make_object(text, user, timestamp, ip): message = json.dumps({ + "id": JSONFactory.running_id, "text": text, "user": user, "timestamp": timestamp, "ip": ip }) - + JSONFactory.running_id += 1 return message @staticmethod |
