|
|
|
|
|
by rpep
1105 days ago
|
|
ModelManagers are directly coupled to one model though. You mix concerns if you need to reference other models in them. For e.g. say you have a User model and a corresponding “Profile” model. If you need to create the profile object when the user is created, it doesn’t really feel appropriate to put that in a UserModelManager directly coupled to the User object. This is the example given from the Hacksoft Django style guide to advocate creating a service layer. In terms of the abstraction, I totally agree and tend to be pretty pragmatic about this sort of thing. |
|