Re: Model Creation Optimization

2008-02-15 Thread Luper Rouch
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).

Re: Model Creation Optimization

2008-02-14 Thread Luper Rouch
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

Ticket #5989

2007-11-26 Thread Luper Rouch
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