-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
607 additions
and
106 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ApiConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'API' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
|
||
# class Requests(models.Model): | ||
# request_id = models.AutoField(primary_key=True) | ||
# request_name = models.CharField(max_length=50) | ||
# request_description = models.CharField(max_length=200) | ||
# request_status = models.CharField(max_length=50) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.urls import path | ||
from . import views | ||
|
||
|
||
|
||
urlpatterns = [ | ||
###Auth Related##### | ||
path('post', views.ParkingLogs.Post, name='ParkingLogs_Port') | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from django.http import HttpResponse | ||
from django.views.decorators.csrf import csrf_exempt | ||
from django.core.exceptions import ObjectDoesNotExist | ||
from requests.api import request | ||
import SystemApp | ||
import datetime | ||
from uuid import uuid4 | ||
|
||
|
||
class ParkingLogs: | ||
@csrf_exempt | ||
def Post(request): | ||
if request.method == 'POST': | ||
if request.POST.get('flow') == 'entry': | ||
ticket_id = uuid4() | ||
SystemApp.models.Parkinglog.objects.create(plate_number=request.POST.get('plate_number'), | ||
date = datetime.datetime.now(), | ||
ticket_id = ticket_id, | ||
customer_id = SystemApp.models.Customers.objects.get(customer_id=request.POST.get('customer_id')), | ||
checkin_time= int(float(request.POST.get('time'))), | ||
checkin_method = 'Camera', | ||
entry_gate= SystemApp.models.Gates.objects.get(gate_id=request.POST.get('gate')), | ||
parked = True) | ||
|
||
try: | ||
SystemApp.models.Parkinglog.objects.filter(ticket_id=ticket_id).update(subscription=SystemApp.models.Subscriptions.objects.get(plate_number=request.POST.get('plate_number'))) | ||
except ObjectDoesNotExist: | ||
pass | ||
response = HttpResponse() | ||
response['TicketId'] = ticket_id | ||
return response | ||
|
||
else: | ||
response = HttpResponse() | ||
response['TicketId'] = 200 | ||
return response | ||
else: | ||
return None |
373 changes: 373 additions & 0 deletions
373
DashboardApp/templates/DashboardApp/Accounts/Profile.html
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.