diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index 7d80990..3940cbd 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index ca4aa1e..5757015 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 d947244..01b28fe 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 093feca..724d9a1 100644 --- a/core/admin.py +++ b/core/admin.py @@ -3,7 +3,7 @@ from .models import Parcel @admin.register(Parcel) class ParcelAdmin(admin.ModelAdmin): - list_display = ('tracking_number', 'sender_name', 'recipient_name', 'status', 'assignee', 'received_date') - list_filter = ('status', 'assignee', 'received_date') - search_fields = ('tracking_number', 'sender_name', 'recipient_name', 'sender_email', 'recipient_email') + list_display = ('tracking_number', 'sender_name', 'recipient_name', 'status', 'assignee_first_name', 'assignee_last_name', 'received_date') + list_filter = ('status', 'assignee_first_name', 'assignee_last_name', 'received_date') + search_fields = ('tracking_number', 'sender_name', 'recipient_name', 'sender_email', 'recipient_email', 'assignee_first_name', 'assignee_last_name') ordering = ('-received_date',) \ No newline at end of file diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py index 71f4da9..7bb33a6 100644 --- a/core/migrations/0001_initial.py +++ b/core/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.2.7 on 2026-01-11 15:58 +# Generated by Django 5.2.7 on 2026-01-11 16:23 from django.db import migrations, models @@ -21,7 +21,8 @@ class Migration(migrations.Migration): ('recipient_email', models.EmailField(max_length=254)), ('tracking_number', models.CharField(max_length=100, unique=True)), ('status', models.CharField(choices=[('pending', 'Pending'), ('processed', 'Processed'), ('rejected', 'Rejected')], default='pending', max_length=20)), - ('assignee', models.CharField(blank=True, max_length=100, null=True)), + ('assignee_first_name', models.CharField(blank=True, max_length=100, null=True)), + ('assignee_last_name', models.CharField(blank=True, max_length=100, null=True)), ('received_date', models.DateTimeField()), ], ), diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc index e01b424..00dbf4a 100644 Binary files a/core/migrations/__pycache__/0001_initial.cpython-311.pyc and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 4924dee..bd9aa0a 100644 --- a/core/models.py +++ b/core/models.py @@ -13,7 +13,8 @@ class Parcel(models.Model): recipient_email = models.EmailField() tracking_number = models.CharField(max_length=100, unique=True) status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='pending') - assignee = models.CharField(max_length=100, blank=True, null=True) + assignee_first_name = models.CharField(max_length=100, blank=True, null=True) + assignee_last_name = models.CharField(max_length=100, blank=True, null=True) received_date = models.DateTimeField() def __str__(self): @@ -26,4 +27,10 @@ class Parcel(models.Model): if len(parts) > 1: return (parts[0][0] + parts[-1][0]).upper() return parts[0][0].upper() - return "?" \ No newline at end of file + return "?" + + @property + def assignee_initials(self): + if self.assignee_first_name and self.assignee_last_name: + return (self.assignee_first_name[0] + self.assignee_last_name[0]).upper() + return "A" \ No newline at end of file diff --git a/core/templates/core/index.html b/core/templates/core/index.html index c2ad44c..effc754 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -30,13 +30,8 @@ {% for parcel in parcels %}