Changes between Version 10 and Version 11 of DjangoSpecifications/Core/SingleInstance


Ignore:
Timestamp:
03/24/2008 09:23:02 AM (7 years ago)
Author:
dcramer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DjangoSpecifications/Core/SingleInstance

    v10 v11  
    110110 * it should be possible to force instantiation, because the serializers want that (solved by next item).
    111111 * 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.
    112113 * For the sake of completeness, it should be possible to do Model.objects.get_fresh_instance(id=something) to bypass the singleton
Back to Top