diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index a5ed392..9b9ba49 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc new file mode 100644 index 0000000..906cdad Binary files /dev/null and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index e061640..c3d3b31 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 2a36fd6..b80d713 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 8c38f3f..c6e7dd2 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,9 @@ from django.contrib import admin +from .models import Booking -# Register your models here. +@admin.register(Booking) +class BookingAdmin(admin.ModelAdmin): + list_display = ('name', 'email', 'company', 'created_at') + list_filter = ('created_at',) + search_fields = ('name', 'email', 'company', 'message') + readonly_fields = ('created_at',) \ No newline at end of file diff --git a/core/forms.py b/core/forms.py new file mode 100644 index 0000000..654fd9d --- /dev/null +++ b/core/forms.py @@ -0,0 +1,13 @@ +from django import forms +from .models import Booking + +class BookingForm(forms.ModelForm): + class Meta: + model = Booking + fields = ['name', 'email', 'company', 'message'] + widgets = { + 'name': forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Your Name'}), + 'email': forms.EmailInput(attrs={'class': 'form-control', 'placeholder': 'Your Email'}), + 'company': forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Company Name (Optional)'}), + 'message': forms.Textarea(attrs={'class': 'form-control', 'placeholder': 'How can we help you?', 'rows': 4}), + } diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..9900de9 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 5.2.7 on 2026-02-13 20:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Booking', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('email', models.EmailField(max_length=254)), + ('company', models.CharField(blank=True, max_length=255)), + ('message', models.TextField()), + ('created_at', models.DateTimeField(auto_now_add=True)), + ], + options={ + 'ordering': ['-created_at'], + }, + ), + ] diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..bd6a985 Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..289a74c 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,14 @@ from django.db import models -# Create your models here. +class Booking(models.Model): + name = models.CharField(max_length=255) + email = models.EmailField() + company = models.CharField(max_length=255, blank=True) + message = models.TextField() + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"Booking from {self.name} ({self.company})" + + class Meta: + ordering = ['-created_at'] \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..2151669 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,72 @@ +{% load static %} -
- -