﻿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
34199	Add an example for contrib.postgres.aggregates.StringAgg to docs.	Mark Gensler	Mark Gensler	"The documentation is missing an example for StringAgg. Also I thought it would be useful to include an example for ManyToMany fields, in contrast to the OneToMany example for JSONBAgg.

I.e. 
{{{#!python
class Publication(models.Model):
        title = models.CharField(max_length=30)

class Article(model.Model):
        headline = models.CharField(max_length=100)
        publications = models.ManyToManyField(Publication)

>>> article = Article.objects.create(headline='NASA uses Python')
>>> article.publications.create(title='The Python Journal')
>>> article.publications.create(title='Science News')

>>> from django.contrib.postgres.aggregates import StringAgg
>>> Article.objects.annotate(
...     publication_names=StringAgg(
...         'publications__title',
...         delimiter=', ',
...         ordering='publications__title',
...     )
... ).values('headline', 'publication_names')
<QuerySet [{
    'headline': 'NASA uses Python', 'publication_names': 'Science News, The Python Journal'
]}]>
}}}"	Cleanup/optimization	closed	Documentation	dev	Normal	fixed	postgres StringAgg		Ready for checkin	1	0	0	0	0	0
