Changes between Version 17 and Version 18 of DjangoSpecifications/Core/SingleInstance


Ignore:
Timestamp:
03/25/2008 06:07:01 AM (7 years ago)
Author:
PhiR
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DjangoSpecifications/Core/SingleInstance

    v17 v18  
    9999#17 currently has a working patch with the following:
    100100 * Per-model WeakValueDictionary with dict[pk_val] = instance.
    101  * __call__ classmethod which either gets a instance from the dict or return a newly created one.
     101 * !__call!__ classmethod which either gets a instance from the dict or return a newly created one.
    102102 * a simple interface for enabling or disabling the feature for a given Model (default is disabled).
    103103 * a slightly modified related manager which will first try to get the instance from the Model dict instead of blindly querying the DB.
     
    115115
    116116=== Discussion ===
    117 The current patch design overrides the ____call____ method for the model base which means it automatically returns singleton instances when available. This is convenient because XXX (David or Brian: feel free to fill this out).
     117The current patch design overrides the !__call!__ method for the model base which means it automatically returns singleton instances when available. This is convenient because XXX (David or Brian: feel free to fill this out).
    118118
    119119Another approach would be to make this explicit and have a simple API along the lines of:
Back to Top