#21853 closed Bug (fixed)

Manager.__module__ holds a wrong value.

Reported by: loic84 Owned by: nobody
Component: Database layer (models, ORM) Version: master
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 Changed 20 months ago by loic84

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 19 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

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