Compare commits
2 Commits
c705a757b0
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5a23853ef | ||
|
|
aba3ab980a |
@@ -7,6 +7,7 @@ start the server by running
|
|||||||
`$ http --session=./session.json -f POST http://127.0.0.1:5000/api/login username=user@example.com password=password`
|
`$ http --session=./session.json -f POST http://127.0.0.1:5000/api/login username=user@example.com password=password`
|
||||||
|
|
||||||
### Update Attendance
|
### Update Attendance
|
||||||
|
The `time` is optional and it may contain values *'now'* or *ISO-8601 time-string*
|
||||||
#### Student :
|
#### Student :
|
||||||
`$ http --session=./session.json -f POST http://127.0.0.1:5000/api/attendance/student presence=absent identifier=2 time=now`
|
`$ http --session=./session.json -f POST http://127.0.0.1:5000/api/attendance/student presence=absent identifier=2 time=now`
|
||||||
#### Class :
|
#### Class :
|
||||||
@@ -14,6 +15,7 @@ start the server by running
|
|||||||
|
|
||||||
|
|
||||||
### Get Attendance
|
### Get Attendance
|
||||||
|
The `start_time` and `end_time` are optional and they may contain values *'now'* or **time string**
|
||||||
#### Student:
|
#### Student:
|
||||||
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/student?identifier=2&start_time=now&end_time=now"`
|
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/student?identifier=2&start_time=now&end_time=now"`
|
||||||
|
|
||||||
@@ -22,3 +24,6 @@ or
|
|||||||
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/student?identifier=3&start_time=now&end_time=now"`
|
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/student?identifier=3&start_time=now&end_time=now"`
|
||||||
#### Class:
|
#### Class:
|
||||||
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/class?identifier=1"`
|
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/class?identifier=1"`
|
||||||
|
|
||||||
|
### Logout
|
||||||
|
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/logout"`
|
||||||
|
|||||||
@@ -35,7 +35,9 @@ class Presence(Enum):
|
|||||||
"""docstring for ResultType."""
|
"""docstring for ResultType."""
|
||||||
PRESENT, ABSENT, SICK, VACATION = range(4)
|
PRESENT, ABSENT, SICK, VACATION = range(4)
|
||||||
|
|
||||||
presense_map = {i:str(i).replace('Presence.', '').upper() for i in Presence}
|
|
||||||
|
presense_map = {i: str(i).replace('Presence.', '').upper() for i in Presence}
|
||||||
|
|
||||||
|
|
||||||
class Gradeclass(db.Model):
|
class Gradeclass(db.Model):
|
||||||
id = db.Column(db.Integer, primary_key=True)
|
id = db.Column(db.Integer, primary_key=True)
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ security = Security(app, user_datastore)
|
|||||||
|
|
||||||
|
|
||||||
def auth_func(*args, **kwargs):
|
def auth_func(*args, **kwargs):
|
||||||
# if not current_user.is_authenticated:
|
if not current_user.is_authenticated:
|
||||||
# raise ProcessingException(description='Not authenticated', code=401)
|
raise ProcessingException(description='Not authenticated', code=401)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@@ -81,8 +81,6 @@ def parse_time(time_str):
|
|||||||
|
|
||||||
|
|
||||||
def compute_attendance(request_type, object_id, start_time, end_time):
|
def compute_attendance(request_type, object_id, start_time, end_time):
|
||||||
print('AttendanceUpdates for :', start_time, end_time)
|
|
||||||
|
|
||||||
def get_records(req_type, obj_id):
|
def get_records(req_type, obj_id):
|
||||||
return AttendanceUpdate.query.filter(
|
return AttendanceUpdate.query.filter(
|
||||||
AttendanceUpdate.update_type == req_type).filter(
|
AttendanceUpdate.update_type == req_type).filter(
|
||||||
@@ -208,7 +206,7 @@ def logout():
|
|||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def home():
|
def home():
|
||||||
return 'hello'
|
return 'welcome'
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user