# categorizing models in own files instead of models.py

**URL:** <https://forum.djangoproject.com/t/categorizing-models-in-own-files-instead-of-models-py/26277>\
**Category:** Getting Started\
**Created:** [December 19, 2023, 8:50am UTC](https://forum.djangoproject.com/t/categorizing-models-in-own-files-instead-of-models-py/26277 "2023-12-19T08:50:47Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [December 19, 2023, 5:12pm UTC](https://forum.djangoproject.com/t/categorizing-models-in-own-files-instead-of-models-py/26277/6 "2023-12-19T17:12:48Z")

</div>

> [@HamaBarhamou](#):
>
> However, I’d like to understand better why this approach could be problematic.

My experience has been that “clarity and organization” - _especially_ in larger projects, is _not_ enhanced by dramatically increasing the number of files involved. In fact, I have found the exact opposite to be true.

We don’t even begin to think about splitting apart our models.py files until they’re at least 2000 lines, and will let them get to about 2500 before taking action. (And, in some cases - typically when external databases are involved, that “action” ends up being “do nothing” because we recognize there’s no benefit in _those_ cases by splitting up the models.)

And, in those cases where we do choose to do something, as often as not it ends up being a situation where we split a whole chunk of functionality off as a separate app.

> [@HamaBarhamou](#):
>
> With this structure, each model is placed in its own file for better organization and clarity, especially in large projects.

I can respect the fact that you have that opinion. We (the development team I am a part of) don’t share that opinion and disagree with the conclusion. We all have backgrounds with large Java-based projects and have concluded that the “one-class-per-file” default standard is extremely counter-productive and have found much practical benefit in the “fewer-files-are-better” approach.

---

_[View the full topic](https://forum.djangoproject.com/t/categorizing-models-in-own-files-instead-of-models-py/26277)._
