-
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
19 changed files
with
457 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.contrib import admin | ||
from .models import Booking | ||
from .models import Driver | ||
# Register your models here. | ||
admin.site.register(Booking) | ||
admin.site.register(Driver) |
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,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class BookingappConfig(AppConfig): | ||
name = 'bookingapp' |
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,114 @@ | ||
from django.contrib.auth.models import User | ||
from django import forms | ||
from .models import Booking,Driver | ||
|
||
|
||
FROM_LOCATION=( | ||
('Kuniyamuthur','Kuniyamuthur'), | ||
('Ukkadam','Ukkadam'), | ||
('Gandhipuram','Gandhipuram'), | ||
('Sundharapuram','Sundharapuram'), | ||
) | ||
|
||
TO_LOCATION=( | ||
('Kuniyamuthur','Kuniyamuthur'), | ||
('Ukkadam','Ukkadam'), | ||
('Gandhipuram','Gandhipuram'), | ||
('Sundharapuram','Sundharapuram'), | ||
) | ||
|
||
LOCATION=( | ||
('Kuniyamuthur','Kuniyamuthur'), | ||
('Ukkadam','Ukkadam'), | ||
('Gandhipuram','Gandhipuram'), | ||
('Sundharapuram','Sundharapuram'), | ||
) | ||
|
||
|
||
class BookingForm(forms.ModelForm): | ||
name=forms.CharField(widget=forms.TextInput(attrs={ | ||
'class':'form-control', | ||
'placeholder':'Your name', | ||
|
||
})) | ||
email=forms.EmailField(widget=forms.TextInput(attrs={ | ||
'class':'form-control', | ||
'placeholder':'Email address', | ||
'type':'email', | ||
|
||
})) | ||
phone=forms.CharField(widget=forms.TextInput(attrs={ | ||
'class':'form-control ', | ||
'placeholder':'Phone Number', | ||
|
||
})) | ||
passenger=forms.IntegerField(widget=forms.TextInput(attrs={ | ||
'class':'form-control', | ||
'placeholder':'Passenger Count', | ||
'type':'number', | ||
|
||
})) | ||
|
||
StartLocation = forms.ChoiceField(choices=FROM_LOCATION,required=True) | ||
ToLocation = forms.ChoiceField(choices=TO_LOCATION,required=True) | ||
|
||
class Meta: | ||
model=Booking | ||
fields=['name','email','phone','StartLocation','ToLocation','passenger'] | ||
|
||
class UserForm(forms.ModelForm): | ||
username=forms.CharField(widget=forms.TextInput(attrs={ | ||
'class':'form-control', | ||
'placeholder':'Your name', | ||
|
||
})) | ||
email=forms.EmailField(widget=forms.TextInput(attrs={ | ||
'class':'form-control', | ||
'placeholder':'Email address', | ||
'type':'email', | ||
|
||
})) | ||
|
||
password=forms.CharField(widget=forms.PasswordInput(attrs={ | ||
'class':'form-control', | ||
'placeholder':'Enter the password', | ||
})) | ||
|
||
class Meta: | ||
model=User | ||
fields=('username','email','password') | ||
|
||
|
||
class Driverform(forms.ModelForm): | ||
# name=forms.CharField(widget=forms.TextInput(attrs={ | ||
# 'class':'form-control', | ||
# 'placeholder':'Your name', | ||
# | ||
# })) | ||
|
||
phone=forms.CharField(widget=forms.TextInput(attrs={ | ||
'class':'form-control ', | ||
'placeholder':'Phone Number' | ||
|
||
})) | ||
|
||
lic_no=forms.IntegerField(widget=forms.TextInput(attrs={ | ||
'class':'form-control', | ||
'placeholder':'License Number', | ||
'type':'number', | ||
|
||
})) | ||
vehicle_no=forms.CharField(widget=forms.TextInput(attrs={ | ||
'class':'form-control ', | ||
'placeholder':'Vehicle No', | ||
|
||
})) | ||
|
||
Location = forms.ChoiceField(choices=LOCATION,required=True) | ||
|
||
|
||
|
||
|
||
class Meta: | ||
model=Driver | ||
fields=['phone','lic_no','vehicle_no','Location'] |
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,40 @@ | ||
# Generated by Django 3.0.3 on 2020-09-08 04:12 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Booking', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=255, null=True)), | ||
('email', models.EmailField(max_length=255, null=True)), | ||
('phone', models.CharField(max_length=20, null=True)), | ||
('passenger', models.IntegerField(null=True)), | ||
('StartLocation', models.CharField(choices=[('Kuniyamuthur', 'Kuniyamuthur'), ('Ukkadam', 'Ukkadam'), ('Gandhipuram', 'Gandhipuram'), ('Sundharapuram', 'Sundharapuram')], max_length=255, null=True)), | ||
('ToLocation', models.CharField(choices=[('Kuniyamuthur', 'Kuniyamuthur'), ('Ukkadam', 'Ukkadam'), ('Gandhipuram', 'Gandhipuram'), ('Sundharapuram', 'Sundharapuram')], max_length=255, null=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Driver', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('phone', models.CharField(blank=True, max_length=255, null=True)), | ||
('Location', models.CharField(blank=True, choices=[('Kuniyamuthur', 'Kuniyamuthur'), ('Ukkadam', 'Ukkadam'), ('Gandhipuram', 'Gandhipuram'), ('Sundharapuram', 'Sundharapuram')], max_length=255, null=True)), | ||
('lic_no', models.IntegerField(blank=True, null=True)), | ||
('vehicle_no', models.CharField(blank=True, max_length=255, null=True)), | ||
('user', models.OneToOneField(default='', null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
] |
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,17 @@ | ||
# Generated by Django 3.0.3 on 2020-09-08 04:36 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bookingapp', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='driver', | ||
name='user', | ||
), | ||
] |
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,31 @@ | ||
# Generated by Django 3.0.3 on 2020-09-10 03:26 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('bookingapp', '0002_remove_driver_user'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='driver', | ||
name='date_created', | ||
field=models.DateTimeField(auto_now_add=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='driver', | ||
name='user', | ||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AlterField( | ||
model_name='driver', | ||
name='Location', | ||
field=models.CharField(choices=[('Kuniyamuthur', 'Kuniyamuthur'), ('Ukkadam', 'Ukkadam'), ('Gandhipuram', 'Gandhipuram'), ('Sundharapuram', 'Sundharapuram')], max_length=255, null=True), | ||
), | ||
] |
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,22 @@ | ||
# Generated by Django 3.0.3 on 2020-09-10 03:43 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bookingapp', '0003_auto_20200910_0856'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='driver', | ||
name='date_created', | ||
), | ||
migrations.AddField( | ||
model_name='driver', | ||
name='name', | ||
field=models.CharField(max_length=200, null=True), | ||
), | ||
] |
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,18 @@ | ||
# Generated by Django 3.0.3 on 2020-09-10 03:49 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bookingapp', '0004_auto_20200910_0913'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='driver', | ||
name='email', | ||
field=models.EmailField(max_length=255, null=True), | ||
), | ||
] |
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,21 @@ | ||
# Generated by Django 3.0.3 on 2020-09-10 04:57 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bookingapp', '0005_driver_email'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='driver', | ||
name='email', | ||
), | ||
migrations.RemoveField( | ||
model_name='driver', | ||
name='name', | ||
), | ||
] |
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,66 @@ | ||
from django.db import models | ||
from django.contrib.auth.models import User | ||
# Create your models here. | ||
|
||
class Driver(models.Model): | ||
# name=models.CharField(max_length=255) | ||
# email=models.EmailField(max_length=255) | ||
# phone=models.CharField(max_length=255) | ||
# LOCATION=( | ||
# ('Kuniyamuthur','Kuniyamuthur'), | ||
# ('Ukkadam','Ukkadam'), | ||
# ('Gandhipuram','Gandhipuram'), | ||
# ('Sundharapuram','Sundharapuram'), | ||
# ) | ||
# Location=models.CharField(max_length=255,choices = LOCATION) | ||
# lic_no=models.IntegerField() | ||
# vehicle_no=models.CharField(max_length=255) | ||
# password=models.CharField(max_length=50) | ||
user=models.OneToOneField(User,on_delete=models.CASCADE,null=True) | ||
# user_id=models.CharField(max_length=10,null=True) | ||
# name=models.CharField(max_length=200,null=True) | ||
# email=models.EmailField(max_length=255,null=True) | ||
phone=models.CharField(max_length=255,null=True,blank=True) | ||
LOCATION=( | ||
('Kuniyamuthur','Kuniyamuthur'), | ||
('Ukkadam','Ukkadam'), | ||
('Gandhipuram','Gandhipuram'), | ||
('Sundharapuram','Sundharapuram'), | ||
) | ||
Location=models.CharField(max_length=255,choices = LOCATION,null=True) | ||
lic_no=models.IntegerField(null=True,blank=True) | ||
vehicle_no=models.CharField(max_length=255,null=True,blank=True) | ||
# date_created = models.DateTimeField(auto_now_add=True, null=True) | ||
|
||
|
||
|
||
# def user(self): | ||
# return User.objects.get(pk=self.user_id) | ||
|
||
def __str__(request): | ||
return str(request.user) | ||
|
||
|
||
class Booking(models.Model): | ||
name=models.CharField(max_length=255,null=True) | ||
email=models.EmailField(max_length=255,null=True) | ||
phone=models.CharField(max_length=20,null=True) | ||
passenger=models.IntegerField(null=True) | ||
FROM_LOCATION=( | ||
('Kuniyamuthur','Kuniyamuthur'), | ||
('Ukkadam','Ukkadam'), | ||
('Gandhipuram','Gandhipuram'), | ||
('Sundharapuram','Sundharapuram'), | ||
) | ||
StartLocation=models.CharField(max_length=255,null=True,choices = FROM_LOCATION) | ||
TO_LOCATION=( | ||
('Kuniyamuthur','Kuniyamuthur'), | ||
('Ukkadam','Ukkadam'), | ||
('Gandhipuram','Gandhipuram'), | ||
('Sundharapuram','Sundharapuram'), | ||
) | ||
ToLocation=models.CharField(max_length=255,null=True,choices = TO_LOCATION) | ||
|
||
|
||
def __str__(self): | ||
return self.name |
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,13 @@ | ||
from django.urls import path | ||
from bookingapp import views | ||
|
||
|
||
urlpatterns = [ | ||
path('',views.index,name='index'), | ||
path('contact.html',views.contact,name='contact'), | ||
path('driver.html',views.driver,name='driver'), | ||
path('details/',views.bookingdetails,name='details'), | ||
path('driverdetails/',views.driverdetails,name='driverdetails'), | ||
path('login/',views.loginform,name='login'), | ||
path('logout/',views.logoutform,name='logout'), | ||
] |
Oops, something went wrong.