ZP_DjangoProject/ZP_DjangoProject/urls.py
from django.contrib import admin
from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('PPMS/', include('PPMS.urls')),
path('Dispute/',include('Dispute.urls')),
path('Reciept/', include('Reciept.urls')),
]
ZP_DjangoProject/ZP_DjangoProject/settigns.py
from pathlib import Path
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Build paths inside the project like this: BASE_DIR / 'subdir'.
# BASE_DIR = Path(__file__).resolve().parent.parent
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'PPMS.apps.PpmsConfig',
'Reciept.apps.RecieptConfig',
'Transactions.apps.TransactionsConfig',
'Dispute.apps.DisputeConfig'
]
ROOT_URLCONF = 'ZP_DjangoProject.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'Z_templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
ZP_DjangoProject/Dispute/urls.py
from django.urls import path
from .views import Disputeindex
app_name='Dispute'
urlpatterns = [
path('',Disputeindex, name='Disputeindex')
]
ZP_DjangoProject/Dispute/models.py
from django.db import models
from PPMS.models import Property
# Create your models here.
class Dispute(models.Model):
dept = [
('Legal','Legal'),
('Credit Control','Credit Control'),
('Property Management','Property Management'),
('Pre Sales','Pre Sales'),
('Asset', 'Asset'),
('Subletting','Subletting')
]
allocated_dept = models.CharField(max_length=50,choices=dept,blank=True)
dispute_create_date = models.DateTimeField(auto_now_add=True)
dispute_modified_date = models.DateTimeField(auto_now=True)
disputor = models.CharField(max_length=100)
disputor_telephone = models.CharField(max_length=12)
disputor_email = models.EmailField()
dispute_info = models.TextField()
property = models.ForeignKey(Property, on_delete=models.CASCADE, related_name='DisProp')
def __str__(self):
return f"{self.id} - {self.disputor}"
ZP_DjangoProject/Dispute/views.py
from django.shortcuts import render
from .models import Dispute
# Create your views here.
def Disputeindex(request):
disputes = Dispute.objects.all()
return render(request, 'Disputes/index.html', {
'disputes': disputes })
ZP_DjangoProject/PPMS/urls.py
from django.urls import path
from .views import PPMSindex
urlpatterns = [
path('',PPMSindex, name='PPMSindex')
]
ZP_DjangoProject/PPMS/models.py
from django.db import models
# Create your models here.
class Owner(models.Model):
owner_name = models.CharField(max_length=100)
owner_reference = models.CharField(max_length=50)
address_1 = models.CharField(max_length=100,blank=True)
address_2 = models.CharField(max_length=100,blank=True)
address_3 = models.CharField(max_length=100,blank=True)
address_4 = models.CharField(max_length=100,blank=True)
address_5 = models.CharField(max_length=100,blank=True)
postcode = models.CharField(max_length=10,blank=True)
bank = models.CharField(max_length=50, blank=True)
type = models.CharField(max_length=50, blank=True)
charge_to = models.CharField(max_length=50, blank=True)
vat_number = models.CharField(max_length=50, blank=True)
def __str__(self):
return {self.owner_reference} - {self.owner_name}
class Property(models.Model):
property_name = models.CharField(max_length=100)
property_reference = models.CharField(max_length=50)
property_tenure = models.CharField(max_length=50, blank=True)
property_status = models.CharField(max_length=50, blank=True)
property_type = models.CharField(max_length=50, blank=True)
address_1 = models.CharField(max_length=100,blank=True)
address_2 = models.CharField(max_length=100,blank=True)
address_3 = models.CharField(max_length=100,blank=True)
address_4 = models.CharField(max_length=100,blank=True)
address_5 = models.CharField(max_length=100,blank=True)
postcode = models.CharField(max_length=10,blank=True)
ipd_area = models.CharField(max_length=10, blank=True)
start_date = models.DateField(blank=True)
end_date = models.DateField(blank=True)
title_number = models.CharField(max_length=50, blank=True)
UPRN = models.CharField(max_length=50, blank=True)
charged_to = models.CharField(max_length=50, blank=True)
owner = models.ForeignKey(Owner,on_delete=models.CASCADE, related_name='propowner', null=True)
def __str__(self):
return {self.property_reference} - {self.property_name}
class Unit(models.Model):
unit_name = models.CharField(max_length=100)
unit_reference = models.CharField(max_length=50)
unit_tenure = models.CharField(max_length=50, blank=True)
unit_status = models.CharField(max_length=50, blank=True)
unit_type = models.CharField(max_length=50, blank=True)
address_1 = models.CharField(max_length=100,blank=True)
address_2 = models.CharField(max_length=100,blank=True)
address_3 = models.CharField(max_length=100,blank=True)
address_4 = models.CharField(max_length=100,blank=True)
address_5 = models.CharField(max_length=100,blank=True)
postcode = models.CharField(max_length=10,blank=True)
UPRN = models.CharField(max_length=50, blank=True)
lease_startdate = models.DateField(blank=True)
lease_enddate = models.DateField(blank=True)
lease_date = models.DateField(blank=True)
lease_term = models.IntegerField(blank=True)
charge_type = models.CharField(max_length=50, blank=True)
property = models.ForeignKey(Property, on_delete=models.CASCADE, related_name='unitprop', null=True)
def __str__(self):
return {self.unit_reference} - {self.unit_name}
class Tenant(models.Model):
tenant_name = models.CharField(max_length=100)
tenant_reference = models.CharField(max_length=50, blank=True)
tenant_status = models.CharField(max_length=100, blank=True)
address_1 = models.CharField(max_length=100,blank=True)
address_2 = models.CharField(max_length=100,blank=True)
address_3 = models.CharField(max_length=100,blank=True)
address_4 = models.CharField(max_length=100,blank=True)
address_5 = models.CharField(max_length=100,blank=True)
postcode = models.CharField(max_length=10,blank=True)
telephone_1 = models.CharField(max_length=12, blank=True)
telephone_2 = models.CharField(max_length=12, blank=True)
mobile = models.CharField(max_length=12, blank=True)
email_1 = models.EmailField(blank=True)
email_2 = models.EmailField(blank=True)
start_date = models.DateField(blank=True)
end_date = models.DateField(blank=True)
unit = models.ForeignKey(Unit, on_delete=models.CASCADE, related_name='tenantunit', null=True)
def __str__(self):
return {self.tenant_reference} - {self.tenant_name}
ZP_DjangoProject/PPMS/views.py
from django.shortcuts import render
def PPMSindex(request):
return render(request, 'PPMS/index.html')
ZP_DjangoProject/Reciept/urls.py
from django.urls import path
from .views import Recipetindex
app_name='Reciept'
urlpatterns = [
path('',Recipetindex,name='Recieptindex'),
]
ZP_DjangoProject/Reciepts/models.py
from django.db import models
ZP_DjangoProject/Reciepts/views.py
from django.shortcuts import render
def Recipetindex(request):
return render(request, 'Reciept/index.html')
ZP_DjangoProject/Transactions/urls.py
from django.urls import path
from .views import tranIndex
app_name='Transaction'
urlpatterns = [
path('',tranIndex,name='tranindex')
]
ZP_DjangoProject/Transactions/models.py
from django.db import models
ZP_DjangoProject/Transactions/views.py
from django.shortcuts import render
# Create your views here.
def tranIndex(request):
return render(request, 'Tran/index.html')