Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: CRUD with Person | Working with Database
Django: First Dive
course content

Зміст курсу

Django: First Dive

Django: First Dive

1. Get Started
2. Write the First Page
3. Models
4. Working with Database
5. Templates
6. Request Handling

Challenge: CRUD with Person

Note

The presented code for the task is part of the framework and cannot work separately, so errors will be received when you try to Run Code. Use the Submit Task button to solve this task.

Завдання

You have already implemented Model class:

Write 5 view functions:

  1. dog_list(request) should display the list of dogs on the HTML page like following:
  2. dog_get(request, pk) should display the information about the selected Dog by pk (id).
  3. dog_create(request) should create the new Dog with the name "Unknown", age 0, and weight 1.1.
  4. dog_update(request, pk) should update the Dog's name to "Updater", age += 1, and weight += 0.2.
  5. dog_delete(request, pk) should delete the existing dog by id.

Connect views to URLs

URLView
dogs/dog_list
dogs/id/dog_get
dogs/id/update/dog_update
dogs/id/delete/dog_delete
dogs/create/dog_create

Завдання

You have already implemented Model class:

Write 5 view functions:

  1. dog_list(request) should display the list of dogs on the HTML page like following:
  2. dog_get(request, pk) should display the information about the selected Dog by pk (id).
  3. dog_create(request) should create the new Dog with the name "Unknown", age 0, and weight 1.1.
  4. dog_update(request, pk) should update the Dog's name to "Updater", age += 1, and weight += 0.2.
  5. dog_delete(request, pk) should delete the existing dog by id.

Connect views to URLs

URLView
dogs/dog_list
dogs/id/dog_get
dogs/id/update/dog_update
dogs/id/delete/dog_delete
dogs/create/dog_create

Все було зрозуміло?

Секція 4. Розділ 4
toggle bottom row

Challenge: CRUD with Person

Note

The presented code for the task is part of the framework and cannot work separately, so errors will be received when you try to Run Code. Use the Submit Task button to solve this task.

Завдання

You have already implemented Model class:

Write 5 view functions:

  1. dog_list(request) should display the list of dogs on the HTML page like following:
  2. dog_get(request, pk) should display the information about the selected Dog by pk (id).
  3. dog_create(request) should create the new Dog with the name "Unknown", age 0, and weight 1.1.
  4. dog_update(request, pk) should update the Dog's name to "Updater", age += 1, and weight += 0.2.
  5. dog_delete(request, pk) should delete the existing dog by id.

Connect views to URLs

URLView
dogs/dog_list
dogs/id/dog_get
dogs/id/update/dog_update
dogs/id/delete/dog_delete
dogs/create/dog_create

Завдання

You have already implemented Model class:

Write 5 view functions:

  1. dog_list(request) should display the list of dogs on the HTML page like following:
  2. dog_get(request, pk) should display the information about the selected Dog by pk (id).
  3. dog_create(request) should create the new Dog with the name "Unknown", age 0, and weight 1.1.
  4. dog_update(request, pk) should update the Dog's name to "Updater", age += 1, and weight += 0.2.
  5. dog_delete(request, pk) should delete the existing dog by id.

Connect views to URLs

URLView
dogs/dog_list
dogs/id/dog_get
dogs/id/update/dog_update
dogs/id/delete/dog_delete
dogs/create/dog_create

Все було зрозуміло?

Секція 4. Розділ 4
toggle bottom row

Challenge: CRUD with Person

Note

The presented code for the task is part of the framework and cannot work separately, so errors will be received when you try to Run Code. Use the Submit Task button to solve this task.

Завдання

You have already implemented Model class:

Write 5 view functions:

  1. dog_list(request) should display the list of dogs on the HTML page like following:
  2. dog_get(request, pk) should display the information about the selected Dog by pk (id).
  3. dog_create(request) should create the new Dog with the name "Unknown", age 0, and weight 1.1.
  4. dog_update(request, pk) should update the Dog's name to "Updater", age += 1, and weight += 0.2.
  5. dog_delete(request, pk) should delete the existing dog by id.

Connect views to URLs

URLView
dogs/dog_list
dogs/id/dog_get
dogs/id/update/dog_update
dogs/id/delete/dog_delete
dogs/create/dog_create

Завдання

You have already implemented Model class:

Write 5 view functions:

  1. dog_list(request) should display the list of dogs on the HTML page like following:
  2. dog_get(request, pk) should display the information about the selected Dog by pk (id).
  3. dog_create(request) should create the new Dog with the name "Unknown", age 0, and weight 1.1.
  4. dog_update(request, pk) should update the Dog's name to "Updater", age += 1, and weight += 0.2.
  5. dog_delete(request, pk) should delete the existing dog by id.

Connect views to URLs

URLView
dogs/dog_list
dogs/id/dog_get
dogs/id/update/dog_update
dogs/id/delete/dog_delete
dogs/create/dog_create

Все було зрозуміло?

Note

The presented code for the task is part of the framework and cannot work separately, so errors will be received when you try to Run Code. Use the Submit Task button to solve this task.

Завдання

You have already implemented Model class:

Write 5 view functions:

  1. dog_list(request) should display the list of dogs on the HTML page like following:
  2. dog_get(request, pk) should display the information about the selected Dog by pk (id).
  3. dog_create(request) should create the new Dog with the name "Unknown", age 0, and weight 1.1.
  4. dog_update(request, pk) should update the Dog's name to "Updater", age += 1, and weight += 0.2.
  5. dog_delete(request, pk) should delete the existing dog by id.

Connect views to URLs

URLView
dogs/dog_list
dogs/id/dog_get
dogs/id/update/dog_update
dogs/id/delete/dog_delete
dogs/create/dog_create

Секція 4. Розділ 4
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt