dduk-ddak / coding-night-live

Web-based Communication Application for Codelabs
Other
62 stars 11 forks source link

refactoring for ChatAndReply methods #97

Closed juice500ml closed 7 years ago

juice500ml commented 7 years ago

https://github.com/dduk-ddak/coding-night-live/blob/master/manage_chat/models.py#L128

        final_msg = {'chat': label, 'description': message, 'time': str(self.time.strftime("%Y-%m-%d %H:%M:%S")), 'is_reply': self.is_reply, 'hash_value': str(self.hash_value)[:20]}

-->

        final_msg = {'chat': self.is_reply.label, 'description': self.description, 'time': self.time, 'is_reply': self.is_reply, 'hash_value': str(self.hash_value)[:20]}

No need for calculate time twice!

taeseunglee commented 7 years ago

label의 경우에는 self.room.label에 존재해서 self.room.label로 고칩니다. @juice500ml 그리고 라인이 너무 길어서

a = {
    hi,
    hello
}

와 같은 꼴로 수정하겠습니다