novo-modelo

Generate a Django Fat Model with UUID, soft delete, and state machine.

Updated Mar 23, 2026
One-click install
npx skills add https://github.com/rafaelcostaf4-afk/SurveyHub --skill novo-modelo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: novo-modelo
Source: https://github.com/rafaelcostaf4-afk/SurveyHub/tree/main/.claude/skills/new-entity
Command: npx skills add https://github.com/rafaelcostaf4-afk/SurveyHub --skill novo-modelo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cria um modelo Django completo seguindo o padrão Fat Model para SurveyHub, com UUID PK, TextChoices para status, soft delete e uma state machine com guards, além de propriedades computadas e um Manager customizado.

Core Features & Use Cases

  • Gera um modelo com UUID primary key, status via TextChoices, deleted_at para soft delete, e uma state machine com ativar/pausar/encerrar.
  • Inclui um Manager com métodos em Português (ativos, nao_deletados, do_usuario) e uma seção de traits para testes.
  • Fornece uma Factory com Traits e testes de model.

Quick Start

Diga ao assistente para criar um modelo Django completo seguindo o padrão Fat Model para SurveyHub.

Frequently Asked Questions about novo-modelo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Django Fat Model with UUID primary key and soft delete?

To create a Django Fat Model with UUID primary key and soft delete, you need to define a model with a UUID field, a deleted_at timestamp for soft deletion, and implement a custom manager to handle non-deleted queries automatically.

What is the best way to implement a state machine in a Django model?

Implementing a state machine in a Django model involves using TextChoices for status fields and defining guard methods for transitions like activate, pause, and close to validate state changes before persisting them to the database.

How do I set up a Django model factory with traits for testing state transitions?

Setting up a Django model factory with traits involves defining a factory class that generates model instances with specific state configurations, allowing you to test transitions and soft delete logic across different scenario conditions.

Does the Fat Model pattern in Django include custom managers with Portuguese methods?

Yes, the Fat Model pattern in Django can include custom managers with Portuguese methods like ativos, nao_deletados, and do_usuario to encapsulate query logic and maintain domain-specific readability within the ORM layer.

Can I generate only views for a Django app using the Fat Model pattern?

No, generating only views for a Django app using the Fat Model pattern is explicitly forbidden. The scope covers generating the model in models.py, a custom manager, a factory with traits, and tests for state transitions and soft delete.

When do I need to use TextChoices for status fields in a Django Fat Model?

You need to use TextChoices for status fields in a Django Fat Model when implementing a state machine that requires distinct status values, ensuring type safety and readable string representations for state transition guards.