commit 97c75f88c46febc53c17388048e57f6c19f51743
parent 62e042567223a468424a2689b71da6a6ec400c6b
Author: Brennen T. Mazur <brennen@madis.cool>
Date: Thu, 5 Jan 2023 09:40:10 -0700
Merge branch 'backend' of git.brennen.work:stc into backend
Diffstat:
M | app.py | | | 23 | ++++++++++++++++++++++- |
A | seeds.py | | | 30 | ++++++++++++++++++++++++++++++ |
2 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/app.py b/app.py
@@ -1,4 +1,5 @@
import datetime
+import urllib.parse
import json
from flask import Flask, render_template, abort, redirect, url_for, request, session, jsonify;
from flask_login import UserMixin, login_user, LoginManager, login_required, logout_user, current_user;
@@ -9,6 +10,7 @@ OrganizationName = "Youth Employment Program"
app = Flask(__name__)
+<<<<<<< HEAD
# Mongo setup ##Do we need a ConnectionFailure check? pymongo.errors import ConnectionFailure
## client = MongoClient()
## try:
@@ -17,6 +19,20 @@ app = Flask(__name__)
## print("Server not available")
## Then bcrypt, create db and create collections
client = MongoClient()
+=======
+# urllib.parse
+username = urllib.parse.quote_plus('user')
+password = urllib.parse.quote_plus('pass/word')
+MongoClient('mongodb://%s:%s@127.0.0.1' % (username, password))
+# urllib.parse
+
+# Mongo setup
+client = MongoClient('simple-time-card.com',
+ username='user',
+ password='password',
+ authSource='users-collection',
+ authMechanism='SCRAM-SHA-256')
+>>>>>>> 61b3589d576984c0160559d5480e913c99dd7345
client = MongoClient('localhost', 27017)
bcrypt = Bcrypt(app)
db = client['simple_timecard_database']
@@ -35,7 +51,12 @@ app.config['SECRET_KEY'] = 'secretkey'
# Database collections/documents
collection = db['users-collection'] # Make aditional user info single document/array
-# collection = db['']
+
+collection = db['time-data-collection']
+
+collection = db['fleet-collection']
+
+collection = db['agreement-collection']
# Database collections/documents
# Routes
diff --git a/seeds.py b/seeds.py
@@ -0,0 +1,29 @@
+# Database collections/documents
+# collection = db['users-collection'] # Make aditional user info single document/array
+
+post = {'name': 'Nikolas Mazur',
+ 'role': 'Backend Developer',
+ 'location': 'Remote',
+ 'phone': 3074380460,
+ 'email': 'kolemazur@gmail.com',
+ 'active': 1,
+ 'pay_period': 'Monthly',
+ 'pay_value': 10}
+
+# collection = db['time-data-collection']
+
+post = {'time': datetime.datetime.utcnow(),
+ 'clocked_in': datetime.datetime.utcnow(),
+ 'edited_by_user': 'Nikolas Mazur',
+ 'edit_time': datetime.datetime.utcnow(),
+ 'day': '29',
+ 'month': '3',
+ 'project': ['Timecard'],
+ 'Perdium': 0}
+
+# collection = db['fleet-collection']
+
+
+
+# collection = db['agreement-collection']
+# Database collections/documents
+\ No newline at end of file