Re: Feature Request: New PostgreSQL ArrayField

2022-08-11 Thread Liamine Cheridi
Hello, thanks a lot for your answers. I am very embarrassed to say that I went a bit too fast in my testing of nested ArrayField, and it turns out that it actually fits my use case. def test_nested_array_accepts_1D_array(self): instance = NestedIntegerArrayModel(id=1, field=[1, 2, 3])

Re: Feature Request: New PostgreSQL ArrayField

2022-08-11 Thread Adrian Torres
Hi Liamine, I think there's various solutions you could try before going the custom field route: * You could try just using the 2D version and use some sentinel value for the date (NULL?) to treat the case where you just want an array of N prices. * You could try using django-polymorphic [1]

Re: Feature Request: New PostgreSQL ArrayField

2022-08-10 Thread Jacob Rief
Hello Liamine, Django offers a JSONField which can be used to store an array. You can use it to store a list of prices. What's the benefit of using an array instead of JSON? – Jacob -- You received this message because you

Feature Request: New PostgreSQL ArrayField

2022-08-10 Thread Liamine Cheridi
Hello to all, at Pricemoov we’re using Postgresql arrays ( https://www.postgresql.org/docs/15/arrays.html) to store prices of a given product. More precisely, a given product can have either: - standard: N prices (1d array) -