-
Notifications
You must be signed in to change notification settings - Fork 1.2k
covered with code #1353
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?
covered with code #1353
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 |
|---|---|---|
| @@ -1,11 +1,29 @@ | ||
| # Python | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *.pyo | ||
| *.pyd | ||
| *.sqlite3 | ||
|
|
||
| # Virtual environment | ||
| .venv/ | ||
| venv/ | ||
| env/ | ||
|
|
||
| # Django | ||
| db.sqlite3 | ||
| /media/ | ||
| staticfiles/ | ||
|
|
||
| # IDE | ||
| .idea/ | ||
| .vscode/ | ||
| *.iml | ||
| .env | ||
|
|
||
| # macOS | ||
| .DS_Store | ||
| venv/ | ||
| .pytest_cache/ | ||
| **__pycache__/ | ||
| *.pyc | ||
| app/db.sqlite3 | ||
| db.sqlite3 | ||
|
|
||
| # Logs | ||
| *.log | ||
|
|
||
| # Environment variables | ||
| .env |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <link rel="stylesheet" href="styles.css"> | ||
| {% block title %} | ||
| <title>Taxi Service</title> | ||
| {% endblock %} | ||
| </head> | ||
| <body> | ||
| <div id="sidebar"> | ||
| {% block sidebar %} | ||
| {% include "includes/sidebar.html" %} | ||
| {% endblock %} | ||
| </div> | ||
| <div id="content"> | ||
| {% block content %}{% endblock %} | ||
| </div> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
|
|
||
| {% block sidebar %} | ||
| <ul> | ||
| <li><a href="#">Home page</a></li> | ||
| <li><a href="#">Manufacturer</a></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. Good job creating the list of links! Just a small correction: the task requires the link text to be "Manufacturers" (plural). |
||
| <li><a href="#">Cars</a></li> | ||
| <li><a href="#">Drivers</a></li> | ||
| </ul> | ||
| {% endblock %} | ||
|
Comment on lines
+3
to
+10
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. The 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. This violates a requirement to have each HTML file end with a blank line. Please add a newline character after this line. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block content %} | ||
| <h1>You have visited the page with information about Taxi Service!</h1> | ||
| <h6>The Number of Drivers: {{ num_drivers }}</h6> | ||
| <h6>The number of Manufacturers: {{ num_manufacturers }}</h6> | ||
| <h6>The Number of Cars: {{ num_cars }}</h6> | ||
|
Comment on lines
+5
to
+7
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. According to the task description, this information should be placed 'as a list'. Using multiple |
||
| {% endblock %} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from django.urls import path | ||
|
|
||
| from taxi.views import index | ||
|
|
||
|
|
||
| urlpatterns = [ | ||
| path("", index, name="index") | ||
| ] | ||
|
|
||
| app_name = "taxi" | ||
|
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. This violates checklist item #1: 'Ensure each file ends with a single blank line.' Please add a newline character at the end of the file. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,17 @@ | ||
| from django.shortcuts import render | ||
| from django.http import HttpRequest, HttpResponse | ||
|
|
||
| # Create your views here. | ||
| from taxi.models import Driver, Manufacturer, Car | ||
|
|
||
|
|
||
| def index(request: HttpRequest) -> HttpResponse: | ||
| num_drivers = Driver.objects.count() | ||
| num_manufacturers = Manufacturer.objects.count() | ||
| num_cars = Car.objects.count() | ||
|
|
||
| context = { | ||
| "num_drivers": num_drivers, | ||
| "num_manufacturers": num_manufacturers, | ||
| "num_cars": num_cars | ||
| } | ||
| return render(request, "taxi/index.html", context=context) |
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.
The requirement to "Load static and import styles.css" means you should use Django's template system for static files. This involves two steps:
{% load static %}at the very top of this file.hrefattribute to use thestatictag, like this:href="{% static 'css/styles.css' %}".Hardcoding the URL like this prevents Django from finding the file correctly.