Re: Validation of m2m

2019-02-21 Thread Bernd Wechner
That would be my guess too. So if it went into the Django core at all, it would need to be documented as a Postgresql only thing I guess (if the guess proves right). This might also then figure in the recommendation on databases. Postgresql is already recommended as the production database by D

Re: Validation of m2m

2019-02-21 Thread Chris Foresman
My guess is this does not work on MySQL or SQLite, since as far as I can tell it’s the only DB that will return IDs when bulk inserting. I’d think you’d have to have some other code path to handle those DB backends. -- You received this message because you are subscribed to the Google Groups

Re: Validation of m2m

2019-02-21 Thread Bernd Wechner
That's an idea I like. Though it affects OneToMany relations too (no idea why this is so often presented as an m2m issue, when it's literally a 2m issue. So I'd prefer the attribute to be something like validate_tomany_relations or validate_2m perhaps. The focus on m2m is misleading. Either

Re: Validation of m2m

2019-02-21 Thread Ian Foote
I don't think a new setting is the way to go. I'd prefer to add an attribute (validate_m2m = False?) to the CreateView and UpdateView classes that allows a developer to opt-in to the new behaviour when they need it. This is more flexible and still maintains backwards compatibility. Regards, Ian O

Re: Validation of m2m

2019-02-21 Thread Bernd Wechner
Most once sided discussion I've seen on a developers group in a while ;-), but I'll go so far as to suggest an API for the Django Core on this one. I mean I have a way to advance myself now, but methinks this need is so common that perhaps it's best sitting in the Django Core, albeit with a set

Re: Validation of m2m

2019-02-20 Thread Bernd Wechner
Ouch, I am not believing my eyes, but somewhat overjoyed with what I have found in my explorations over recent evenings empirically exploring transactions. The TLDR is this: I am puzzled that I haven't tested and found this to date, and that all the folk I read online asking for m2m ORM validat

Re: Validation of m2m

2019-02-16 Thread Bernd Wechner
. Propose an API, and speak to how it won't impact existing > users, and I think you'll find lots of people will have something to say. > > FWIW, I'd be interested in seeing some kind of solution. Our ($work$) > current response to feature requests that involve validation

Re: Validation of m2m

2019-02-16 Thread Josh Smeaton
existing users, and I think you'll find lots of people will have something to say. FWIW, I'd be interested in seeing some kind of solution. Our ($work$) current response to feature requests that involve validation of m2m fields is "too hard for the effort". Cheers On Friday

Re: Validation of m2m

2019-02-15 Thread Bernd Wechner
I'm curious what consensus looks like. In what forum among which stakeholders. Clearly among developers who have some knowledge of Djangos innards, and so I suspect here. But I find conversation here on this thread so neatly short I can digest it in a short read, and https://code.djangoproject

Re: Validation of m2m

2015-12-04 Thread Federico Capoano
It could be a potential ticket to work on my next django dev sprint. But first it would be nice to have some basic consensus on how to proceed. Was it ever discussed in any older thread or ticket? On Thursday, December 3, 2015 at 5:21:06 PM UTC+1, Tim Graham wrote: > > Here's an open ticket ab

Re: Validation of m2m

2015-12-03 Thread Tim Graham
Here's an open ticket about adding model level validation for many-to-many: https://code.djangoproject.com/ticket/12938 On Thursday, December 3, 2015 at 11:04:22 AM UTC-5, Federico Capoano wrote: > > Thanks Aymeric, > > I decided to post this problem on django-developers because I've read this >

Re: Validation of m2m

2015-12-03 Thread Federico Capoano
Thanks Aymeric, I decided to post this problem on django-developers because I've read this ticket: https://code.djangoproject.com/ticket/24731 Sorry for omitting this information. Has there been a discussion about this topic already? Would it be hard to implement an easier solution into django?

Re: Validation of m2m

2015-12-03 Thread Aymeric Augustin
Hello Frederico, It appears that you're hitting the problem described in the "Avoid catching exceptions inside atomic!" warning on this page: https://docs.djangoproject.com/en/1.8/topics/db/transactions/#handling-exceptions-within-postgresql-transactions To obtain that sort of result, I suppose y

Validation of m2m

2015-12-03 Thread Federico Capoano
Hi everybody, I am sure it has happened to many of you. Validating m2m BEFORE saving the relationships is very hard and time consuming. Now this solution: http://schinckel.net/2012/02/06/pre-validating-many-to-many-fields./ Proposes to solve it with a ModelForm in the admin. Cool, that works.