Re: Updating foreign key

2021-01-03 Thread Lakshman Kumar
Hi, Please let me know how to write create methods in class based views. In X table contains A, B, C, D foreign keys.example Class X(models.Model) : a=models.ForeignKey(A, on_delete=models.CASCADE) B=fk C=fk D=fk Thanks and regards. Lakshman On Sun, 3 Jan, 2021, 8:46 pm Carl Nobile, wrote: > F

Re: Updating foreign key

2021-01-03 Thread Carl Nobile
First, never use the PK that Django generates as a way to access a record through an API. These types of PKs are a numeric sequence and can leave your site open to sequence attacks where an attacker tries a long series of numbers to access all or many of your records. Use a public ID of some sort,