diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index e061640..d478b94 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 5a69659..e648d63 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 2a36fd6..16e44f5 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..b4e487a --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# Generated by Django 5.2.7 on 2026-01-21 10:54 + +import django.utils.timezone +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Farm', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=200, verbose_name='Farm Name')), + ('owner_name', models.CharField(max_length=200, verbose_name='Owner Name')), + ('location', models.CharField(max_length=300, verbose_name='Location/Address')), + ('size_hectares', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Size (Hectares)')), + ('registration_date', models.DateTimeField(default=django.utils.timezone.now)), + ('status', models.CharField(choices=[('active', 'Active'), ('pending', 'Pending Inspection'), ('suspended', 'Suspended')], default='pending', max_length=20)), + ], + ), + ] 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..ea16b23 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..8031932 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,22 @@ from django.db import models +from django.utils import timezone -# Create your models here. +class Farm(models.Model): + STATUS_CHOICES = [ + ('active', 'Active'), + ('pending', 'Pending Inspection'), + ('suspended', 'Suspended'), + ] + + name = models.CharField(max_length=200, verbose_name="Farm Name") + owner_name = models.CharField(max_length=200, verbose_name="Owner Name") + location = models.CharField(max_length=300, verbose_name="Location/Address") + size_hectares = models.DecimalField(max_digits=10, decimal_places=2, verbose_name="Size (Hectares)") + registration_date = models.DateTimeField(default=timezone.now) + status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='pending') + + # Placeholder for future relation to User + # owner = models.ForeignKey(User, on_delete=models.CASCADE) + + def __str__(self): + return self.name \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..43239e1 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,106 @@ +{% load static %} -
- -