Org Web Adapter

hungryroot/jira/be_7469_create_the_cookbook_app_and_assocaited_models.org

ID
c0d87e8c-2cea-4efd-b340-52b625750d53

BE-7469 Create the Cookbook app and associated models

- source :: https://hungryroot.atlassian.net/browse/BE-7469

- tags :: Hungryroot API Project

- epic :: EP-627 Exp 232: Cookbook MVP

- sprint :: HR BE Sprint 107

- status :: Status - To Do

- priority :: Priority - High

- points :: 1

Description

We need to initialize the new cookbooks Django application to support the

upcoming Cookbook feature set. This task involves scaffolding the app,

implementing the core data models as per the technical design, configuring the

Django Admin for content management, and ensuring test coverage for the initial

setup.

This is a foundational task required before business logic implementation can

begin.

Acceptance Criteria

App Creation: The cookbooks app is created and added to INSTALLED_APPS.

Models: The following models are implemented in models.py according to the

design spec:

Cookbook

CookbookAuthor

CookbookSection

CookbookItem

Admin Interface: Django Admin is configured to allow CRUD operations for all

models.

CookbookSection and CookbookItem must be editable via Inline Forms within the

Cookbook admin view.

Database: Migrations are created and successfully applied to the local/dev

database without errors.

Testing: Unit tests are written and passing for:

Model field validation and string representations (__str__).

Admin registration and inline configuration.

Code Quality: Code passes linting checks and is merged via Pull Request.

Technical Implementation Notes

Design Reference: See technical design document here:

https://hungryroot.atlassian.net/wiki/spaces/BA/pages/edit-v2/1430945793

Model Relationships:

Ensure Foreign Keys and on_delete behaviors match the ERD in the design doc.

Use ordering meta options where specified (e.g., order items by section).

Admin Configuration:

Use admin.StackedInline or admin.TabularInline for Sections/Items.

Ensure search fields and list filters are added for Cookbook and Author for

easier management.

Testing:

Use django.test.TestCase.

Verify that a Cookbook can be created with nested Sections and Items via the

admin inlines in tests.

Dependencies

None (Foundational Task)