Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ITKY2102 tp8 backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ITKY210x-kurssit
ITKY2102 tp8 backend
Commits
b059f5b1
Commit
b059f5b1
authored
1 week ago
by
osklahti
Browse files
Options
Downloads
Patches
Plain Diff
k2025r1 hyödyllisiksi koetut muutokset
parent
faa255d3
Branches
main
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
alusta.py
+1
-1
1 addition, 1 deletion
alusta.py
tyopaja.py
+2
-0
2 additions, 0 deletions
tyopaja.py
with
3 additions
and
1 deletion
alusta.py
+
1
−
1
View file @
b059f5b1
...
@@ -26,6 +26,6 @@ for paiva in data["MenusForDays"]:
...
@@ -26,6 +26,6 @@ for paiva in data["MenusForDays"]:
con
.
commit
()
con
.
commit
()
# luodaan myös tykkäyksille oma taulu
# luodaan myös tykkäyksille oma taulu
cur
.
execute
(
"
CREATE TABLE tykkaykset(id integer primary key, ruokaid)
"
)
cur
.
execute
(
"
CREATE TABLE tykkaykset(id integer primary key, ruokaid
integer
)
"
)
con
.
commit
()
con
.
commit
()
con
.
close
()
con
.
close
()
This diff is collapsed.
Click to expand it.
tyopaja.py
+
2
−
0
View file @
b059f5b1
...
@@ -18,6 +18,8 @@ pvm = '2025-03-24'
...
@@ -18,6 +18,8 @@ pvm = '2025-03-24'
#TODO: päivämäärän interpoloiminen lausekkeeseen
#TODO: päivämäärän interpoloiminen lausekkeeseen
paivanruuat
=
cur
.
execute
(
"
SELECT id, ruoka FROM ateria WHERE paiva LIKE
'
2025-03-24%
'"
).
fetchall
()
paivanruuat
=
cur
.
execute
(
"
SELECT id, ruoka FROM ateria WHERE paiva LIKE
'
2025-03-24%
'"
).
fetchall
()
# [(5, "Pelti Sushi"), (6, "Pinaattiohukaisia"), (7, "Ramenkeitto"), ...]
while
True
:
while
True
:
valid_ids
=
[]
valid_ids
=
[]
for
ruokatuple
in
paivanruuat
:
for
ruokatuple
in
paivanruuat
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment