Compare commits
	
		
			4 Commits
		
	
	
		
			4bc47ebd79
			...
			764d3d8d85
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 764d3d8d85 | |||
| 730c7b379f | |||
| c2755e1adc | |||
| 70a70f6620 | 
| @@ -0,0 +1,6 @@ | |||||||
|  | <h1>Tienda la Ilusión</h1> | ||||||
|  | <h2>Don Confiao</h2> | ||||||
|  | <ul> | ||||||
|  |     <li><a href='./comprar'>Comprar</a></li> | ||||||
|  |     <li><a href='./compras'>Compras</a></li> | ||||||
|  | </ul> | ||||||
| @@ -0,0 +1,9 @@ | |||||||
|  | {% if purchases  %} | ||||||
|  | <ul> | ||||||
|  |     {% for purchase in purchases %} | ||||||
|  |     <li><a href="/don_confiao/{{ purchase.id }}/">{{ purchase.date }}, {{ purchase.customer }}</a></li> | ||||||
|  |     {% endfor %} | ||||||
|  | </ul> | ||||||
|  | {% else %} | ||||||
|  | <p>No hay Compras</p> | ||||||
|  | {% endif %} | ||||||
							
								
								
									
										9
									
								
								tienda_ilusion/don_confiao/urls.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								tienda_ilusion/don_confiao/urls.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | from django.urls import path | ||||||
|  |  | ||||||
|  | from . import views | ||||||
|  |  | ||||||
|  | urlpatterns = [ | ||||||
|  |     path("", views.index, name="wellcome"), | ||||||
|  |     path("comprar", views.buy, name="buy"), | ||||||
|  |     path("compras", views.purchases, name="purchases"), | ||||||
|  | ] | ||||||
| @@ -1,3 +1,18 @@ | |||||||
| from django.shortcuts import render | from django.shortcuts import render | ||||||
|  | from django.http import HttpResponse | ||||||
|  | from django.template import loader | ||||||
|  |  | ||||||
| # Create your views here. | from .models import Sale | ||||||
|  |  | ||||||
|  | def index(request): | ||||||
|  |     return render(request, 'don_confiao/index.html') | ||||||
|  |  | ||||||
|  | def buy(request): | ||||||
|  |     return HttpResponse("Nombre: ....") | ||||||
|  |  | ||||||
|  | def purchases(request): | ||||||
|  |     purchases = Sale.objects.all() | ||||||
|  |     context = { | ||||||
|  |         "purchases": purchases, | ||||||
|  |     } | ||||||
|  |     return render(request, 'don_confiao/purchases.html', context) | ||||||
|   | |||||||
| @@ -15,8 +15,9 @@ Including another URLconf | |||||||
|     2. Add a URL to urlpatterns:  path('blog/', include('blog.urls')) |     2. Add a URL to urlpatterns:  path('blog/', include('blog.urls')) | ||||||
| """ | """ | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| from django.urls import path | from django.urls import include, path | ||||||
|  |  | ||||||
| urlpatterns = [ | urlpatterns = [ | ||||||
|  |     path("don_confiao/", include("don_confiao.urls")), | ||||||
|     path('admin/', admin.site.urls), |     path('admin/', admin.site.urls), | ||||||
| ] | ] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user