When I change the *base_manager_name* and try to update the model an
exception is raised <http://pastebin.com/PNs4axGC>.

This is my code:

class ProdutoServicoManager(models.Manager):
    def get_queryset(self):
        expression = models.Sum(models.F('custounitario__valor') *
models.F('custounitario__quantidade'))
        total_expr = models.ExpressionWrapper(expression,
output_field=models.DecimalField())
        return super().get_queryset().annotate(custo_producao=total_expr)

class ProdutoServico(Base):
    produto = models.BooleanField(default=True)
    descricao = models.TextField()
    objects = ProdutoServicoManager()

    class Meta:
        base_manager_name = 'objects'

I thought I had found the answer to this problem in issue 19513
<https://code.djangoproject.com/ticket/19513>, but it was already closed.
Apparently this error reappears when I try to annotate the base_manager.

Should I open a new issue?
-- 

Elton Pereira de Lima

-----------------------------

Quem nada dúvida, nada descobre.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOxxup03o_ie%2BusbxSMcNozAf8hAiuOy8oaX1F8%3DjP8AoaFBYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to