diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..0469b92 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 9aa598b..35b52a7 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 6867ddf..6db9621 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..70af60a 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin +from .models import Business, Product -# Register your models here. +admin.site.register(Business) +admin.site.register(Product) \ No newline at end of file diff --git a/core/models.py b/core/models.py index 71a8362..c1ff4a0 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,20 @@ from django.db import models +from django.contrib.auth.models import User -# Create your models here. +class Business(models.Model): + owner = models.ForeignKey(User, on_delete=models.CASCADE) + name = models.CharField(max_length=255) + description = models.TextField() + logo = models.ImageField(upload_to='business_logos/', null=True, blank=True) + + def __str__(self): + return self.name + +class Product(models.Model): + business = models.ForeignKey(Business, on_delete=models.CASCADE) + name = models.CharField(max_length=255) + description = models.TextField() + price = models.DecimalField(max_digits=10, decimal_places=2) + + def __str__(self): + return self.name \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..4bba1e1 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,40 @@ -import os -import platform - -from django import get_version as django_version from django.shortcuts import render -from django.utils import timezone - - -def home(request): - """Render the landing screen with loader and environment details.""" - host_name = request.get_host().lower() - agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic" - now = timezone.now() +def index(request): + # Dummy data for businesses + dummy_businesses = [ + { + 'name': 'BizOne', + 'description': 'The first of many amazing businesses on this platform.', + 'logo_url': 'https://via.placeholder.com/150' + }, + { + 'name': 'Shoply', + 'description': 'Your one-stop shop for all things great and small.', + 'logo_url': 'https://via.placeholder.com/150' + }, + { + 'name': 'Artisan Goods', + 'description': 'Hand-crafted items made with love and care.', + 'logo_url': 'https://via.placeholder.com/150' + }, + { + 'name': 'Tech Innovate', + 'description': 'Cutting-edge solutions for a modern world.', + 'logo_url': 'https://via.placeholder.com/150' + }, + { + 'name': 'Gourmet Bites', + 'description': 'Delicious treats that will make your day.', + 'logo_url': 'https://via.placeholder.com/150' + }, + { + 'name': 'Fashion Forward', + 'description': 'The latest trends, delivered to your door.', + 'logo_url': 'https://via.placeholder.com/150' + } + ] context = { - "project_name": "New Style", - "agent_brand": agent_brand, - "django_version": django_version(), - "python_version": platform.python_version(), - "current_time": now, - "host_name": host_name, - "project_description": os.getenv("PROJECT_DESCRIPTION", ""), - "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), + 'businesses': dummy_businesses } - return render(request, "core/index.html", context) + return render(request, "core/index.html", context) \ No newline at end of file