-
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
7,454 changed files
with
350 additions
and
2,858,512 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
File renamed without changes.
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 AdminappConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'AdminApp' |
File renamed without changes.
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.db import models | ||
|
||
# Create 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,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,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class AuthenticationAppConfig(AppConfig): | ||
class AuthenticationappConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'AuthenticationApp' |
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,34 @@ | ||
from django.contrib.auth.base_user import BaseUserManager | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
|
||
class CustomUserManager(BaseUserManager): | ||
""" | ||
Custom user model manager where email is the unique identifiers | ||
for authentication instead of usernames. | ||
""" | ||
def create_user(self, email, password, **extra_fields): | ||
""" | ||
Create and save a User with the given email and password. | ||
""" | ||
if not email: | ||
raise ValueError(_('The Email must be set')) | ||
email = self.normalize_email(email) | ||
user = self.model(email=email, **extra_fields) | ||
user.set_password(password) | ||
user.save() | ||
return user | ||
|
||
def create_superuser(self, email, password, **extra_fields): | ||
""" | ||
Create and save a SuperUser with the given email and password. | ||
""" | ||
extra_fields.setdefault('is_staff', True) | ||
extra_fields.setdefault('is_superuser', True) | ||
extra_fields.setdefault('is_active', True) | ||
|
||
if extra_fields.get('is_staff') is not True: | ||
raise ValueError(_('Superuser must have is_staff=True.')) | ||
if extra_fields.get('is_superuser') is not True: | ||
raise ValueError(_('Superuser must have is_superuser=True.')) | ||
return self.create_user(email, password, **extra_fields) |
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 |
---|---|---|
@@ -1,18 +0,0 @@ | ||
from django.contrib.auth.models import AbstractUser | ||
from django.db import models | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from .managers import CustomUserManager | ||
|
||
|
||
class CustomUser(AbstractUser): | ||
username = None | ||
email = models.EmailField(_('email address'), unique=True) | ||
|
||
USERNAME_FIELD = 'email' | ||
REQUIRED_FIELDS = [] | ||
|
||
objects = CustomUserManager() | ||
|
||
def __str__(self): | ||
return self.email | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from django.contrib.auth.base_user import BaseUserManager | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
|
||
class CustomUserManager(BaseUserManager): | ||
""" | ||
Custom user model manager where email is the unique identifiers | ||
for authentication instead of usernames. | ||
""" | ||
def create_user(self, email, password, **extra_fields): | ||
""" | ||
Create and save a User with the given email and password. | ||
""" | ||
if not email: | ||
raise ValueError(_('The Email must be set')) | ||
email = self.normalize_email(email) | ||
user = self.model(email=email, **extra_fields) | ||
user.set_password(password) | ||
user.save() | ||
return user | ||
|
||
def create_superuser(self, email, password, **extra_fields): | ||
""" | ||
Create and save a SuperUser with the given email and password. | ||
""" | ||
extra_fields.setdefault('is_staff', True) | ||
extra_fields.setdefault('is_superuser', True) | ||
extra_fields.setdefault('is_active', True) | ||
|
||
if extra_fields.get('is_staff') is not True: | ||
raise ValueError(_('Superuser must have is_staff=True.')) | ||
if extra_fields.get('is_superuser') is not True: | ||
raise ValueError(_('Superuser must have is_superuser=True.')) | ||
return self.create_user(email, password, **extra_fields) |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +0,0 @@ | ||
# This is an auto-generated Django model module. | ||
# You'll have to do the following manually to clean this up: | ||
# * Rearrange models' order | ||
# * Make sure each model has one field with primary_key=True | ||
# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior | ||
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table | ||
# Feel free to rename the models, but don't rename db_table values or field names. | ||
from django.db import models | ||
import datetime | ||
from uuid import uuid4 | ||
|
||
|
||
|
||
class Cameradef(models.Model): | ||
cameraid = models.CharField(db_column='CameraId', max_length=50) # Field name made lowercase. | ||
type = models.CharField(db_column='Type', max_length=50) # Field name made lowercase. | ||
modelnum = models.CharField(db_column='ModelNum', max_length=50) # Field name made lowercase. | ||
ipaddress = models.CharField(db_column='IpAddress', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
macaddress = models.CharField(db_column='MacAddress', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
manufacturer = models.CharField(db_column='Manufacturer', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
origin = models.CharField(db_column='Origin', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
|
||
|
||
class Customers(models.Model): | ||
customerid = models.CharField(db_column='CustomerId', primary_key=True, max_length=50) # Field name made lowercase. | ||
clienttype = models.CharField(db_column='ClientType', max_length=70, blank=True, null=True) # Field name made lowercase. | ||
fname = models.CharField(db_column='FName', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
lname = models.CharField(db_column='LName', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
email = models.CharField(db_column='Email', max_length=80, blank=True, null=True) # Field name made lowercase. | ||
mobile = models.CharField(db_column='Mobile', max_length=13, blank=True, null=True) # Field name made lowercase. | ||
position = models.CharField(db_column='Position', max_length=20, blank=True, null=True) # Field name made lowercase. | ||
companyname = models.CharField(db_column='CompanyName', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
companymail = models.CharField(db_column='CompanyMail', max_length=70, blank=True, null=True) # Field name made lowercase. | ||
companyid = models.CharField(db_column='CompanyId', max_length=30, blank=True, null=True) # Field name made lowercase. | ||
address = models.CharField(db_column='Address', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
sector = models.CharField(db_column='Sector', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
district = models.CharField(db_column='District', max_length=40, blank=True, null=True) # Field name made lowercase. | ||
city = models.CharField(db_column='City', max_length=30, blank=True, null=True) # Field name made lowercase. | ||
province = models.CharField(db_column='Province', max_length=30, blank=True, null=True) # Field name made lowercase. | ||
geolocation = models.CharField(db_column='GeoLocation', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
country = models.CharField(db_column='Country', max_length=30, blank=True, null=True) # Field name made lowercase. | ||
comments = models.CharField(db_column='Comments', max_length=500, blank=True, null=True) # Field name made lowercase. | ||
enrollmentdate = models.DateField(blank=True, null=True) | ||
|
||
|
||
|
||
class Gatesdef(models.Model): | ||
gateid = models.CharField(db_column='GateId', max_length=50) # Field name made lowercase. | ||
customerid = models.CharField(db_column='CustomerId', max_length=50) # Field name made lowercase. | ||
flow = models.CharField(db_column='Flow', max_length=50) # Field name made lowercase. | ||
description = models.CharField(db_column='Description', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
cashiername = models.CharField(db_column='CashierName', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
cameraid = models.CharField(db_column='CameraId', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
|
||
|
||
class Parkinglog(models.Model): | ||
ticketid = models.UUIDField(db_column='TicketId', primary_key=True) # Field name made lowercase. | ||
customerid = models.CharField(db_column='CustomerId', max_length=50) # Field name made lowercase. | ||
date = models.DateField(db_column='Date') # Field name made lowercase. | ||
platenum = models.CharField(db_column='PlateNum', max_length=50) # Field name made lowercase. | ||
entrygateid = models.CharField(db_column='EntryGateId', max_length=50) # Field name made lowercase. | ||
checkintime = models.BigIntegerField(db_column='CheckinTime') # Field name made lowercase. | ||
checkouttime = models.BigIntegerField(db_column='CheckoutTime', blank=True, null=True) # Field name made lowercase. | ||
exitgateid = models.CharField(db_column='ExitGateId', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
status = models.CharField(db_column='Status', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
duration = models.FloatField(db_column='Duration', blank=True, null=True) # Field name made lowercase. | ||
cash = models.FloatField(db_column='Cash', blank=True, null=True) # Field name made lowercase. | ||
|
||
@classmethod | ||
def add(self, date, time, platenumber): | ||
format_datetime = datetime.datetime.strptime(date + ' ' + time, '%Y-%m-%d %H:%M') | ||
self.objects.create(platenum=platenumber, | ||
date = format_datetime.date(), | ||
ticketid = uuid4(), | ||
customerid = 'EGPCI-AAA01-0001', | ||
checkintime= format_datetime.timestamp(), | ||
entrygateid='SouthGate', | ||
status = 'Parked') | ||
|
||
@classmethod | ||
def close(self, ticketid, checkouttime, exitgateid, cash): | ||
self.objects.filter(ticketid=ticketid).update(checkouttime=checkouttime, | ||
exitgateid=exitgateid) | ||
@classmethod | ||
def delete(self, ticketid): | ||
self.objects.filter(ticketid=ticketid).delete() | ||
|
||
|
||
|
||
|
||
class Tarrif(models.Model): | ||
tarrifid = models.UUIDField(db_column='TarrifId', primary_key=True) # Field name made lowercase. | ||
customerid = models.CharField(db_column='CustomerId', max_length=50) # Field name made lowercase. | ||
fromtime = models.FloatField(db_column='FromTime', blank=True, null=True) # Field name made lowercase. | ||
totime = models.FloatField(db_column='ToTime', blank=True, null=True) # Field name made lowercase. | ||
cost = models.FloatField(db_column='Cost', blank=True, null=True) # Field name made lowercase. | ||
initiatedby = models.CharField(db_column='Initiatedby', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
date = models.DateField(db_column='Date', blank=True, null=True) # Field name made lowercase. | ||
lastupdate = models.DateField(db_column='LastUpdate', blank=True, null=True) # Field name made lowercase. | ||
updatelog = models.CharField(db_column='UpdateLog', max_length=50, blank=True, null=True) # Field name made lowercase. | ||
|
||
@classmethod | ||
def add_tarrif(self, fromtime, totime, cost): | ||
self.objects.create( | ||
tarrifid = uuid4(), | ||
customerid = 'EGPCI-AAA01-0001', | ||
fromtime = fromtime, | ||
totime = totime, | ||
cost = cost, | ||
date = datetime.datetime.now().date() | ||
) | ||
|
||
@classmethod | ||
def remove_tarrif(self, tarrifid): | ||
self.objects.filter(tarrifid=tarrifid).delete() | ||
|
||
|
||
class Subcription: | ||
customerid = models.CharField(db_column='CustomerId', max_length=50) # Field name made lowercase. | ||
subscriptionid = models.CharField(db_column='SubscriptionId', max_length=50) # Field name made lowercase. | ||
platenumber = models.CharField(db_column='PlateNumber', max_length=50) # Field name made lowercase. | ||
subscription_date = models.DateField(db_column='SubscriptionDate') # Field name made lowercase. | ||
subscription_end_date = models.DateField(db_column='SubscriptionEndDate') # Field name made lowercase. | ||
subscription_type = models.CharField(db_column='SubscriptionType', max_length=50) # Field name made lowercase. | ||
subscription_status = models.CharField(db_column='SubscriptionStatus', max_length=50) # Field name made lowercase. | ||
subscription_amount = models.FloatField(db_column='SubscriptionAmount') # Field name made lowercase. | ||
contact_number = models.CharField(db_column='ContactNumber', max_length=50) # Field name made lowercase. | ||
office_location = models.CharField(db_column='OfficeLocation', max_length=50) # Field name made lowercase. | ||
parkingLot = models.CharField(db_column='ParkingLot', max_length=50) # Field name made lowercase. | ||
|
||
|
||
|
||
Oops, something went wrong.