Opened 11 years ago

Closed 11 years ago

#21853 closed Bug (fixed)

Manager.__module__ holds a wrong value.

Reported by: loic84 Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The combination of BaseManager.from_queryset() (Django 1.7 #20625) and RenameMethodsBase (Django 1.6 #15363) results in Manager.__module__ having the wrong value. This can be an issue when trying to pickle the Manager class.

It's not immediately obvious to me why a Manager would need to be pickled but it caused an issue in a third party app; regardless, it's a regression and having the wrong __module__ in error messages isn't helpful.

It's worth noting that we'll get rid of the RenameMethodsBase metaclass for BaseManager in 1.8, so this problem will eventually fix itself.

Change History (2)

comment:1 by loic84, 11 years ago

Has patch: set

comment:2 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 3e4dc5ecf25aa2b38eed73472899f0de5a319c04:

Fixed #21853 -- Fixed Manager.module to properly return 'django.db.models.manager'.

The combination of BaseManager.from_queryset() and RenameMethodsBase results in
Manager.module having the wrong value. This can be an issue when trying to
pickle the Manager class.

Note: See TracTickets for help on using tickets.
Back to Top