-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop models #5
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 4.0.6 on 2022-08-16 12:07 | ||
|
||
import django.core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('myfirstproject', '0004_product'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='product', | ||
name='in_stock', | ||
field=models.BooleanField(blank=True, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='product', | ||
name='amount_product', | ||
field=models.IntegerField(null=True, validators=[django.core.validators.MinValueValidator(0)]), | ||
), | ||
migrations.AlterField( | ||
model_name='product', | ||
name='price_product', | ||
field=models.IntegerField(null=True, validators=[django.core.validators.MinValueValidator(0)]), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{% extends 'product.html' %} | ||
{% extends 'product/product-detail.html' %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Давай через |
||
|
||
{% block title %} | ||
fish | ||
|
@@ -11,7 +11,7 @@ <h2>Page product fish</h2> | |
{% block content %} | ||
<ul> | ||
<li> | ||
<a href="homepage.html">homepage</a> | ||
<a href="../../templates/homepage.html">homepage</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Давай через |
||
</li> | ||
<li> | ||
<a href="profile">profile user</a> | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,16 @@ | ||||||
<!DOCTYPE html> | ||||||
<html lang="en"> | ||||||
<head> | ||||||
<meta charset="UTF-8"> | ||||||
<title>Title</title> | ||||||
</head> | ||||||
<body> | ||||||
<h1>Homepage</h1> | ||||||
<ul> | ||||||
{% for object in object_list %} | ||||||
<li><a href="product-list.html" slug=object.slug></a>Product{{ object.product_n}}</li> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Таке треба робити з використанням тегів |
||||||
{% endfor %} | ||||||
|
||||||
</ul> | ||||||
</body> | ||||||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
from django.urls import path | ||
from djangoProject.views import * | ||
from myfirstproject.views import * | ||
|
||
|
||
urlpatterns = [ | ||
urlpatterns = { | ||
path('profile', profile1, name='profile1'), | ||
path('product', product1, name='product1'), | ||
path('apple', apple1, name='apple1'), | ||
path('milk', milk1, name='milk1'), | ||
path('fish', fish1, name='fish1'), | ||
path('homepage', homepage1, name='homepage1') | ||
] | ||
path('homepage', homepage1, name='homepage1'), | ||
path('', product_list_views, name='product-list.html'), | ||
path('<slug:slug>/', product_detail_views, name='product-detail.html') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай через
url