Skip to content

Commit

Permalink
Retro Upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
agent87 committed Nov 10, 2021
1 parent bf9f5b2 commit 992fdaa
Show file tree
Hide file tree
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.
File renamed without changes.
3 changes: 3 additions & 0 deletions AdminApp/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions AdminApp/apps.py
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.
3 changes: 3 additions & 0 deletions AdminApp/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions AdminApp/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions AdminApp/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
2 changes: 1 addition & 1 deletion AuthenticationApp/apps.py
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'
34 changes: 34 additions & 0 deletions AuthenticationApp/managers.py
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)
18 changes: 0 additions & 18 deletions AuthenticationApp/models.py
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
2 changes: 1 addition & 1 deletion AuthenticationApp/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Auth import models
from . import models
from django.shortcuts import render, redirect, resolve_url
from django.urls import reverse
from django.contrib.auth.decorators import login_required
Expand Down
34 changes: 34 additions & 0 deletions DashboardApp/managers.py
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)
93 changes: 0 additions & 93 deletions DashboardApp/migrations/0001_initial.py

This file was deleted.

132 changes: 0 additions & 132 deletions DashboardApp/models.py
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.



Loading

0 comments on commit 992fdaa

Please sign in to comment.