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

7
comandos.txt Normal file
View File

@@ -0,0 +1,7 @@
$ mkdir djangotutorial
$ django-admin startproject mysite djangotutorial
$ python manage.py runserver
python manage.py startapp polls
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser

Binary file not shown.

View File

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 CategoriesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'categories'

View File

@@ -0,0 +1,21 @@
# Generated by Django 5.1.4 on 2024-12-10 00:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
],
),
]

View File

@@ -0,0 +1,17 @@
# Generated by Django 5.1.4 on 2024-12-10 01:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('categories', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='Category',
new_name='Categories',
),
]

View File

@@ -0,0 +1,10 @@
from django.db import models
# Create your models here.
class Categories(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=255)
def __str__(self) -> str:
return self.name

View File

@@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block 'title' %}
Categorias{% 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
from . import views
urlpatterns = [
path('', views.categories, name='categories'),
]

View File

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

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 ClientsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'clients'

View File

@@ -0,0 +1,23 @@
# Generated by Django 5.1.4 on 2024-12-10 00:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Client',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=255)),
('active', models.BooleanField(default=True)),
('contact', models.CharField(blank=True, max_length=255, null=True)),
],
),
]

View File

@@ -0,0 +1,8 @@
from django.db import models
# Create your models here.
class Client(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=255)
active = models.BooleanField(default=True)
contact = models.CharField(max_length=255, null=True, blank=True)

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.clients, name='clients'),
]

View File

@@ -0,0 +1,6 @@
from django.shortcuts import render
# Create your views here.
def clients(request):
return render(request, 'clients.html')

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 ComandasConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'comandas'

View File

@@ -0,0 +1,30 @@
# Generated by Django 5.1.4 on 2024-12-10 01:19
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('clients', '0001_initial'),
('mesas', '0001_initial'),
('typePay', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Comanda',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('dt_open', models.DateTimeField(auto_now_add=True)),
('dt_close', models.DateTimeField(blank=True, null=True)),
('name', models.CharField(max_length=255)),
('client', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='clients.client')),
('mesa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mesas.mesa')),
('type_pay', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='typePay.typepay')),
],
),
]

View File

@@ -0,0 +1,25 @@
# Generated by Django 5.1.4 on 2024-12-10 01:20
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comandas', '0001_initial'),
('products', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ProductComanda',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('data_time', models.DateTimeField(auto_now_add=True)),
('applicant', models.CharField(blank=True, max_length=255, null=True)),
('comanda', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comandas.comanda')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
],
),
]

View File

@@ -0,0 +1,23 @@
from django.db import models
from clients.models import Client
from products.models import Product
from mesas.models import Mesa
from typePay.models import TypePay
# Create your models here.
class Comanda(models.Model):
id = models.AutoField(primary_key=True)
mesa = models.ForeignKey(Mesa, on_delete=models.CASCADE)
type_pay = models.ForeignKey(TypePay, on_delete=models.SET_NULL, null=True)
dt_open = models.DateTimeField(auto_now_add=True)
dt_close = models.DateTimeField(null=True, blank=True)
client = models.ForeignKey(Client, on_delete=models.SET_NULL, null=True, blank=True)
name = models.CharField(max_length=255)
class ProductComanda(models.Model):
id = models.AutoField(primary_key=True)
comanda = models.ForeignKey(Comanda, on_delete=models.CASCADE)
data_time = models.DateTimeField(auto_now_add=True)
product = models.ForeignKey(Product, on_delete=models.CASCADE)
applicant = models.CharField(max_length=255, null=True, blank=True)

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
from . import views
urlpatterns = [
path('', views.comandas, name='comandas'),
]

View File

@@ -0,0 +1,6 @@
from django.shortcuts import render
# Create your views here.
def comandas(request):
return render(request, 'comandas.html')

BIN
gestaoRaul/db.sqlite3 Normal file

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,16 @@
"""
ASGI config for gestaoRaul project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gestaoRaul.settings')
application = get_asgi_application()

View File

@@ -0,0 +1,135 @@
"""
Django settings for gestaoRaul project.
Generated by 'django-admin startproject' using Django 5.1.4.
For more information on this file, see
https://docs.djangoproject.com/en/5.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.1/ref/settings/
"""
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-mqcnrs5!hc6bj$&#0@@9d8^2@x#w&$qhk3vlr5_)3znd9h6&d8'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'products',
'mesas',
'typePay',
'clients',
'comandas',
'categories',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'gestaoRaul.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates'),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'gestaoRaul.wsgi.application'
# Database
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/5.1/topics/i18n/
LANGUAGE_CODE = 'pt-BR'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.1/howto/static-files/
STATIC_URL = 'static/'
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'templates/static'),)
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

View File

@@ -0,0 +1,30 @@
"""
URL configuration for gestaoRaul project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('products/', include('products.urls')),
path('mesas/', include('mesas.urls')),
path('typePay/', include('typePay.urls')),
path('clients/', include('clients.urls')),
path('comandas/', include('comandas.urls')),
path('categories/', include('categories.urls')),
]

View File

@@ -0,0 +1,16 @@
"""
WSGI config for gestaoRaul project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gestaoRaul.settings')
application = get_wsgi_application()

22
gestaoRaul/manage.py Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gestaoRaul.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

View File

Binary file not shown.

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.

6
gestaoRaul/mesas/apps.py Normal file
View File

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

View File

@@ -0,0 +1,23 @@
# Generated by Django 5.1.4 on 2024-12-10 00:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Mesa',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('location', models.CharField(blank=True, max_length=255, null=True)),
('active', models.BooleanField(default=False)),
],
),
]

View File

View File

@@ -0,0 +1,13 @@
from django.db import models
# Create your models here.
from django.db import models
class Mesa(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=100)
location = models.CharField(max_length=255, null=True, blank=True)
active = models.BooleanField(default=False)
# Foreign Key to Comandas model (assuming it exists)
# comanda = models.ForeignKey('Comandas', on_delete=models.DO_NOTHING, db_column='id_mesa')

View File

@@ -0,0 +1,56 @@
{% extends "base.html" %}
{% load static %}
{% block 'head' %}
<link rel="stylesheet" href="{% static 'mesas/css/mesas.css' %}">
{% endblock %}
{% block 'title' %}
RRB&C - Mesas
{% endblock %}
{% block 'body' %}
<body>
<div class="grid-container">
<div class="card">{{nome}} 1</div>
<div class="card">Card 2</div>
<div class="card">Card 3</div>
<div class="card">Card 4</div>
<div class="card">Card 5</div>
<div class="card">Card 6</div>
<div class="card">Card 7</div>
<div class="card">Card 8</div>
<div class="card">Card 9</div>
<div class="card">Card 10</div>
<div class="card">Card 8</div>
<div class="card">Card 9</div>
<div class="card">Card 10</div>
<div class="card">Card 8</div>
<div class="card">Card 9</div>
<div class="card">Card 10</div>
<div class="card">Card 8</div>
<div class="card">Card 9</div>
<div class="card">Card 10</div>
<div class="card">Card 8</div>
<div class="card">Card 9</div>
<div class="card">Card 10</div>
<div class="card">Card 8</div>
<div class="card">Card 9</div>
<div class="card">Card 10</div>
<div class="card">Card 8</div>
<div class="card">Card 9</div>
<div class="card">Card 10</div>
<div class="card">Card 8</div>
<div class="card">Card 9</div>
<div class="card">Card 10</div>
<div class="card">Card 8</div>
<div class="card">Card 9</div>
<div class="card">Card 10</div>
</div>
</body>
{% endblock %}

View File

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

10
gestaoRaul/mesas/urls.py Normal file
View File

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

View File

@@ -0,0 +1,6 @@
from django.shortcuts import render
# Create your views here.
def mesas(request):
return render(request, 'mesas.html')

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')),
],
),
]

Some files were not shown because too many files have changed in this diff Show More