django-models

Installation
SKILL.md

Django Model Patterns

Core Philosophy: Fat Models, Thin Views

Business logic belongs in models and managers, not views. Views orchestrate workflows; models implement domain behavior. This principle creates testable, reusable code that stays maintainable as complexity grows.

Good: Model methods handle business rules, state transitions, validation Bad: Views contain if/else logic for domain rules, calculate derived values

Model Design

Structure Your Models Around Domain Concepts

  • Use TextChoices/IntegerChoices for status fields and enums
  • Add get_absolute_url() for canonical object URLs
  • Include __str__() for readable representations
  • Set proper ordering in Meta for consistent default sorting
  • Add database indexes for frequently filtered/sorted fields
  • Use abstract base models for shared fields (timestamps, soft deletes, etc.)
Installs
18
GitHub Stars
145
First Seen
Jan 23, 2026
django-models — kjnez/claude-code-django