Skip to content

Issues with annotating a queryset #95

@byrman

Description

@byrman

Annotating a queryset with a field that conflicts with a field on a model is working fine with Django 1.11.* and django-postgres-extra 1.22. If we bump Django to 2.2.11 (LTS), however, our tests fail (both with psqlextra 1.22 and 2.0a14): the annotated field appears to get lost in the renaming proces.

Another (small) issue is in the current documentation: https://django-postgres-extra.readthedocs.io/en/master/annotations.html#renaming-annotations.

This statement doesn't work:

MyModel.objects.annotate(name_upper=Upper('name')).rename_annotations(name='name_upper')

and probably has to be:

MyModel.objects.annotate(name_upper=Upper('name')).rename_annotations(name_upper='name')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions