Skip to content

Latest commit

 

History

History
110 lines (80 loc) · 2.24 KB

checklist.md

File metadata and controls

110 lines (80 loc) · 2.24 KB

Сheck Your Code Against the Following Points

Don't Push db files

Make sure you don't push db files (files with .sqlite, .db3, etc. extension).

Don't forget to attach all screenshots of created/modified pages.

Code Efficiency

Don't override template_name, context_object_name and so on if they are the same as default ones.

Code Style

  1. Make sure you've added a blank line at the end to all your files including .css, .html and .gitignore.
  2. Use () instead of backslash — \ in if-statements.

Good example:

if (first_condition and second_condition 
        and third_condition):
    #  some actions

Also possible one:

if (first_condition and
    second_condition):
    #  some actions

Bad example:

if first_condition and second_condition \
    and third_condition:
    # some actions
  1. Group imports using () if needed.

Good example:

from django.contrib.auth.mixins import (
    LoginRequiredMixin, 
    UserPassesTestMixin, 
    PermissionRequiredMixin,
)

Bad example:

from django.contrib.auth.mixins import LoginRequiredMixin, \
    UserPassesTestMixin, PermissionRequiredMixin
  1. Use correct path names.

Good example:

path(
    "manufacurers/create/", 
    ManufacturerCreateView.as_view(), 
    name="manufacturer-create"
),

Bad example:

path(
    "manufacturers/manufacturer_create/", 
    ManufacturerCreateView.as_view(), 
    name="manufacturer-create"
)

Another bad example:

path("create/", ManufacturerCreateView.as_view(), name="manufacturer-create")
  1. Add Cancel button apart from Delete one. The Cancel button will lead to the previous page the user was on.

  2. Make sure you use 2 whitespaces indentations in your .html files.

  3. Use - to split words in URL identification parameter name, not the _.

Good example:

urlpatterns = [
    path("buses/", BusListView.as_view(), name="bus-list"),
]

Bad example:

urlpatterns = [
    path("buses/", BusListView.as_view(), name="bus_list"),
]

Clean Code

Add comments, prints, and functions to check your solution when you write your code. Don't forget to delete them when you are ready to commit and push your code.