diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..7a88848 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..ba490e0 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 9aa598b..e90c69b 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fa..ff8e2b9 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf..ba79e6d 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..8eb13df 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,4 @@ from django.contrib import admin +from .models import Contact -# Register your models here. +admin.site.register(Contact) \ No newline at end of file diff --git a/core/forms.py b/core/forms.py new file mode 100644 index 0000000..183f4cb --- /dev/null +++ b/core/forms.py @@ -0,0 +1,7 @@ +from django import forms +from .models import Contact + +class ContactForm(forms.ModelForm): + class Meta: + model = Contact + fields = ['first_name', 'last_name', 'email', 'phone', 'company', 'status'] diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..44b5db9 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 5.2.7 on 2025-12-19 12:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Contact', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('first_name', models.CharField(max_length=100)), + ('last_name', models.CharField(max_length=100)), + ('email', models.EmailField(max_length=254)), + ('phone', models.CharField(blank=True, max_length=20)), + ('company', models.CharField(blank=True, max_length=100)), + ('status', models.CharField(choices=[('Lead', 'Lead'), ('Contacted', 'Contacted'), ('Customer', 'Customer'), ('Lost', 'Lost')], default='Lead', max_length=20)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + ), + ] 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..dd0a06a 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..9c7d86b 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,21 @@ from django.db import models -# Create your models here. +class Contact(models.Model): + STATUS_CHOICES = [ + ('Lead', 'Lead'), + ('Contacted', 'Contacted'), + ('Customer', 'Customer'), + ('Lost', 'Lost'), + ] + + first_name = models.CharField(max_length=100) + last_name = models.CharField(max_length=100) + email = models.EmailField() + phone = models.CharField(max_length=20, blank=True) + company = models.CharField(max_length=100, blank=True) + status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='Lead') + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return f"{self.first_name} {self.last_name}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..ef53b17 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,33 @@ -
- -