PacktPublishing / Django-5-By-Example

Django 5 By Example (5th Edition) published by Packt
https://djangobyexample.com/
MIT License
250 stars 112 forks source link

Typo on page 713 in chapter 16 #23

Open HBarotov opened 4 months ago

HBarotov commented 4 months ago

Here is the screenshot from the book: image

In raw_id_fields =[ 'user', 'content'] the content should be course as the value(s) of raw_id_fields must be either a foreign key or many-to-many field.

Here is the traceback (with docker-compose.yml)

web_1    | ERRORS:
web_1    | <class 'chat.admin.MessageAdmin'>: (admin.E003) The value of 'raw_id_fields[1]' must be a foreign key or a many-to-many field.
pawel-wu commented 4 weeks ago

There's a typo in the last line of the markup: replace the content with course like:

raw_id_fields = ['user', 'course']

The code stored in GitHub contains correct value, so this is just a typo in the book.