Database Router Abstract Base Class (ABC)

2019-04-28 Thread Rick van Hattem (wolph)
Hi guys, It seems to me that an (abstract) base class for the database routers would be useful to inherit for people. Makes implementing a router slightly easier. I was thinking something along these lines: import abc class ConnectionRouterBase(abc.ABC): @abstractmethod def

Re: Database Router Abstract Base Class (ABC)

2019-04-28 Thread Adam Johnson
I don't think this would be that helpful, Django relies on ducktyping, and the router docs ( https://docs.djangoproject.com/en/2.2/topics/db/multi-db/ ) clearly document the signatures, and that the methods are all optional: A router doesn’t have to provide *all* these methods – it may omit one

Re: Proposal: Allow ManyToMany using a intermediary table to be defined as symmetrical

2019-04-28 Thread michel . nadege
Thank you for the feedback :) For reference: Ticket https://code.djangoproject.com/ticket/30421 Pull request https://github.com/django/django/pull/11298 Le vendredi 26 avril 2019 19:13:29 UTC+2, Aymeric Augustin a écrit : > > Hello Nadège, > > While I'm not an expert of this area, your proposal

Re: Database Router Abstract Base Class (ABC)

2019-04-28 Thread Rick van Hattem
On Sun, 28 Apr 2019 at 11:30, Adam Johnson wrote: > I don't think this would be that helpful, Django relies on ducktyping, and > the router docs ( > https://docs.djangoproject.com/en/2.2/topics/db/multi-db/ ) clearly > document the signatures, and that the methods are all optional: > > A router

Re: Proposal to format Django using black

2019-04-28 Thread Aymeric Augustin
> On 14 Apr 2019, at 15:10, Josh Smeaton wrote: > > Finally, there are some tricks you pick up if black fights you on some > decisions. To use Berkers example: > > TIME_INPUT_FORMATS = [ > '%H:%M:%S', # '14:30:59' > '%H:%M:%S.%f', # '14:30:59.000200' > '%H:%M', # '14:30' > ] >

Re: Deferring "Sign the CLA"

2019-04-28 Thread J. Pic
Also signing the GPG signed CLA to the cla@ email might be less hassle for the board to receive and for most of current contributors to do, for example i couldn't sign in docusign for a few months without apparent reason using a gmail account, but maybe I'm the only person that was affected by

Re: Support for CTAS statement with ORM API?

2019-04-28 Thread Markus Elfring
> AFAIU from the link, the source code is extending SQLAlchemy to support CTAS, > so it's not built-in there. It seems that the functionality is already usable by this class library in a convenient way. > It's similarly possible to do a CTAS in Django with a little raw SQL > and the ORM's

Re: Support for CTAS statement with ORM API?

2019-04-28 Thread Adam Johnson
> > This is an usual challenge for such software extensions, isn't it? It's more around having an API that makes intuitive sense to ORM users. Django is very model-focused and the ORM is mostly designed to work with tables that are created by migrations. I published examples where data

Re: Proposal to format Django using black

2019-04-28 Thread Markus Holtermann
 Aymeric. Thank you! On Sun, Apr 28, 2019, at 4:51 PM, Aymeric Augustin wrote: > Hello, > > Here's my attempt at summarizing the conversation in a DEP: > https://github.com/django/deps/pull/55. > > It's easier to read as a rich diff: >

Re: Proposal to format Django using black

2019-04-28 Thread Aymeric Augustin
Hello, Here's my attempt at summarizing the conversation in a DEP: https://github.com/django/deps/pull/55 . It's easier to read as a rich diff: https://github.com/django/deps/pull/55/files?short_path=95a1a7b#diff-95a1a7b430e2608b84f5c834fd6c258c

Re: Proposal to format Django using black

2019-04-28 Thread Alexander Hill
Hi all, Could we do the work to make black (or another suitable formatter) apply only to a range of lines? Prettier has this feature[0], which is used by precise-commits[1] in the way we'd want to use it for Django. It takes a range of lines, expands the range to statement boundaries, and formats