Bird
0
0

Why is it recommended to use signals like pre_save and post_save sparingly in Django projects?

hard📝 Conceptual Q10 of 15
Django - Signals
Why is it recommended to use signals like pre_save and post_save sparingly in Django projects?
ABecause signals can make code harder to trace and debug
BBecause signals always slow down the database
CBecause signals replace the need for model methods
DBecause signals automatically delete related models
Step-by-Step Solution
Solution:
  1. Step 1: Understand signal impact on code

    Signals run code outside normal flow, making debugging and tracing harder.
  2. Step 2: Evaluate other options

    Signals do not inherently slow database, replace model methods, or delete models automatically.
  3. Final Answer:

    Because signals can make code harder to trace and debug -> Option A
  4. Quick Check:

    Signals add hidden complexity, use sparingly [OK]
Quick Trick: Signals add hidden complexity; debug carefully [OK]
Common Mistakes:
MISTAKES
  • Thinking signals always slow database
  • Assuming signals replace model methods
  • Believing signals delete related models automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes