Skip to content

Back/now people - #29

Merged
marbou090 merged 6 commits into
developfrom
back/NowPeople
Dec 16, 2020
Merged

marbou090 merged 6 commits into
developfrom
back/NowPeople

Conversation

@Sorasky4

Copy link
Copy Markdown
Contributor

postで受け取ったデータをDBに格納し、getで現在の状況(location_idと直近5分で検知した人数)をjsonで返すapiを実装した。

@marbou090 marbou090 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメント書いたのでよろぴくみん

Comment thread back/now_people.py Outdated
@@ -0,0 +1,16 @@
import datetime
from database import *

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import database
database.beacon_data

みたいな書き方でもよいかなと(明示的だから)思うのだけどどうでしょう
sqlの部分に関わるからこういう書き方にしてるんです??

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from database import * は database.pyの中にもっと関数があったときの名残です。
now_people.py内でdatabase.pyから読み込んで使っているものは
for r in db.session.execute(t): のdbという部分だけなので、変更を加えるなら
import database
for r in database.db.session.execute(t):
もしくは
from database import db
にするかの2択になると思います。
sql文の中のbeacon_dataという記述はdatabase.pyのbeacon_dataクラスとは関係ありません。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from database import db
のほうがdbがどこの子なのか明確にわかるのでここの部分だけ変えてもう一度pushしてもらえると嬉しいですー

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正してpushしましたー

Comment thread back/requirements.txt
@@ -1,3 +1,6 @@
Flask

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コンフリクトしてたので殺しました。さよなら
R.I.P Flask
good bye forever....

@marbou090 marbou090 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 ぴくみん

Comment thread back/now_people.py Outdated
@@ -0,0 +1,16 @@
import datetime
from database import *

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from database import db
のほうがdbがどこの子なのか明確にわかるのでここの部分だけ変えてもう一度pushしてもらえると嬉しいですー

@marbou090 marbou090 linked an issue Dec 16, 2020 that may be closed by this pull request
@marbou090

Copy link
Copy Markdown
Contributor

nice!

@marbou090 marbou090 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good!!

@marbou090
marbou090 merged commit 2ee7ef0 into develop Dec 16, 2020
@marbou090 marbou090 linked an issue Dec 17, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[back]現在の状況を返すAPI [fragment_home]リアルタイムでの混雑状況

2 participants