Make sure objects such as `django.db.models.Model` subclasses can be pickled correctly and `callable` objects can be wrapped to be retreived using the ORM. #3
Prior to this patch attempting to update a Model instance with a PickledObjectField referencing a django.db.Model subclass (or any object with the prepare_database_save) property raised a TypeError and there was no way to retreive a stored object that was callable since the ORM would try to filter on the actual return value of the object instead of the object instead (this is a desired and documented behavior to allow Model.objects.filter(datetime_field__gte=datetime.now) to work correctly and is especially usefull when defining limit_choices_to).
Prior to this patch attempting to update a Model instance with a
PickledObjectField
referencing adjango.db.Model
subclass (or any object with theprepare_database_save
) property raised aTypeError
and there was no way to retreive a stored object that wascallable
since the ORM would try to filter on the actual return value of the object instead of the object instead (this is a desired and documented behavior to allowModel.objects.filter(datetime_field__gte=datetime.now)
to work correctly and is especially usefull when defininglimit_choices_to
).