These are chat archives for django/django

23rd
Apr 2018
Falgun Swami
@swamifalgun
Apr 23 2018 11:11
can anyone help me on django rest framework ?
Mykhailo Havelia
@Arfey
Apr 23 2018 11:50

Hi everyone. I am porting my django app to python 3. After ported django need to make migrations where it make empty alter for each field. It’s okey, but some alter fields aren’t empty

ALTER TABLE “object" ALTER COLUMN "created_at" SET DEFAULT '2018-04-23T11:27:48.648279+00:00'::timestamptz;
ALTER TABLE “object" ALTER COLUMN "created_at" DROP DEFAULT;

alter with default value is too difficult operation for my db, so i can’t to do that. Has anyone had simpilar problem? Or maybe you know why django needs to do that.

Ian Carpenter
@Sazpaimon
Apr 23 2018 17:10
something I've noticed when upgrading django 1.8 to 1.11: if you do a hasattr() check on a object's GenericForeignKey field that doesn't exist, it will no longer cache the fact that the object doesn't exist and execute a new query each time you do hasattr() for that field on that object's instance. Is that an intentional change?