update readme
parent
c705a757b0
commit
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`
|
||||
|
||||
### Update Attendance
|
||||
The `time` is optional and it may contain values *'now'* or *ISO-8601 time-string*
|
||||
#### Student :
|
||||
`$ http --session=./session.json -f POST http://127.0.0.1:5000/api/attendance/student presence=absent identifier=2 time=now`
|
||||
#### Class :
|
||||
|
|
@ -14,6 +15,7 @@ start the server by running
|
|||
|
||||
|
||||
### Get Attendance
|
||||
The `start_time` and `end_time` are optional and they may contain values *'now'* or **time string**
|
||||
#### Student:
|
||||
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/student?identifier=2&start_time=now&end_time=now"`
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ class Presence(Enum):
|
|||
"""docstring for ResultType."""
|
||||
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):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ security = Security(app, user_datastore)
|
|||
|
||||
|
||||
def auth_func(*args, **kwargs):
|
||||
# if not current_user.is_authenticated:
|
||||
# raise ProcessingException(description='Not authenticated', code=401)
|
||||
if not current_user.is_authenticated:
|
||||
raise ProcessingException(description='Not authenticated', code=401)
|
||||
return True
|
||||
|
||||
|
||||
|
|
@ -81,8 +81,6 @@ def parse_time(time_str):
|
|||
|
||||
|
||||
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):
|
||||
return AttendanceUpdate.query.filter(
|
||||
AttendanceUpdate.update_type == req_type).filter(
|
||||
|
|
@ -208,7 +206,7 @@ def logout():
|
|||
|
||||
@app.route('/')
|
||||
def home():
|
||||
return 'hello'
|
||||
return 'welcome'
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Reference in New Issue