-
Notifications
You must be signed in to change notification settings - Fork 1.2k
done task #1345
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
base: master
Are you sure you want to change the base?
done task #1345
Changes from 2 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,3 @@ | ||
| body { | ||
| margin: 10px; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from django.urls import path | ||
| from taxi.views import index | ||
|
|
||
|
|
||
| urlpatterns = [ | ||
| path("", index, name="index"), | ||
| ] | ||
|
|
||
| app_name = "taxi" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,12 @@ | ||
| from django.shortcuts import render | ||
| from .models import Driver, Manufacturer, Car | ||
|
||
|
|
||
| # Create your views here. | ||
|
|
||
| def index(request): | ||
| context = { | ||
| "num_drivers": Driver.objects.count(), | ||
| "num_manufacturers": Manufacturer.objects.count(), | ||
| "num_cars": Car.objects.count(), | ||
| } | ||
|
|
||
| return render(request, "taxi/index.html", context) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| {% load static %} {# !!!important!!! #} | ||
|
||
| <!DOCTYPE HTML> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" | ||
| content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | ||
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" | ||
| integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous"> | ||
| {% block title %} | ||
| <title>Taxi Service</title> | ||
| {% endblock %} | ||
| <link rel="stylesheet" href="{% static "css/styles.css" %}"> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div> | ||
| {% block sidebar %} | ||
| {% include "includes/sidebar.html" %} | ||
| {% endblock %} | ||
| </div>> | ||
|
||
|
|
||
| <div> | ||
| {% block content %} | ||
| {% endblock %} | ||
| </div> | ||
|
|
||
| </body> | ||
| </html> | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <a href="#"> | ||
| Home page | ||
| </a> | ||
| <a href="#"> | ||
| Manufacturers | ||
| </a> | ||
| <a href="#"> | ||
| Cars | ||
| </a> | ||
| <a href="#"> | ||
| Drivers | ||
|
||
| </a> | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block content %} | ||
| {{ num_car }} | ||
|
||
| {{ num_drivers }} | ||
| {{ num_manufacturer }} | ||
|
||
| {% endblock %} | ||
|
|
||
|
||
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.
This violates CHECKLIST ITEM #2: "Add a blank line between different groups of imports and ensure appropriate ordering of imports: Standard library imports. Related third party imports. Local application/library specific imports." Add a blank line between
from django.urls import pathandfrom taxi.views import indexso imports are separated into groups (follow the good example in the checklist).