#27241: Annotate doesn't work with PostgreSQL views anymore -------------------------------------+------------------------------------- Reporter: jaap3 | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: master (models, ORM) | Severity: Normal | Resolution: Keywords: postgresql view | Triage Stage: Accepted aggregate annotate | Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by jarshwah): Can you try adding a field as a primary key on the view? Ideally each row would have a unique key in a view (I know this isn't always the case), but if you just **tell** Django that your unmanaged model has a primary key, it'll try to group on that. For what it's worth I've always been a big user of unmanaged models over views - so I'm keen to see this resolved and not abandoned. -- Ticket URL: <https://code.djangoproject.com/ticket/27241#comment:8> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.8bf0b429835c6969c9148d080e418d73%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.