Deprecation of using pk in public ORM API

2022-02-02 Thread Albert
Hi Daryl,I agree and disagree with you, it depends on place and context of using "pk" alias :)I am not sure if it is good in filter and as object attribute. For our internal use we could use "_pk" or other name.You motivated me to check one thing.class Car(models.Model):    pk = models.IntegerF

Re: Deprecation of using pk in public ORM API

2022-02-01 Thread Daryl
Hi Albert, I think you are going in the wrong direction here; We should leave the 'pk' alias in place, not because it would be hard to remove, and not because it exists in many places, but because aliasing is a stonking great idea. It exists in many places for precisely that reason ; its such a g

Re: Deprecation of using pk in public ORM API

2022-02-01 Thread Albert
Thank you for response.Now i see that it is not so easy as I thought.It is used in many other places in Django and probably also in django rest framework and other third parties libraries. -- You received this message because you are subscribed to the Google Groups "Django developers (Contrib

Re: Deprecation of using pk in public ORM API

2022-01-27 Thread Curtis Maloney
Hello Mike, On Wed, 26 Jan 2022, at 20:46, Albert wrote: > > Hello all, > > I would like to know your opinion about deprecation of using "pk" > alias in filters and other places of public ORM API. > I use Django long time and never use "pk" because in my opinion > it is misleading. > I mean, ins

Deprecation of using pk in public ORM API

2022-01-27 Thread Albert
Hello all, I would like to know your opinion about deprecation of using "pk" alias in filters and other places of public ORM API. I use Django long time and never use "pk" because in my opinion it is misleading. I mean, instead: Car.objects.filter(pk=1) I use Car.objects.filter(id=1) Insted car.