﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19384	Managers can no longer be used on abstract models	Mark Hughes	nobody	"Given the (contrived) models.py


{{{
from django.db import models

class ChoiceManager(models.Manager):

    def get_first_choice(self):
        return Choice1

class Choice(models.Model):
    choice = models.CharField(max_length=200)
    votes = models.IntegerField()

    choices = ChoiceManager()

    class Meta:
        abstract = True

class Choice1(Choice):
    pass

class Choice2(Choice):
    pass


}}}


I get the following error when trying to access models.Choice.choices.get_first_choice() using 1.5 (master).


{{{
Traceback (most recent call last):
  File ""/home/mark/venvs/django-14/abstract_managers/demo/tests.py"", line 20, in test_abstract_manager
    models.Choice.choices.get_first_choice()
  File ""/home/mark/venvs/django-15/src/django/django/db/models/manager.py"", line 244, in __get__
    self.model._meta.object_name,
AttributeError: Manager isn't available; Choice is abstract
}}}

The code runs fine under 1.4.

It appears that this behaviour was changed with this commit:

https://github.com/django/django/commit/cc337a74f1808b216fff96f1695d8b066d2636f6

Relating to this ticket:

https://code.djangoproject.com/ticket/19069


"	Bug	closed	Database layer (models, ORM)	dev	Release blocker	fixed		dan.fairs@…	Design decision needed	0	0	0	0	0	0
