I have joined to one project recently, and they have model which has 18 fields :///// Is it normal or not?
Can anyone share with sources containing some info about optimal field amount per model ? Thanks
18 fields are not much. It all depends on you data. I have seen tables with 100 fields/columns in big ERP systems.
There is no rule of thumb.
What are the alternatives?
You could bundle some related fields into a Model which has a one-to-one relationship to your original model. But this has the drawback that you need to create the one-to-one instance somehow. Or you need to check again-and-again in your code for the special case that the one-to-one instance is not there yet. But that is not DRY.
Good luck, Thomas
User all the number of fields you could need. There is no restriction about it, so just make what you need and if in some point you have a problem, look for a solution.
That said… what could be a problem is maintenance, if you have several models with lot of fields, Metas, methods, etc. It is better to split them is several files inside a “models” directory that will replace the “models.py” file.