This website works better with JavaScript.
Home
Explore
Sign In
miteruzo
/
nizika_nico
Watch
1
Star
0
Fork
0
Code
Issues
4
Pull Requests
0
Releases
0
Wiki
Activity
Labels
Milestones
New Pull Request
#23
追跡対象動画バルク UPSERT (#22)
Merged
みてるぞ
merged 3 commits from
feature/022
into
main
1 week ago
Conversation
0
Commits
3
Files Changed
2
2 changed files
with
25 additions
and
0 deletions
Whitespace
Show all changes
Ignore whitespace when comparing lines
Ignore changes in amount of whitespace
Ignore changes in whitespace at EOL
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+6
-0
db/models.py
+19
-0
tracked_videos/put_bulk_upsert.py
+ 6
- 0
db/models.py
View File
@@ -64,6 +64,12 @@ class TrackedVideo (Model):
__timestamps__ = False
def upsert (
self,
*args: str,
) -> None:
super ().upsert ('code')
class User (Model):
id: int
+ 19
- 0
tracked_videos/put_bulk_upsert.py
View File
@@ -0,0 +1,19 @@
import sys
from db.config import DB
from db.models import TrackedVideo
DB
def main (
video_codes: list[str],
) -> None:
for code in video_codes:
tv = TrackedVideo ()
tv.code = code
tv.upsert ()
if __name__ == '__main__':
main (sys.argv[1:])
Write
Preview
Loading…
Cancel
Save