Adding support for postgres 10

2017-10-01 Thread Amir Reza Ghods
Postgres 10 is coming with some exciting features such as native partitioning. Would it be a good idea to plan for supporting these new features in Django? -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. T

Re: bulk_create on Postgresql: on conflict do nothing / post_save signal

2017-10-01 Thread Дилян Палаузов
Hello, fetching 3GB of existing records to only pass afterwards to bulk_create() some non-existent ones is not feasible. I found a way to convince Postgresql to report which rows were not inserted on INSERT ON CONFLICT DO UPDATE: Consider this: CREATE TABLE t ( id SERIAL PRIMARY KEY, na

non-concurrent QuerySet.get_or_create() on Postgresql

2017-10-01 Thread Дилян Палаузов
Hello, currently get_or_create(params) is implemented (imprecisely) this way: try: self.get(params) except DoesNotExist: self._create_object_from_params(params) This creates concurrency problem, as the object might get created by another thread, after get(params) threw an exception and bef

Prevent DateRangeField overlap in model?

2017-10-01 Thread Brylie Christopher Oxley
Now that Django supports the DateRangeField, is there a 'Pythonic' way to prevent records from having overlapping date ranges? # Hypothetical use case One hypothetical use case would be a booking system, where you don't want people to book the same resource at the same time. # Hypothetical exam