delete a key from Django’s bank

Asked

Viewed 43 times

0

When I delete this column from the table, Django shows me an error, so I understood this key is stored in the bank, is that it? And to delete not only remove line 57 (marked on image) Finally how do I get rid of these data that I no longer want?

inserir a descrição da imagem aqui

1 answer

0

Luciano, as the Category model is within the Product via Inline model, what Jango assumes is that they contain a relationship. Therefore, deleting line 57 would result in the error reported in the photo.

You can delete the Categoriainline class, remove the Productoadmin quote and then delete the foreign key in the model.

I don’t know if you could erase the database data using only Django. I believe that in this case it is easier to use the SQL client q vc is using to delete the information that is no longer needed.

  • Carlos, I did what you suggested, deleted in pgAdmin. And solved a part. another error continued and I ended up discovering that this option: Inline doesn’t apply to what I was doing, I could only realize it now. But it all worked out, so thank you!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.