November 2015
Beginner to intermediate
840 pages
26h 30m
English
slug FieldBefore diving into the code of clean_slug(), it is worth considering what action we must take. For clarity’s sake, we decided that our URLs should be case insensitive, meaning by proxy that slug fields should be case insensitive, and that as such, we would store all slugs as lowercase strings in the database. We should then write a clean_slug() method similar to clean_name().
However, the slug field of our Tag model comes with another constraint. Much like when building our models, looking ahead to our URL configuration can save us programming time in the long run. At the moment, our organizer_tag_detail URL pattern reads as shown in Example 7.14.
Example 7.14: Project Code ...
Read now
Unlock full access