diff --git a/comandos.txt b/comandos.txt index d3ac09c..dc64fce 100644 --- a/comandos.txt +++ b/comandos.txt @@ -1,5 +1,7 @@ mkdir djangotutorial +python -m venv meu_ambiente django-admin startproject mysite djangotutorial +meu_ambiente\Scripts\Activate.ps1 python manage.py runserver python manage.py startapp polls python manage.py makemigrations diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index 7ba8012..f5ebf1f 100644 Binary files a/gestaoRaul/db.sqlite3 and b/gestaoRaul/db.sqlite3 differ diff --git a/gestaoRaul/gestaoRaul/__pycache__/urls.cpython-310.pyc b/gestaoRaul/gestaoRaul/__pycache__/urls.cpython-310.pyc index 36d26e0..fd0a074 100644 Binary files a/gestaoRaul/gestaoRaul/__pycache__/urls.cpython-310.pyc and b/gestaoRaul/gestaoRaul/__pycache__/urls.cpython-310.pyc differ diff --git a/gestaoRaul/gestaoRaul/urls.py b/gestaoRaul/gestaoRaul/urls.py index 22cab16..7115f5f 100644 --- a/gestaoRaul/gestaoRaul/urls.py +++ b/gestaoRaul/gestaoRaul/urls.py @@ -19,6 +19,7 @@ from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), + path('/', include('home.urls')), path('products/', include('products.urls')), path('mesas/', include('mesas.urls')), path('typePay/', include('typePay.urls')), diff --git a/gestaoRaul/home/__init__.py b/gestaoRaul/home/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gestaoRaul/home/__pycache__/__init__.cpython-310.pyc b/gestaoRaul/home/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..4efa6d6 Binary files /dev/null and b/gestaoRaul/home/__pycache__/__init__.cpython-310.pyc differ diff --git a/gestaoRaul/home/__pycache__/urls.cpython-310.pyc b/gestaoRaul/home/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000..c5cb455 Binary files /dev/null and b/gestaoRaul/home/__pycache__/urls.cpython-310.pyc differ diff --git a/gestaoRaul/home/__pycache__/views.cpython-310.pyc b/gestaoRaul/home/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000..323ebb9 Binary files /dev/null and b/gestaoRaul/home/__pycache__/views.cpython-310.pyc differ diff --git a/gestaoRaul/home/admin.py b/gestaoRaul/home/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/gestaoRaul/home/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/gestaoRaul/home/apps.py b/gestaoRaul/home/apps.py new file mode 100644 index 0000000..e5ea0af --- /dev/null +++ b/gestaoRaul/home/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class HomeConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'home' diff --git a/gestaoRaul/home/migrations/__init__.py b/gestaoRaul/home/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gestaoRaul/home/models.py b/gestaoRaul/home/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/gestaoRaul/home/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/gestaoRaul/home/templates/home.html b/gestaoRaul/home/templates/home.html new file mode 100644 index 0000000..60e28e0 --- /dev/null +++ b/gestaoRaul/home/templates/home.html @@ -0,0 +1,32 @@ +{% extends "base.html" %} +{% load static %} + + + +{% block 'head' %} + +{% endblock %} + +{% block 'title' %} +RRB&C - DashBoard +{% endblock %} + +{% block 'body' %} + +
+diff --git a/gestaoRaul/mesas/views.py b/gestaoRaul/mesas/views.py index 97821cb..f5b7780 100644 --- a/gestaoRaul/mesas/views.py +++ b/gestaoRaul/mesas/views.py @@ -1,6 +1,9 @@ from django.shortcuts import render +from mesas.models import Mesa + # Create your views here. def mesas(request): - return render(request, 'mesas.html', {'mesas': ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']}) \ No newline at end of file + mesas = Mesa.objects.all() + return render(request, 'mesas.html', {'mesas': mesas}) \ No newline at end of file diff --git a/gestaoRaul/products/__pycache__/views.cpython-310.pyc b/gestaoRaul/products/__pycache__/views.cpython-310.pyc index bda133b..5d277e5 100644 Binary files a/gestaoRaul/products/__pycache__/views.cpython-310.pyc and b/gestaoRaul/products/__pycache__/views.cpython-310.pyc differ diff --git a/gestaoRaul/products/templates/products.html b/gestaoRaul/products/templates/products.html index 97f1dd2..e216db6 100644 --- a/gestaoRaul/products/templates/products.html +++ b/gestaoRaul/products/templates/products.html @@ -1,12 +1,33 @@ {% extends "base.html" %} +{% load static %} - - -{% block 'title' %} -Type Pay +{% block 'head' %} + {% endblock %} +{% block 'title' %} +Produtos +{% endblock %} + + + + {% block 'body' %} -Body Type Pay + + +
+ + {% endblock %} \ No newline at end of file diff --git a/gestaoRaul/products/views.py b/gestaoRaul/products/views.py index 9cc4669..dc2f45d 100644 --- a/gestaoRaul/products/views.py +++ b/gestaoRaul/products/views.py @@ -1,5 +1,8 @@ from django.shortcuts import render +from products.models import Product + def products(request): - return render(request, 'products.html') \ No newline at end of file + protucts = Product.objects.all() + return render(request, 'products.html', {'products': protucts}) \ No newline at end of file diff --git a/gestaoRaul/templates/base.html b/gestaoRaul/templates/base.html index 2e8afb0..7ad2eb6 100644 --- a/gestaoRaul/templates/base.html +++ b/gestaoRaul/templates/base.html @@ -1,15 +1,36 @@ {% load static %} +
+ {% block 'head' %}{% endblock %}
-
+