Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
b5ebb84
Add PilotCertification model and related views, forms, and templates
dcccalvin Mar 12, 2025
3e22ed0
Add SVG icons for certifications and update certification view template
dcccalvin Mar 13, 2025
274c3c8
Add alt attributes to SVG icons in certification view template
dcccalvin Mar 13, 2025
e05c9b2
Update compiled Python
dcccalvin Mar 13, 2025
943c995
Update pilot certification template and enhance default values in view
dcccalvin Mar 13, 2025
0626750
Update date,fuel validity affirmed Date-time Validity #12
dcccalvin Mar 13, 2025
1432914
Enhance date validation in log form and update input type to datetime…
dcccalvin Mar 13, 2025
1a2667c
Update SQLite database file to reflect recent changes
dcccalvin Mar 13, 2025
2178a25
Add footer and update navbar link in base templates
dcccalvin Mar 14, 2025
3dde9bc
Add new images and styles for landing page design
dcccalvin Mar 14, 2025
b196a52
Add hover effects to cards and new SVG icons for search, delete, and …
dcccalvin Mar 14, 2025
cbb98ab
Add margin-top to card columns for improved layout spacing on home page
dcccalvin Mar 14, 2025
6d05d48
Add training record management features and update related models
dcccalvin Mar 15, 2025
c270e90
Add training record link to navigation in base templates
dcccalvin Mar 15, 2025
8e9ef9b
Add logout link to navigation in home template
dcccalvin Mar 15, 2025
4e7820a
Add logout link and update navigation items in base templates
dcccalvin Mar 15, 2025
0941591
Improve layout spacing by adding margin classes to certification card…
dcccalvin Mar 15, 2025
c23e16a
Add "View Certifications" button to pilot certification page
dcccalvin Mar 15, 2025
d12a0f8
Add "Add New" button to training records list and adjust layout
dcccalvin Mar 15, 2025
00e7a96
Addresses #22 completely
dcccalvin Mar 16, 2025
3f72bd3
Update:modiffied register html form
dcccalvin Mar 16, 2025
114833d
db update
dcccalvin Mar 16, 2025
abffc5f
Refactor login and registration templates for improved layout and sty…
dcccalvin Mar 16, 2025
e66a316
Update database schema
dcccalvin Mar 16, 2025
03a4694
Enhance log list UI with improved button labels and search functional…
dcccalvin Mar 16, 2025
8637ea2
Enhance edit log form with improved error handling and additional fields
dcccalvin Mar 16, 2025
96f26d8
Enhance edit log form with additional fields for aircraft details and…
dcccalvin Mar 16, 2025
ccb10fb
Enhance edit log title styling for better visibility
dcccalvin Mar 16, 2025
c925c26
#26
dcccalvin Mar 16, 2025
c48f294
Update compiled Python bytecode for views module
dcccalvin Mar 16, 2025
e43a043
Enhance user greeting in PDF generation and HTML template for flight …
dcccalvin Mar 16, 2025
bc3d63f
Update database
dcccalvin Mar 16, 2025
4a3a241
Enhance additional info form with improved input fields and error han…
dcccalvin Mar 17, 2025
ea72575
Enhance training record forms with improved input fields, error handl…
dcccalvin Mar 17, 2025
e5ce945
Update database file
dcccalvin Mar 17, 2025
1403cce
Enhance registration form with password guidelines for improved user …
dcccalvin Mar 17, 2025
f52327a
Add logout confirmation modal to enhance user experience
dcccalvin Mar 17, 2025
655d2b8
Update database file to reflect recent changes
dcccalvin Mar 17, 2025
c28e3db
Update database file to incorporate recent modifications
dcccalvin Mar 19, 2025
901c89f
Refactor user registration view for improved code readability
dcccalvin Mar 19, 2025
9a731b5
Update binary files for database and cached views
dcccalvin Mar 20, 2025
2c8d55d
Create README.md
dcccalvin Mar 20, 2025
5d11b7c
Update README.md
dcccalvin Mar 20, 2025
a191725
Update README.md
dcccalvin Mar 20, 2025
9c5444d
Create django.yml
dcccalvin Mar 22, 2025
9cedb0a
Update django.yml
dcccalvin Mar 22, 2025
cb22d15
Update button styles in log list template for better alignment
dcccalvin Mar 25, 2025
ecc7766
Update registration template to clarify username requirements
dcccalvin Mar 25, 2025
69c66c8
Update registration template to provide detailed username requirements
dcccalvin Mar 28, 2025
56ddebc
Update compiled test file in __pycache__ directory
dcccalvin Mar 28, 2025
79c3f07
Update database file to reflect recent changes
dcccalvin Mar 31, 2025
0a3028f
Update django.yml
dcccalvin Mar 31, 2025
c696583
Update django.yml
dcccalvin Mar 31, 2025
6a85a22
Update django.yml
dcccalvin Mar 31, 2025
120930d
Update django.yml
dcccalvin Mar 31, 2025
59fc0ae
Remove Django CI workflow configuration
dcccalvin Mar 31, 2025
708cd54
Update home.html to change 'Download Records' to 'Download Reports'
dcccalvin Mar 31, 2025
3c9a9e5
Update database file to reflect recent changes
dcccalvin Apr 2, 2025
12970a7
Update database file to reflect recent changes
dcccalvin Apr 2, 2025
cf34b2e
Update README.md
dcccalvin Apr 2, 2025
2f83829
Update README
dcccalvin Apr 8, 2025
c6ca0d2
deleed unnecessary empty spacelines
dcccalvin Apr 8, 2025
86b2ade
Database schema to readme
dcccalvin Apr 8, 2025
c5a577f
Remove commented placeholder for aircraft registration validator in L…
dcccalvin Apr 8, 2025
75bec71
Merge pull request #32 from dcccalvin/README-opt
dcccalvin Apr 8, 2025
0826031
Add summary report PDF generation for user flight logs
dcccalvin Apr 9, 2025
5029c10
Add link to download summary report in PDF generation page
dcccalvin Apr 9, 2025
fb4d009
Add missing closing anchor tag for summary report download button in …
dcccalvin Apr 9, 2025
0c08e67
Add summary report PDF generation with training sessions count and up…
dcccalvin Apr 9, 2025
ba17e47
Update compiled Python bytecode for views module
dcccalvin Apr 9, 2025
a8ebf5b
Merge pull request #33 from dcccalvin/reports
dcccalvin Apr 9, 2025
6bfebe5
Update compiled Python files in __pycache__ for logs module
dcccalvin Apr 9, 2025
3c836d8
Add summary report PDF generation and update URLs
dcccalvin Apr 9, 2025
e55e15c
Add initial README.md with project overview, features, technologies, …
dcccalvin Apr 10, 2025
337b06e
Update binary files for database and compiled Python modules
dcccalvin Apr 11, 2025
63a7eaa
Update README.md
dcccalvin Apr 12, 2025
be58257
Add README.md for logs directory
dcccalvin Apr 29, 2025
3b6445c
Revise README.md for clarity and structure; enhance features section …
dcccalvin May 15, 2025
c5145d5
Add requirements.txt with essential dependencies for the project
dcccalvin May 15, 2025
dea106d
Add .gitignore to exclude SQLite database files
dcccalvin May 20, 2025
7f0e6c1
Update .gitignore to include additional Python/Django files and remov…
dcccalvin May 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Pilot_Logbook/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Python / Django
__pycache__/
*.pyc
*.pyo
*.pyd
db.sqlite3
*.log

# Virtual envs
venv/
env/

# Django secrets
.env

# JSON files with data
*.json


*/migrations/*.py
*/migrations/*.pyc
!*/migrations/__init__.py
Binary file modified Pilot_Logbook/Pilot_Logbook/__pycache__/settings.cpython-313.pyc
Binary file not shown.
87 changes: 87 additions & 0 deletions Pilot_Logbook/Pilot_Logbook/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# ✈️ Pilot Logbook Management System 📝

A **web-based application** designed for pilots to log flights, manage certifications, track training records, and generate log reports. This system prioritizes user-friendly design, modular development, and secure data handling.

---

## ✨ **Features**
- 🔒 **User Authentication**: Register and log in securely.
- 🛫 **Flight Logs**: Add, view, edit, and delete detailed flight logs.
- 🧾 **Pilot Certification**: Manage single pilot certification with editable details.
- 🎓 **Training Records**: Track and manage your training records.
- 📄 **Report Generation**: Generate and download flight log reports in PDF format.
- ❌ **Error Handling**: Friendly messages for invalid inputs and errors.

---

## 🛠️ **Technologies Used**
- **Backend**: Django Framework (4.2)
- **Frontend**: Bootstrap (4)
- **Database**: SQLite
- **Language**: Python (3.13)

---

## 🚀 **Getting Started**

### Clone the Repository
```bash
git clone https://github.com/dcccalvin/logbook_project.git
```

### Navigate into the Project Directory
```bash
cd pilot_logbook
```

### Apply Migrations
```bash
python manage.py migrate
```

### Start the Server
```bash
python manage.py runserver
```

### Access the Application
Open your browser and navigate to [http://127.0.0.1:8000](http://127.0.0.1:8000) to access the application.

---

## 📚 Usage

### Register/Login
Create an account or log in to access the dashboard.

### Flight Logs
Add, edit, or delete your flight records with ease.

### Pilot Certification
Update and manage your single certification.

### Training Records
Track and update your training history.

### Report Generation
Download flight log reports in PDF format for documentation.

---

## Database
### Database schema
This is the schema for the database
![Database schema](<corrected schema.png>)

---


## 🤝 **Contributing**
We welcome contributions from the community! Here’s how you can help:

- **Fork the Repository**: Create your own copy and experiment freely.
- **Submit Pull Requests**: Improve features, fix bugs, or enhance the documentation.
- **Report Issues**: Found a bug or have a feature request? Open an issue.
- **Enhance Documentation**: Help us keep the docs up to date.

Your contributions are greatly appreciated! 🚀
18 changes: 16 additions & 2 deletions Pilot_Logbook/Pilot_Logbook/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,27 @@
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

from decouple import config

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'ENGINE': 'django.db.backends.mysql',
'NAME': config('DB_NAME'),
'USER': config('DB_USER'),
'PASSWORD': config('DB_PASSWORD'),
'HOST': config('DB_HOST'),
'PORT': config('DB_PORT'),
}
}

# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': BASE_DIR / 'db.sqlite3',
# }
# }



# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
Expand Down
Binary file not shown.
Binary file added Pilot_Logbook/attachments/Flight_logbook_2.pdf
Binary file not shown.
Binary file added Pilot_Logbook/attachments/Flight_logbook_7.pdf
Binary file not shown.
Binary file modified Pilot_Logbook/db.sqlite3
Binary file not shown.
16 changes: 16 additions & 0 deletions Pilot_Logbook/logs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Pilot Logbook

This directory contains logs for the Pilot Logbook project. The logs are used to track and document various activities, events, and data related to the project.

### Contents

- **Flight Logs**: Detailed records of flight activities.
- **Maintenance Logs**: Information about maintenance schedules and performed tasks.
- **Training Logs**: Documentation of pilot training sessions and progress.

### Usage

1. Navigate to the appropriate log file for the desired information.
2. Update logs as necessary to ensure accurate and up-to-date records.
3. Follow the project guidelines for formatting and maintaining log entries.

Binary file modified Pilot_Logbook/logs/__pycache__/admin.cpython-313.pyc
Binary file not shown.
Binary file modified Pilot_Logbook/logs/__pycache__/forms.cpython-313.pyc
Binary file not shown.
Binary file modified Pilot_Logbook/logs/__pycache__/models.cpython-313.pyc
Binary file not shown.
Binary file modified Pilot_Logbook/logs/__pycache__/urls.cpython-313.pyc
Binary file not shown.
Binary file modified Pilot_Logbook/logs/__pycache__/views.cpython-313.pyc
Binary file not shown.
9 changes: 8 additions & 1 deletion Pilot_Logbook/logs/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
from django.contrib import admin
from .models import Log
from .models import Log, PilotCertification, TrainingRecord, FlightCrewAssignment, WeatherReport, EmergencyIncident, MaintenanceReport, FlightAttachment
# Register your models here.

admin.site.register(Log)
admin.site.register(PilotCertification)
admin.site.register(TrainingRecord)
admin.site.register(FlightCrewAssignment)
admin.site.register(WeatherReport)
admin.site.register(EmergencyIncident)
admin.site.register(MaintenanceReport)
admin.site.register(FlightAttachment)
84 changes: 84 additions & 0 deletions Pilot_Logbook/logs/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
from django import forms
from .models import Log
from .models import PilotCertification, TrainingRecord, FlightCrewAssignment, WeatherReport, EmergencyIncident, MaintenanceReport, FlightAttachment
from django.contrib.auth.models import User
from django.utils import timezone
from django.utils.timezone import now
from django.utils.dateparse import parse_datetime
from django.core.exceptions import ValidationError

class LogForm(forms.ModelForm):
class Meta:
Expand All @@ -8,3 +14,81 @@ class Meta:
'departure_airport', 'arrival_airport', 'flight_time',
'souls_on_board', 'fuel_on_departure', 'fuel_on_arrival',
'remarks', 'purpose', 'flight_type', 'safety_concerns']
def clean_date(self):
date_str = self.cleaned_data.get('date') # Get the raw input

if isinstance(date_str, str):
date = parse_datetime(date_str) # Convert string to datetime
else:
date = date_str # Use as-is if already a datetime object

if not date: # Ensure valid datetime
raise ValidationError("Invalid date format. Please use YYYY-MM-DD HH:MM.")


if date > now(): # Ensure the date is not in the future
raise ValidationError("The date cannot be in the future.")

return date

def clean(self):
cleaned_data = super().clean()
fuel_on_departure = cleaned_data.get("fuel_on_departure")
fuel_on_arrival = cleaned_data.get("fuel_on_arrival")

if fuel_on_departure is not None and fuel_on_arrival is not None:
if fuel_on_arrival > fuel_on_departure:
raise forms.ValidationError("Fuel on arrival cannot be more than fuel on departure.")
return cleaned_data

class PilotCertificationForm(forms.ModelForm):
class Meta:
model = PilotCertification
fields = ['medical_class', 'medical_certificate_number','medical_certificate_issue_date',
'medical_certificate_expiry_date','license_type','license_number',
'license_issue_date','license_expiry_date','engine_rating','instrument_rating',
'night_rating'
]
def clean(self):
cleaned_data = super().clean()
if cleaned_data['medical_certificate_issue_date'] > cleaned_data['medical_certificate_expiry_date']:
raise ValidationError("Medical certificate issue date cannot be after expiry date.")
if cleaned_data['license_issue_date'] > cleaned_data['license_expiry_date']:
raise ValidationError("License issue date cannot be after expiry date.")

return cleaned_data


class TrainingRecordForm(forms.ModelForm):
class Meta:
model = TrainingRecord
fields = ['training_type', 'completion_date', 'instructor_name']

class FlightCrewAssignmentForm(forms.ModelForm):
class Meta:
model = FlightCrewAssignment
fields = ['role','number_of_crew']

class WeatherReportForm(forms.ModelForm):
class Meta:
model = WeatherReport
fields = ['weather_conditions', 'temperature', 'wind_speed']

class EmergencyIncidentForm(forms.ModelForm):
class Meta:
model = EmergencyIncident
fields = ['incident_type','actions_taken','outcome' ]



class FlightAttachmentForm(forms.ModelForm):
class Meta:
model = FlightAttachment
fields = ['file', 'description']

class MaintenanceReportForm(forms.ModelForm):
class Meta:
model = MaintenanceReport
fields = ['aircraft_registration','issue_reported','fix_details']


34 changes: 34 additions & 0 deletions Pilot_Logbook/logs/migrations/0008_pilot_certification.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 4.2 on 2025-03-12 12:10

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),
('logs', '0007_alter_log_date'),
]

operations = [
migrations.CreateModel(
name='Pilot_Certification',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('medical_class', models.CharField(choices=[('Class 1', 'Class 1'), ('Class 2', 'Class 2'), ('Class 3', 'Class 3')], max_length=20)),
('medical_certificate_number', models.CharField(max_length=20)),
('medical_certificate_issue_date', models.DateField()),
('medical_certificate_expiry_date', models.DateField()),
('license_type', models.CharField(choices=[('PPL', 'PPL'), ('CPL', 'CPL'), ('ATPL', 'ATPL')], max_length=20)),
('license_number', models.CharField(max_length=20)),
('license_issue_date', models.DateField()),
('license_expiry_date', models.DateField()),
('engine_rating', models.CharField(choices=[('Single Engine', 'Single Engine'), ('Multi Engine', 'Multi Engine')], max_length=20)),
('instrument_rating', models.CharField(choices=[('Yes', 'Yes'), ('No', 'No')], max_length=20)),
('night_rating', models.CharField(choices=[('Yes', 'Yes'), ('No', 'No')], max_length=20)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2 on 2025-03-12 12:12

from django.conf import settings
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('logs', '0008_pilot_certification'),
]

operations = [
migrations.RenameModel(
old_name='Pilot_Certification',
new_name='PilotCertification',
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Generated by Django 4.2 on 2025-03-15 07:35

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),
('logs', '0009_rename_pilot_certification_pilotcertification'),
]

operations = [
migrations.CreateModel(
name='MaintenanceReport',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('aircraft_registration', models.CharField(max_length=100)),
('maintenance_date', models.DateField()),
('issue_reported', models.TextField()),
('fix_details', models.TextField()),
],
),
migrations.CreateModel(
name='WeatherReport',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('weather_conditions', models.CharField(max_length=100)),
('wind_speed', models.IntegerField()),
('temperature', models.FloatField()),
('log_entry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='logs.log')),
],
),
migrations.CreateModel(
name='TrainingRecord',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('training_type', models.CharField(max_length=100)),
('completion_date', models.DateField()),
('instructor_name', models.CharField(max_length=100)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='FlightCrewAssignment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('role', models.CharField(choices=[('Captain', 'Captain'), ('First Officer', 'First Officer'), ('Instructor', 'Instructor')], max_length=50)),
('log_entry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='logs.log')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='FlightAttachment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('file', models.FileField(upload_to='attachments/')),
('description', models.TextField(blank=True, null=True)),
('log_entry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='logs.log')),
],
),
migrations.CreateModel(
name='EmergencyIncident',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('incident_type', models.CharField(max_length=100)),
('actions_taken', models.TextField()),
('outcome', models.TextField()),
('log_entry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='logs.log')),
],
),
]
Loading