-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added second table, now they communicate
- Loading branch information
Nicholas Couillard
authored and
Nicholas Couillard
committed
Oct 16, 2023
1 parent
87b9037
commit bae8b39
Showing
2 changed files
with
108 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from boto3 import resource | ||
from boto3.dynamodb.conditions import Attr, Key | ||
import math | ||
import random | ||
|
||
student_table = resource('dynamodb').Table('Students') | ||
|
||
def createStudent(studentID, studentPWD, enrolledCourses = []): | ||
studentCreation = student_table.put_item( | ||
Item = { | ||
'StudentId' : studentID, | ||
'StudentPWD' : studentPWD, | ||
'EnrolledCourses' : enrolledCourses | ||
} | ||
) | ||
|
||
print(f"Student creation output: {studentCreation}") | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
createStudent("nic21003", "coolTest420") |