Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CM1102 shop
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Michael Drury
CM1102 shop
Commits
22db8e39
Commit
22db8e39
authored
1 year ago
by
Michael Drury
Browse files
Options
Downloads
Patches
Plain Diff
added comments for databases.py
parent
1e45e233
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shop/databases.py
+4
-1
4 additions, 1 deletion
shop/databases.py
with
4 additions
and
1 deletion
shop/databases.py
+
4
−
1
View file @
22db8e39
...
...
@@ -2,6 +2,8 @@ from werkzeug.security import generate_password_hash, check_password_hash
from
flask_login
import
UserMixin
from
.
import
db
# Usertable which also stores the users wishlist and cart as a string of item ids split up by spaces
class
User
(
UserMixin
,
db
.
Model
):
__tablename__
=
'
users
'
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
...
...
@@ -34,7 +36,7 @@ class User(UserMixin, db.Model):
def
__repr__
(
self
):
return
'
<User {0}>
'
.
format
(
self
.
username
)
# stores all of the information for the projects
class
product_table
(
db
.
Model
):
__tablename__
=
'
products
'
product_id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
...
...
@@ -53,6 +55,7 @@ class product_table(db.Model):
product_description
=
description_in
))
db
.
session
.
commit
()
# stores the reviews as well as the author of the review
class
review_table
(
db
.
Model
):
__tablename__
=
'
reviews
'
review_id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
...
...
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