Changes between Version 19 and Version 20 of DjangoSpecifications/Core/SingleInstance
- Timestamp:
- Mar 25, 2008, 8:30:13 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DjangoSpecifications/Core/SingleInstance
v19 v20 116 116 == Discussions == 117 117 === Internal API === 118 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).118 ''(David)'' 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). 119 119 120 Another approach would be to make this explicit and have a simple API along the lines of:120 ''(Philippe)'' Another approach would be to make this explicit and have a simple API along the lines of: 121 121 {{{ 122 122 class ModelBase: … … 129 129 === Default behavior === 130 130 Should this feature be enabled by default ? 131 * Philippe: It should be because it really makes the ORM behave more correctly but for the sake of backward compatibility let's fist commit off by default. We can 132 change the default parameter value later, and in the meantime honor a global setting to turn it on for all models. 131 * ''(Philippe)'' It should be because it really makes the ORM behave more correctly but for the sake of backward compatibility let's fist commit off by default. We can change the default parameter value later, and in the meantime honor a global setting to turn it on for all models. 133 132 134 * David: This would always be enabled. You cannot turn it off. If stuff is broken by having this on then it should be broken. 135 This can cause problems with serializers, and things that modify querysets and shouldn't (e.g. .extra). That is the only reason it should be turned off. If those problems are addressed there is no reason to use #17 and to have it enabled 100% of the time. 133 * ''(David)'' This would always be enabled. You cannot turn it off. If stuff is broken by having this on then it should be broken. This can cause problems with serializers, and things that modify querysets and shouldn't (e.g. .extra). That is the only reason it should be turned off. If those problems are addressed there is no reason to use #17 and to have it enabled 100% of the time. 136 134 137 135 === extra, values ===