Django save, column specified twice -


I want to save a modified model, but I get a programming error - a field is specified twice.

  Class ProductInfo (models.Model): product_info_id = models.AutoField (primary_key = true) language_id = models.IntegerField () product_id = models.IntegerField () Description = models.TextField (empty = True) position = Models.IntegerField () model = model.heldfile (max_length = 255, empty = true) label = model I get this error because the use of the foreign key is db_column language_id (Frequency_name, verbos_name = 'category_info', db_column = 'language_id', to_field = 'node_id', null = true)  

If I remove it, then my object will be saved properly.

I do not quite understand what is going on and since I have defined all my models in this way, I have completely misunderstood it or maybe I just misunderstood it. ..

Any ideas?

Regards

I do not know why you defined your model like this But I think that you are working with a legacy database schema or you are new to the demo.

The above code is named as the two columns named language_id Django is not allowing you to do this, because each field should have control over its database columns. I'm not sure that you are trying to achieve two fields by pointing in the same database column.

If you are new to the deeggo and this is a new database, then it seems that you're doing things wrong 'again that the definition of the following model is being searched for you :

  class ProductInfo (models.Model): language = model. Finnish (language) product = model FERGIN (Product) Description = Model .extField (default = "", empty = true) position = model.Intergrilled (option = STATUS_CHOICES) model = models.CharField (max_length = 255, default = "", empty = true) label = Model. ForeignKey (CategoryInfo, Null = True)  

Comments