Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Advanced-Software-Development
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
Terence2.Frayne@live.uwe.ac.uk
Advanced-Software-Development
Commits
4dbe65ba
Commit
4dbe65ba
authored
6 months ago
by
nathan
Browse files
Options
Downloads
Patches
Plain Diff
started ERD and database setup
parent
d23d7743
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Diagrams/Class_Diagram.asta.lock
+0
-0
0 additions, 0 deletions
Diagrams/Class_Diagram.asta.lock
src/cinemaObj.py
+8
-1
8 additions, 1 deletion
src/cinemaObj.py
src/dbfunc.py
+27
-1
27 additions, 1 deletion
src/dbfunc.py
src/staffUser.py
+7
-9
7 additions, 9 deletions
src/staffUser.py
with
42 additions
and
11 deletions
Diagrams/Class_Diagram.asta.lock
0 → 100644
+
0
−
0
View file @
4dbe65ba
This diff is collapsed.
Click to expand it.
src/cinemaObj.py
+
8
−
1
View file @
4dbe65ba
...
@@ -23,7 +23,7 @@ class Cinema(object):
...
@@ -23,7 +23,7 @@ class Cinema(object):
def
create_screen
(
self
):
def
create_screen
(
self
):
raise
NotImplementedError
()
raise
NotImplementedError
()
# obj_screen = Screen(capacity=0, sizeH=9,sizeW=16,resolutionH=1080,resolutionW=1920,isIMAX=False)
# obj_screen = Screen(capacity=0, sizeH=9,sizeW=16,resolutionH=1080,resolutionW=1920,isIMAX=False)
# obj_screen
.save()
#
cinema_screeens .append
obj_screen
def
update_screen
(
self
,
screen
:
Screen
,
sizeHeight
:
float
,
sizeWidth
:
float
,
resolutionHeight
:
int
,
resolutionWidth
:
int
,
capacity
:
int
)
->
None
:
def
update_screen
(
self
,
screen
:
Screen
,
sizeHeight
:
float
,
sizeWidth
:
float
,
resolutionHeight
:
int
,
resolutionWidth
:
int
,
capacity
:
int
)
->
None
:
raise
NotImplementedError
()
raise
NotImplementedError
()
...
@@ -45,6 +45,13 @@ class Cinema(object):
...
@@ -45,6 +45,13 @@ class Cinema(object):
# do we need this? need to test if we can use cinema.listings.remove()
# do we need this? need to test if we can use cinema.listings.remove()
raise
NotImplementedError
()
raise
NotImplementedError
()
def
updateFromDataBase
(
self
)
->
None
:
# call dbFunc
# gets data in form of json
# gets pricing data
# convert to dict?
# update self data with new values.
raise
NotImplementedError
()
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
src/dbfunc.py
+
27
−
1
View file @
4dbe65ba
...
@@ -41,3 +41,29 @@ def getConnection(db=""):
...
@@ -41,3 +41,29 @@ def getConnection(db=""):
else
:
else
:
logging
.
error
(
"
Connected to server, without database.
"
)
logging
.
error
(
"
Connected to server, without database.
"
)
return
conn
return
conn
def
selectFromTbl
(
table
,
dbname
,
*
args
):
logging
.
debug
(
f
"
running slect statement with values: tablename=
'
{
table
}
''
, dbname=
'
{
dbname
}
''
,
{
args
}
"
)
conn
=
getConnection
(
db
=
dbname
)
if
conn
!=
None
:
if
conn
.
is_connected
():
SELECT_STATEMENT
=
f
"
SELECT
"
for
arg
in
args
:
SELECT_STATEMENT
.
append
(
f
"
{
arg
}
,
"
)
SELECT_STATEMENT
.
removesuffix
(
"
,
"
)
SELECT_STATEMENT
.
append
(
f
"
from
{
table
}
;
"
)
dbcursor
=
conn
.
cursor
()
dbcursor
.
execute
(
f
"
USE
{
dbname
}
"
)
dbcursor
.
execute
(
SELECT_STATEMENT
)
logging
.
info
(
"
SELECT statement executed successfully.
"
)
dataOut
=
dbcursor
.
fetchall
()
logging
.
debug
(
f
"
dataOut:
{
dataOut
}
"
)
dbcursor
.
close
()
conn
.
close
()
else
:
logging
.
error
(
"
conn not connected
"
)
raise
ConnectionError
()
else
:
logging
.
error
(
"
conn returned NoneType
"
)
raise
ConnectionAbortedError
()
This diff is collapsed.
Click to expand it.
src/staffUser.py
+
7
−
9
View file @
4dbe65ba
...
@@ -22,15 +22,6 @@ class StaffUser(object):
...
@@ -22,15 +22,6 @@ class StaffUser(object):
userType
=
"
BookingStaff
"
userType
=
"
BookingStaff
"
return
f
"
{
userType
}
user object(userID=
{
self
.
userID
}
, userName=
{
self
.
userName
}
, userPass=
{
self
.
userPass
}
)
"
return
f
"
{
userType
}
user object(userID=
{
self
.
userID
}
, userName=
{
self
.
userName
}
, userPass=
{
self
.
userPass
}
)
"
# @property
# def options_list(self) -> dict:
# """_summary_
# functions in a dict, to be used as labels and callable function pairs
# Returns:
# dict: _description_
# """
# options:dict = {"View film Listings":self.viewFilmListing, "Create booking":self.createBooking, "Logout":self.logout}
# return options
def
save
(
self
):
def
save
(
self
):
"""
save self to db.
"""
"""
save self to db.
"""
...
@@ -64,6 +55,13 @@ class StaffUser(object):
...
@@ -64,6 +55,13 @@ class StaffUser(object):
def
manageBooking
(
self
):
def
manageBooking
(
self
):
raise
NotImplementedError
()
raise
NotImplementedError
()
def
updateFromDataBase
(
self
)
->
None
:
# call dbFunc
# gets dbData in form of json
# convert to dict?
# update self data with new values.
raise
NotImplementedError
()
...
...
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