Malcolm Tredinnick a écrit :
> On Fri, 2008-02-15 at 16:37 +1100, Malcolm Tredinnick wrote:
> [...]
>
>> The change wasn't made solely because of the speed benefits. Models just
>> aren't created that often for it to be the most relevant factor (__new__
>> is only called import time normally).
I use custom metaclasses to do some additional initialization in my code :
class CustomMetaclass(ModelBase):
def __new__(cls, name, attrs, bases):
# Skip Django initialization if we are looking at CustomModel
try:
CustomModel
except NameError:
r
I realized my patch may introduce a memory leak : as I understand what's
going on in django.db.models.fields.subclassing, Creator().value becomes
a class attribute for custom field classes that have SubfieldBase as
their __metaclass__, which leads to the problem illustrated in my unit test.
Stori