Django inheritance: specify foreign key name -
i'm new django world, , using django rest framework, don't think relevant problem.
i designed database hand , prefer not use django migrations generate it. have convention use name tablename_id
foreign key.
my problem when want use inheritance, django tries use name parenttablename_ptr_id
instead of parenttablename_id
. there way specify ?
here fake code showing wanted result:
class a(models.model): id = models.autofield(primary_key=true) name = models.charfield(max_length=255, unique=true) class b(a): # other stuff # a_id foreign key a, instead of a_ptr_id
i hope clear, couldn't find answer elsewhere.
thank in advance response !
Comments
Post a Comment