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
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
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
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
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.