Beispiel #1
0
 def insert_comment(self, serializer, comment_text, user_id, callback):
     comment = Comments()
     comment.comment_text = comment_text
     comment.added_dt = datetime.datetime.now()
     comment.user_leaving_commit = User.objects.get(pk=user_id)
     comment.save()
     data = serializers.serialize(serializer, comment)
     callback(data)
Beispiel #2
0
 def add_comment_to_sgdt(self, serializer, suggested_date_id, comment_text, user_id, callback):
     comment = Comments()
     comment.added_dt = datetime.datetime.now()
     comment.comment_text = comment_text
     comment.user_leaving_commit = User.objects.get(pk=user_id)
     comment.save()
     suggested_date = SuggestedDate.objects.get(pk=suggested_date_id)
     suggested_date.comments.add(comment)
     data = serializers.serialize(serializer, suggested_date)
     callback(data)