-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
Description
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')