-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bus cancellation view amended to allow cancellation by ID
- Loading branch information
Showing
48 changed files
with
328 additions
and
89 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,8 @@ | ||
{% extends "myapp/base.html" %} | ||
{% block content %} | ||
<div class="jumbotron"> | ||
<h3> | ||
This is a simple Python Django Booking Reservation system that allows users create an account and log in, logout, search Buses, Book buses, Cancel reservation and view all Booking related information. It is still work in progress especially the UI. | ||
</h3> | ||
</div> | ||
{% endblock content %} |
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 was deleted.
Oops, something went wrong.
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
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
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
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,29 @@ | ||
beautifulsoup4==4.8.0 | ||
dj-database-url==0.5.0 | ||
Django==2.0.7 | ||
django-authtools==1.7.0 | ||
django-booking==0.7.2 | ||
django-bootstrap==0.2.4 | ||
django-bootstrap4==1.0.1 | ||
django-braces==1.13.0 | ||
django-countries==5.4 | ||
django-crispy-forms==1.7.2 | ||
django-fontawesome==1.0 | ||
django-heroku==0.3.1 | ||
django-hosts==3.0 | ||
django-hvad==1.8.0 | ||
django-libs==2.0.2 | ||
django-static-fontawesome==5.0.8.1 | ||
django-widget-tweaks==1.4.2 | ||
djangorestframework==3.10.3 | ||
gunicorn==19.9.0 | ||
Pillow==6.1.0 | ||
psycopg2==2.7.5 | ||
psycopg2-binary==2.8.3 | ||
python-dateutil==2.8.0 | ||
pytz==2018.5 | ||
PyYAML==5.1.2 | ||
six==1.12.0 | ||
soupsieve==1.9.3 | ||
sqlparse==0.3.0 | ||
whitenoise==3.3.1 |
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 @@ | ||
default_app_config = 'users.apps.UsersConfig' |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,4 @@ | ||
from django.contrib import admin | ||
from .models import Profile | ||
|
||
admin.site.register(Profile) |
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,8 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class UsersConfig(AppConfig): | ||
name = 'users' | ||
|
||
def ready(self): | ||
import users.signals |
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 @@ | ||
from django import forms | ||
from django.contrib.auth.models import User | ||
from django.contrib.auth.forms import UserCreationForm | ||
from .models import Profile | ||
|
||
|
||
|
||
class UserRegisterForm(UserCreationForm): | ||
email = forms.EmailField() | ||
|
||
|
||
class Meta: | ||
model = User | ||
fields = ['username', 'email', 'password1', 'password2'] | ||
|
||
|
||
class UserUpdateForm(forms.ModelForm): | ||
email = forms.EmailField() | ||
|
||
|
||
|
||
class Meta: | ||
model = User | ||
fields = ['username', 'email',] | ||
|
||
|
||
class ProfileUpdateForm(forms.ModelForm): | ||
|
||
class Meta: | ||
model = Profile | ||
fields = ['image',] |
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,25 @@ | ||
# Generated by Django 2.0.7 on 2019-09-07 11:36 | ||
|
||
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='Profile', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('image', models.ImageField(default='default.jpg', upload_to='profile_pics')), | ||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
] |
Empty file.
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,21 @@ | ||
from django.db import models | ||
from django.contrib.auth.models import User | ||
from PIL import Image | ||
|
||
|
||
class Profile(models.Model): | ||
user = models.OneToOneField(User, on_delete=models.CASCADE) | ||
image = models.ImageField(default='default.jpg', upload_to='profile_pics') | ||
|
||
def __str__(self): | ||
return f'{self.user.username} Profile' | ||
|
||
def save(self, *args, **kwargs): | ||
super().save(*args, **kwargs) | ||
|
||
img = Image.open(self.image.path) | ||
|
||
if img.height > 300 or img.width > 300: | ||
output_size = (300, 300) | ||
img.thumbnail(output_size) | ||
img.save(self.image.path) |
Oops, something went wrong.