Closed bartczak-pa closed 2 months ago
This pull request adds support for Category and Recipe slugs, enhancing URL structure and improving SEO. It introduces new views, updates existing ones, modifies models to include slug fields, adjusts URL patterns, and adds corresponding tests. The changes also include template updates to reflect the new URL structure and minor improvements to the user interface.
Change | Details | Files |
---|---|---|
Added slug fields to Category and Recipe models |
|
recipes/models.py recipes/migrations/0001_initial.py recipes/migrations/0002_recipe_slug.py recipes/migrations/0003_alter_recipe_slug.py recipes/migrations/0004_alter_category_slug.py |
Updated views to support new URL structure with slugs |
|
recipes/views.py |
Adjusted URL patterns to use slugs instead of primary keys |
|
recipes/urls.py |
Updated templates to reflect new URL structure and improve UI |
|
recipes/templates/recipes/recipe_list.html recipes/templates/recipes/category_list.html recipes/templates/recipes/category_recipes_list.html |
Added comprehensive tests for new and modified views |
|
recipes/tests/test_views.py |
Summary by Sourcery
Add support for slugs in Category and Recipe models to enhance URL structure and navigation. Implement a new view to list recipes by category and update existing views and templates to utilize slugs. Introduce tests to validate the new functionality.
New Features:
Enhancements:
Tests: