-
Notifications
You must be signed in to change notification settings - Fork 1
Issue/57 update top image schema #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
kathmandu777
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
よろしくおねがいします。
| cls, | ||
| request: Request, | ||
| id: str, | ||
| text_messages_limit: int, | ||
| image_messages_limit: int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatterの修正が環境によってずれることあるかな?
| image = Image.open(io.BytesIO(image_binary)).convert("RGB") | ||
| image_io = io.BytesIO() | ||
| image_name = "top_image.jpeg" | ||
| image.save(image_io, format="JPEG") | ||
| image_file = InMemoryUploadedFile(image_io, field_name=None, name=image_name, | ||
| content_type="image/jpeg", size=image_io.getbuffer().nbytes, | ||
| charset=None) | ||
| project.top_image = image_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
未検証
かなり回りくどい実装っぽいけどとりあえずいいや
# TODO: 簡略化
みたいなこめんとあるといいかも
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK!
fastapi/app/models/project.py
Outdated
| return random.choice(spotify_uri_candidates) | ||
|
|
||
|
|
||
| def upload_to_top_image(instance: "Project", filename: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instance -> project
でいいと思うけどどうでしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
んーーどういうことかいまいちわかってないかも..
Overview
お気持ち: top imageの値をimage_messageと同じ感じにしたい
動作確認済み
Issue number
Close #57
How to check the revision
Points for Review
Remarks
急いで書いたから, 細かいところまで配慮できてないかも...
余裕があったらみてほしい