[Fixed]-Django: Any negative effect of assigning value to related object and save

1👍

No. It is exactly the same. Django will perform the SELECT the first time you access the instance.user object. This object behaves like any other (it doesn’t matter if you use a new reference for it).

If you take into account the moment when the query is performed, you can treat your models pretty much like any python object.

👤Alvaro

Leave a comment