3 ms·
Thank you, I know now why Django inflicts that .objects method to everybody :-) I'd rather design a less verbose API for the default manager Model.get() M
by pmontra 7y ago
Thank you, I know now why Django inflicts that .objects method to everybody :-)
I'd rather design a less verbose API for the default manager
Model.get()
Model.filter()
...
and Model.manager.get() if one really needs custom managers.
The fact that I didn't know about managers after years of Django (and nobody told me) should be telling of me and my team, of course, but also how needed managers are. Having to go through that API without shortcuts is not nice to developers.
- slig 7y agoYou're welcome. I'm probably biased because Django has been my framework of choice for more than 10 years, but I really like the distinction between methods relative to the Model and methods that act on multiple records and the `objects` thing doesn't bother me.