Hi Ivan,
On 1/18/19 10:25 AM, Ivan Martić wrote:
> Hi all,
> i am having trouble to get this query on db table right.
> I am always getting error.
>
In your definition of the Material model, the materialid field is
defined like this:
materialid = models.CharField(db_column='MaterialID', max_length=10)
Whereas you refer to it in Productgroupinput like this:
materialid = models.ForeignKey(Material, on_delete=models.CASCADE,
db_column='Materialid', max_length=10)
Notice the difference in the db_column parameter?
I guess that could be the cause of your error.
Kind regards,
Kasper Laudrup