😃

On Jan 18, 2019 3:19 PM, "Kasper Laudrup" <[email protected]> wrote:

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



-- 
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/8daaaf0f-17c3-69c5-8b86-915df7ba348e%40stacktrace.dk
.

For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEPfumjfe6bdiiOa%2BVg-TixRoFNgd1CEiyVwMCET-McDD7FTCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to