I use SQLite and have a django model with the below data:
| Name | Value |
|---|---|
| A | 1 |
| B | 2 |
| B | 4 |
| C | 7 |
| C | 5 |
I would like to use an aggregate my table so that I can get my data in the below format:
| Name | Value |
|---|---|
| A | 1 |
| B | [2,4] |
| C | [7,5] |
How do I do this with Django.
I'm thinking this may be the answer but Django doesn't seem to have ArrayAgg. This looks to be a PostgreSQL function
Test_Model.objects.annotate(dname=ArrayAgg('name')).values()
Do you know how I can achieve this without using PostgreSQL? Thank you!