mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-07 06:24:12 +00:00
first commit
This commit is contained in:
0
gestaoRaul/products/__init__.py
Normal file
0
gestaoRaul/products/__init__.py
Normal file
BIN
gestaoRaul/products/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
gestaoRaul/products/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
gestaoRaul/products/__pycache__/admin.cpython-310.pyc
Normal file
BIN
gestaoRaul/products/__pycache__/admin.cpython-310.pyc
Normal file
Binary file not shown.
BIN
gestaoRaul/products/__pycache__/apps.cpython-310.pyc
Normal file
BIN
gestaoRaul/products/__pycache__/apps.cpython-310.pyc
Normal file
Binary file not shown.
BIN
gestaoRaul/products/__pycache__/models.cpython-310.pyc
Normal file
BIN
gestaoRaul/products/__pycache__/models.cpython-310.pyc
Normal file
Binary file not shown.
BIN
gestaoRaul/products/__pycache__/urls.cpython-310.pyc
Normal file
BIN
gestaoRaul/products/__pycache__/urls.cpython-310.pyc
Normal file
Binary file not shown.
BIN
gestaoRaul/products/__pycache__/views.cpython-310.pyc
Normal file
BIN
gestaoRaul/products/__pycache__/views.cpython-310.pyc
Normal file
Binary file not shown.
3
gestaoRaul/products/admin.py
Normal file
3
gestaoRaul/products/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
gestaoRaul/products/apps.py
Normal file
6
gestaoRaul/products/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ProductsConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'products'
|
||||
27
gestaoRaul/products/migrations/0001_initial.py
Normal file
27
gestaoRaul/products/migrations/0001_initial.py
Normal 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')),
|
||||
],
|
||||
),
|
||||
]
|
||||
0
gestaoRaul/products/migrations/__init__.py
Normal file
0
gestaoRaul/products/migrations/__init__.py
Normal file
Binary file not shown.
Binary file not shown.
15
gestaoRaul/products/models.py
Normal file
15
gestaoRaul/products/models.py
Normal 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
|
||||
12
gestaoRaul/products/templates/products.html
Normal file
12
gestaoRaul/products/templates/products.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% block 'title' %}
|
||||
Type Pay
|
||||
{% endblock %}
|
||||
|
||||
{% block 'body' %}
|
||||
Body Type Pay
|
||||
{% endblock %}
|
||||
3
gestaoRaul/products/tests.py
Normal file
3
gestaoRaul/products/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
10
gestaoRaul/products/urls.py
Normal file
10
gestaoRaul/products/urls.py
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
from django.urls import path, include
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.products, name='products'),
|
||||
|
||||
|
||||
|
||||
]
|
||||
5
gestaoRaul/products/views.py
Normal file
5
gestaoRaul/products/views.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
|
||||
def products(request):
|
||||
return render(request, 'products.html')
|
||||
Reference in New Issue
Block a user