From fbb326f347b699fcb7ad35a0c4cb0f3c6566bb2c Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Tue, 10 Dec 2024 20:42:10 -0300 Subject: [PATCH] exibindo dados do banco no html --- comandos.txt | 2 + gestaoRaul/db.sqlite3 | Bin 188416 -> 188416 bytes .../__pycache__/urls.cpython-310.pyc | Bin 1209 -> 1231 bytes gestaoRaul/gestaoRaul/urls.py | 1 + gestaoRaul/home/__init__.py | 0 .../home/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 151 bytes .../home/__pycache__/urls.cpython-310.pyc | Bin 0 -> 281 bytes .../home/__pycache__/views.cpython-310.pyc | Bin 0 -> 317 bytes gestaoRaul/home/admin.py | 3 ++ gestaoRaul/home/apps.py | 6 +++ gestaoRaul/home/migrations/__init__.py | 0 gestaoRaul/home/models.py | 3 ++ gestaoRaul/home/templates/home.html | 32 ++++++++++++++++ gestaoRaul/home/tests.py | 3 ++ gestaoRaul/home/urls.py | 7 ++++ gestaoRaul/home/views.py | 5 +++ .../mesas/__pycache__/admin.cpython-310.pyc | Bin 199 -> 571 bytes .../mesas/__pycache__/views.cpython-310.pyc | Bin 376 -> 410 bytes gestaoRaul/mesas/admin.py | 15 ++++++++ gestaoRaul/mesas/templates/mesas.html | 18 +-------- gestaoRaul/mesas/views.py | 5 ++- .../__pycache__/views.cpython-310.pyc | Bin 335 -> 430 bytes gestaoRaul/products/templates/products.html | 31 +++++++++++++--- gestaoRaul/products/views.py | 5 ++- gestaoRaul/templates/base.html | 23 +++++++++++- gestaoRaul/templates/static/base.css | 35 ++++++++++++++++++ 26 files changed, 170 insertions(+), 24 deletions(-) create mode 100644 gestaoRaul/home/__init__.py create mode 100644 gestaoRaul/home/__pycache__/__init__.cpython-310.pyc create mode 100644 gestaoRaul/home/__pycache__/urls.cpython-310.pyc create mode 100644 gestaoRaul/home/__pycache__/views.cpython-310.pyc create mode 100644 gestaoRaul/home/admin.py create mode 100644 gestaoRaul/home/apps.py create mode 100644 gestaoRaul/home/migrations/__init__.py create mode 100644 gestaoRaul/home/models.py create mode 100644 gestaoRaul/home/templates/home.html create mode 100644 gestaoRaul/home/tests.py create mode 100644 gestaoRaul/home/urls.py create mode 100644 gestaoRaul/home/views.py create mode 100644 gestaoRaul/templates/static/base.css 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 7ba8012dec487f1314e9abda311d1e17e2ea2ab9..f5ebf1fcc6f8506f1a6840dc665f3583c5c36b48 100644 GIT binary patch delta 1944 zcma)+U1%It6oBXM-OcV~XZCDJVykJ$r1T*nWHR^8|Ek407_CqU_y?AfjJrddm}KH6 z4JM^*z!$}rNQf{{u=5e56;y_4=Z*|gS&{bmmA z`R=*r+&fG4{8BxCrVAZ@W1oi(uZ^wrbP0mc3L1tj7=uq?9$tsH;RARKz5#8$SLuKU z+6#C9%`MCXBmTlDf6n*|_+Ts&h}OBZUW1Wx}669*+8zsqyL2$?$k_d47oQ zE#z@8nhIw9*-=iB{q|t2qvg+~_WR^^84rpx)v$81JU2Uf`{k9bp^vwQP}j_XBCH6o z4u8WRaFdnyBV2)R;cNH;HsM29g%$V=K3Q*@S%6vwBP13hLc{`RR_2tYh(N(m5jJyBXRX_SHCD}Q z@L(E?sK@~v1rC`*;>dHfa)=x`jx0wD$MTII_O7PusCb~5-xQ*Gkiw0^YGJz2FaIQ; zlb@IONmrz^(le5r-(>SSo39NQMFEI7fW$-k)7xWG!WSlj@|@DA_a8mA->+1H%Knma z>h$SjBGsrdNa!HZ6iQ1}FPXY(8@6FM!w`FDvxnZ@Q)`F}suJC@h(271MWk6o?k;M0 zsHr-ZZ94Rz%sjo(#>i7IhLeh=X;YI;8_L#p?uf8WIjW=U#C0B)n4l*TP|q))@Gq?T zvrYMOQ#vVWu4=fh;gE;&EWLYseJ`la2NQS7t|j|PSUOc5n;MqwwX*bqDBV564t_io zx48$ooi%8B$*@&oJFEszj3v$viPMnO8l$~~g^gBo4A<~-vBlnDu^X2EkZ7u_X@=%_ z*;ryFBsHbay0=BQRoyTh)3RH*1+}r$N)i^OkMyUG9^1VKT~~>tn;P*l@$zOevDRna zdwJrrPEeOPUOKiINlTycKP2p6nkIEL562SyNG&*U$M*3C8e;?6W^LV z!a{fB5}aSk6f;m4pw9lf0Z$%8S)up2tSJ6_OAjgK?Hi+10%dA^@ zK_#57gz6(bkAKv$ccTl87uRlZZ?yornwxCn8-+B_i5^Sk!%cJ)&n7zd9dQgLkfK J@1IGH`~y2|%@F_q delta 167 zcmZoTz};|wdxA8hgmof0avE)ICFZ5)$0w%bX6D7` zKQ~pcv?!-|awPLBZjjz05b?`qvLA~iYfzArtMlX{ S7F|Y($qQJ-S$G&ZegFUoTOFwY delta 149 zcmX@lxsy{npO=@50SH{G!qeSZ7#JRdILH7b>j1>XH50YVxzgFAI8p?I88n49?pVt- zxtRHtK1e|ki1_8?Y!wq)oLW>IQ=Xbrk{{!epIn-onpaXBlb%{!l9(S~lvtWGxs63v WN(`u+g@H#vfRTrphYg`kf~;c^=^*+sh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6wt*(xTqIJKxa zraU#LBtOO_Ke;qFHLs*NCMd|s)j1|TwYVfPKPa&@Cnh65H#H_cJ~J<~BtBlRpz;=n UO>TZlX-=vg$jo9UAi=@_0C6rOL;wH) literal 0 HcmV?d00001 diff --git a/gestaoRaul/home/__pycache__/urls.cpython-310.pyc b/gestaoRaul/home/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5cb455a84fcca2bf58385b198689c51046e2656 GIT binary patch literal 281 zcmYk0Jx;_h5QRN)5+Zh&o+G45Nr4bTEVL9sNGNh+F{3OiJ6_oiD-OXyI1CqXOSM;^ zfiX0UG~eiHe%`p%>R51`emstW>t`1KqhfKz89D|E1S2dA00Ik?rm%95APBG|xh=86 z`b~~7RCshR+UCGJqJ>oMble=^PgF0@v=2$7a^o!J?xZc90E{R6TWMX3M) literal 0 HcmV?d00001 diff --git a/gestaoRaul/home/__pycache__/views.cpython-310.pyc b/gestaoRaul/home/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..323ebb9b3c5ef71a3aea5fa8f1abe6e992083bef GIT binary patch literal 317 zcmYjMu};G<5Vf7Og{qYp`GqW5D^&;~0&9mLBvg4Iime1>$KbQ6Krq42^iTK(uT1>~ zChjVRp7ieg{OtE^H=j=#*8TTg_kr_=$YBX27YI1TrkLV}S-$3+DWS42wiYVCVZ~^N zD%JY9UQ +{% endblock %} + +{% block 'title' %} +RRB&C - DashBoard +{% endblock %} + +{% block 'body' %} + + +
+ +

DashBoard Aqui

+ + {% comment %} {% for mesa in mesas %} + +
{{mesa.name}}
+ + {% endfor %} {% endcomment %} + + +
+ + + +{% endblock %} \ No newline at end of file diff --git a/gestaoRaul/home/tests.py b/gestaoRaul/home/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/gestaoRaul/home/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/gestaoRaul/home/urls.py b/gestaoRaul/home/urls.py new file mode 100644 index 0000000..3bcaa2f --- /dev/null +++ b/gestaoRaul/home/urls.py @@ -0,0 +1,7 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path('', views.home, name='home'), + +] diff --git a/gestaoRaul/home/views.py b/gestaoRaul/home/views.py new file mode 100644 index 0000000..35fb3dc --- /dev/null +++ b/gestaoRaul/home/views.py @@ -0,0 +1,5 @@ +from django.shortcuts import render + +# Create your views here. +def home(request): + return render(request, 'home.html') \ No newline at end of file diff --git a/gestaoRaul/mesas/__pycache__/admin.cpython-310.pyc b/gestaoRaul/mesas/__pycache__/admin.cpython-310.pyc index 0f119bcd07cb7cd6dc3a603efc1d6dfdcd17ea56..79f575da1eaaadf180330226a61b2b34908a0696 100644 GIT binary patch literal 571 zcmYk4zfQw25XSB1f19*r>FHJ6o1XGDfgIKA+1kjL^49hRcEE3Xa}GC{Tep5}06Yc*IA-A&zB- zyTT)$WtaORAc19%haw`8WuK45giI_4JQfK_Fk*N!-OpI^1~vbAGGJ%G-hhJvM}~{= z0WG2*m=Y~;=g~q`HNZHf4J)Opn1;+xdBy4mC`hHCbwLe2?zU`2cLrBV7Hw_}?j6(g zelaK0VngdvE^}Eos(Mi)=+K?yec7du1>;(omm<^LHqb}WHR3Ek^y*d5TAM@Lqt&<8 z?O}l48W=SeFiS6mAa$;;8rFr1m6dLodPgb-*@oY<^gMggOzG^E@kVAhGH(T3TW9O_ t^=+D!OgB`nY0EQPIJ1wn-0r&Y0xr{Xb_rhr=~Dg`kf~ghZ=}tiUF^Gc(44TX@fuanW zjJH@5Q*tx&{4|-O_)@YG^V0M6lJoOQiZYXmKnAR2C}IXuVB(jZvsFxJacWU delta 295 zcmYLEy-EW?5T4n+OC;RE2`Oyy0M`UB@fXA*RyJvD#(Y?}r4-}XiF-bK?=SDVZ5i3=$SB+)N{IzmqX diff --git a/gestaoRaul/mesas/admin.py b/gestaoRaul/mesas/admin.py index 8c38f3f..bfa7ebe 100644 --- a/gestaoRaul/mesas/admin.py +++ b/gestaoRaul/mesas/admin.py @@ -1,3 +1,18 @@ from django.contrib import admin +from categories.models import Categories +from clients.models import Client +from comandas.models import Comanda +from typePay.models import TypePay +from products.models import Product +from mesas.models import Mesa + + +admin.site.register(Mesa) +admin.site.register(Product) +admin.site.register(Categories) +admin.site.register(Client) +admin.site.register(Comanda) +admin.site.register(TypePay) + # Register your models here. diff --git a/gestaoRaul/mesas/templates/mesas.html b/gestaoRaul/mesas/templates/mesas.html index 32753be..8d6631d 100644 --- a/gestaoRaul/mesas/templates/mesas.html +++ b/gestaoRaul/mesas/templates/mesas.html @@ -18,24 +18,10 @@ RRB&C - Mesas {% for mesa in mesas %} -
Mesa {{mesa}}
+
{{mesa.name}}
{% endfor %} - {% comment %}
Card 2
-
Card 3
-
Card 4
-
Card 5
-
Card 6
-
Card 7
-
Card 8
-
Card 9
-
Card 10
-
Card 8
-
Card 9
-
Card 10
-
Card 8
-
Card 9
-
Card 10
{% endcomment %} + 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 bda133b81f3927677e6de553cb9feeccc104b2f9..5d277e50e8d5c49c86659b531d867d8390a2d662 100644 GIT binary patch literal 430 zcmYjNJx{|h5cNm;LDh=R%q&?lG5|t|!djsqBouiGv6VJ*>f&>#KxKj-0wcc$v3h0V zFEDWqRO(6Z{La36_hd5~4G6};$4&W(=T|7UgJE%sfPGAoNUBLqGfD$zn$aJ1Xve53(0lX92$G4xO z$)UIgWkIZzc1E0=qN&xwfk@M{i-{<4DmQ7~XtCKO?&oR+$@0NQsL(|~AOkw4?aegq z__3_=MQIY48S9G1LF**j-Do7WkxD~rxgBcVY^5Dk^!;OOYqUBE{{>;wkPO+7{{mV2 BW;*}? literal 335 zcmYjM%}N6?5KglFSxOf?`U-p52PjgMdhS6Hp#)^vgsmmJsWXX1=}ljzuav7NU%`_z zrG*ZB^Pg|N_@bByvV8yCI*LDBT$-ZdmVnpfj4;xPPOhXBMw#qetdto%igNf%Q*n@K z1hzL88p-v^IL`H3w`egO1PrP3cej}7 zC$xZiXI=36-Z!zceL&sPR_$M)j_#B{aC&Cd@2_@;)%GLh=hlFQ@STZ-F@ {% endblock %} +{% block 'title' %} +Produtos +{% endblock %} + + + + {% block 'body' %} -Body Type Pay + + + +
+ + {% for product in products %} + +
{{product.name}}
+ + {% endfor %} + + +
+ + + {% 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 %} {% block 'title' %}{% endblock %} -
aqui o menu
+
+ + aqui o menu + + +
+

Bem-vindo ao meu site!

+
+ + +
{% block 'body' %} {% endblock %} diff --git a/gestaoRaul/templates/static/base.css b/gestaoRaul/templates/static/base.css new file mode 100644 index 0000000..dbd327f --- /dev/null +++ b/gestaoRaul/templates/static/base.css @@ -0,0 +1,35 @@ +body { + margin: 0; + font-family: Arial, sans-serif; +} + +.sidebar { + height: 100vh; + width: 200px; + background-color: #f1f1f1; + padding: 20px; + position: fixed; + top: 0; + left: 0; +} + +.content { + margin-left: 220px; /* Ajustar para a largura da sidebar + padding */ + padding: 20px; +} + +ul { + list-style-type: none; + padding: 0; +} + +li a { + display: block; + padding: 15px; + text-decoration: none; + color: #333; +} + +li a:hover { + background-color: #ccc; +} \ No newline at end of file