﻿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
35348	Inconsistent behaviour with annotate using concat and GenericIPAddressField	Lorenzo Morandini	nobody	"Concat function behaviour changed from django 3 to django 4 together with GenericIPAddressField. In django 3 it would output only the ip address, now a /32 is included too by default

Example model

{{{
class Example(models.Model):
    ip_address = models.GenericIPAddressField(
        _('ip address'), db_index=True, protocol='IPv4'
    )
    mask = models.PositiveIntegerField(
        _('mask'),
    )

Example.objects.all()
.annotate(
    main_ip=Concat(
        'ip_address',
        V('/')
        'mask'
    )
)
}}}

With an example item with ip 192.168.1.1 and mask 30 the output would be:

in django 3 main_ip: 192.168.1.1/30
in django 4 main_ip: 192.168.1.1/32/30

Is this an expected behaviour? Happens only with concat, an annotate of the ip_address field only produces the output '192.168.1.1'."	Bug	closed	Database layer (models, ORM)	4.2	Normal	needsinfo		Lorenzo Morandini	Unreviewed	0	0	0	0	0	0
