✅ 28 تا best practice توی کار با مدل های جنگو (عناوین مقاله رو اینجا گذاشتم)
برای دیدن جزییات لینک رو باز کنید.
1. Correct Model Naming
2. Relationship Field Naming
3. Correct Related-Name
4. Do not use ForeignKey with unique=True
5. Attributes and Methods Order in a Model
6. Adding a Model via Migration
7. Denormalisations
8. BooleanField
9. Business Logic in Models
10. Field Duplication in ModelForm
11. Do not use ObjectDoesNotExist
12. Use of choices
13. Why do you need an extra .all()?
14. Many flags in a model?
15. Redundant model name in a field name
16. Dirty data should not be found in a base
17. Getting the earliest/latest object
18. Never make len(queryset)
19. if queryset is a bad idea
20. Using help_text as documentation
21. Money Information Storage
22. Don’t use null=true if you don’t need it
23. Remove _id
24. Define unicode or str
25. Transparent fields list
26. Do not heap all files loaded by user in the same folder
27. Use abstract models
28. Use custom Manager and QuerySet
لینک:
https://steelkiwi.com/blog/best-practices-working-django-models-python/