|
|
|
@ -17,13 +17,16 @@ def upload_file(original=None, name=None, base64=None) -> File: |
|
|
|
return new_file |
|
|
|
return new_file |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def add_comment(text: str, email: str, files=[]) -> Comment: |
|
|
|
def add_comment(text: str, email: str, files=None) -> Comment: |
|
|
|
""" |
|
|
|
""" |
|
|
|
:param text: sting |
|
|
|
:param text: sting |
|
|
|
:param email: string |
|
|
|
:param email: string |
|
|
|
:param files: {name?: string, original?: File, base64?: string}[] одно из двух последних свойств должно быть указано |
|
|
|
:param files: {name?: string, original?: File, base64?: string}[] одно из двух последних свойств должно быть указано |
|
|
|
:return: Comment |
|
|
|
:return: Comment |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
files = [] if files is None else files |
|
|
|
|
|
|
|
|
|
|
|
key = ''.join(random.choice(string.ascii_letters) for _x in range(15)) |
|
|
|
key = ''.join(random.choice(string.ascii_letters) for _x in range(15)) |
|
|
|
comment = Comment.objects.create( |
|
|
|
comment = Comment.objects.create( |
|
|
|
text=text, |
|
|
|
text=text, |
|
|
|
|