first commit

This commit is contained in:
2024-12-10 10:32:13 -03:00
commit 78a4cb3c37
6881 changed files with 843683 additions and 0 deletions

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class ProductsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'products'

View File

@@ -0,0 +1,27 @@
# Generated by Django 5.1.4 on 2024-12-10 01:18
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('categories', '0002_rename_category_categories'),
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('description', models.TextField(blank=True, null=True)),
('price', models.DecimalField(decimal_places=2, max_digits=10)),
('active', models.BooleanField(default=True)),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='categories.categories')),
],
),
]

View File

@@ -0,0 +1,15 @@
from django.db import models
from categories.models import Categories
# Create your models here.
class Product(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=100)
description = models.TextField(null=True, blank=True)
price = models.DecimalField(max_digits=10, decimal_places=2)
category = models.ForeignKey(Categories, on_delete=models.CASCADE)
active = models.BooleanField(default=True)
def __str__(self) -> str:
return self.name

View File

@@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block 'title' %}
Type Pay
{% endblock %}
{% block 'body' %}
Body Type Pay
{% endblock %}

View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@@ -0,0 +1,10 @@
from django.urls import path, include
from . import views
urlpatterns = [
path('', views.products, name='products'),
]

View File

@@ -0,0 +1,5 @@
from django.shortcuts import render
def products(request):
return render(request, 'products.html')