novo-manager

Create custom Django Managers and QuerySets with Portuguese-named filters.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cria um Manager e QuerySet customizados no Django para um model do SurveyHub, consolidando padrões de filtros, anotações e otimizações de consultas.

Core Features & Use Cases

  • Manager personalizado: define métodos de filtragem com nomes em português (ativos, nao_deletados, do_usuario) e suporte a anotações com Count.
  • QuerySet reutilizável: encapsula lógicas comuns para evitar duplicação em views e testes.
  • Integração com padrões do projeto: segue convenções de nomenclaturas e facilita a extensão a múltiplos modelos.

Quick Start

Crie o arquivo apps/{app}/managers.py conforme o modelo fornecido e registre o novo Manager no modelo alvo, importando-o onde necessário.

Frequently Asked Questions about novo-manager

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

FAQPage Schema
How do I create a custom Django manager with reusable querysets?

To create a custom Django manager, define a QuerySet class with custom filter methods and attach it to a Manager class, then register the Manager on your target model to enable reusable querying patterns and avoid logic duplication in views.

What is the best way to encapsulate common Django model filters and annotations?

The best way to encapsulate common Django model filters and annotations is by defining a custom QuerySet that consolidates query logic, enabling consistent domain-driven data access layers and preventing duplicated filtering code across multiple views and tests.

How do I add annotated counts to a Django queryset using a custom manager?

You can add annotated counts to a Django queryset by defining methods on your custom QuerySet that utilize Django's Count annotation, then exposing these methods through your custom Manager to deliver optimized, aggregated query results directly.

Does this custom Django manager approach support project-specific naming conventions?

Yes, this custom Django manager approach supports project-specific naming conventions by allowing developers to define custom filter methods with localized names, ensuring the data access layer aligns directly with established domain-driven project conventions.

When should I build a custom Django manager instead of using the default model manager?

You should build a custom Django manager instead of using the default when your project requires reusable query logic, domain-specific filters, or annotated counts across multiple views, ensuring a clean, extensible data access layer.

Why do my Django views have duplicated query logic and how can a custom manager fix it?

Django views have duplicated query logic when filtering code is written repeatedly, and a custom manager fixes this by encapsulating those common filters and annotations into a reusable QuerySet, centralizing the data access patterns.