Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
230 views
in Technique[技术] by (71.8m points)

python 3.x - When building forms in Django, is it good practice to use one 'fat' model to contain all my fields for multiple forms?

Context: I am building a car dealership app and have multiple forms to create such as: A basic contact requesting a name, email, phone and comments. A service form requesting the above along with the users make, model and mileage A sales form, requesting all the above again along with a few other similarly relevant questions.

Problem: So I'm trying to find out is it best practice to have one 'fat' model containing all these fields and then create multiple forms from them or to create a model per form?

I know that I should stick to the DRY practices but I would really benefit from a stronger understanding.

question from:https://stackoverflow.com/questions/65649110/when-building-forms-in-django-is-it-good-practice-to-use-one-fat-model-to-con

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...