Changes between Version 10 and Version 11 of DjangoSpecifications/Core/SingleInstance
- Timestamp:
- Mar 24, 2008, 9:23:02 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DjangoSpecifications/Core/SingleInstance
v10 v11 110 110 * it should be possible to force instantiation, because the serializers want that (solved by next item). 111 111 * the internals of the patch should be changed to be less magic: overriding __call__ is a neat trick but I'd rather have something like Model.get_singleton(pk, kwargs = None) and use this where needed (the places are few!). If the user wants to do Model(id = something, kwargs) he should get a fresh instance. If he wanted to have the DB one he'd have used get or something like that. 112 * ^--- This is an opinion, and goes against the idea of this patch. 112 113 * For the sake of completeness, it should be possible to do Model.objects.get_fresh_instance(id=something) to bypass the singleton