Hi Erik,
the idea was, that one Author can write in more than one language (eg. en and de), or no one at all. This was the background to use the ManyToManyField.
But the "error" Message must have an other reason?
Best Regards,
Mike
Gesendet: Dienstag, 04. November 2014 um 22:42 Uhr
Von: "Erik Cederstrand" <erik+li...@cederstrand.dk>
An: "Django Users" <django-users@googlegroups.com>
Betreff: Re: Beginner: ManyToManyFields error creating the model / adding values by the Admin Module or the Shell
Von: "Erik Cederstrand" <erik+li...@cederstrand.dk>
An: "Django Users" <django-users@googlegroups.com>
Betreff: Re: Beginner: ManyToManyFields error creating the model / adding values by the Admin Module or the Shell
> Den 04/11/2014 kl. 19.16 skrev lnzy3...@gmx.de:
>
> Hi,
> Sorry, via the admin interface (Web-GUI) I have inserted the following values:
> My Actions
> en
> Language
>
> mike.test // t...@test.de
> User
>
> Dan Brown
> Author
>
> If I now try to add an Interest (“Dan Brown” and “en”) via the GUI selection I get:
> TypeError at /admin/BookReminder/interest/add/
> sequence item 0: expected string,ManyRelatedManager found
It looks like the Interest model is supposed to connect one author with one language. In that case, the fields the Interest class should be models.ForeignKey, not models.ManyToManyField.
Erik
--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4736339F-EEBA-41C6-B9E7-D12B161A0B46%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.
>
> Hi,
> Sorry, via the admin interface (Web-GUI) I have inserted the following values:
> My Actions
> en
> Language
>
> mike.test // t...@test.de
> User
>
> Dan Brown
> Author
>
> If I now try to add an Interest (“Dan Brown” and “en”) via the GUI selection I get:
> TypeError at /admin/BookReminder/interest/add/
> sequence item 0: expected string,ManyRelatedManager found
It looks like the Interest model is supposed to connect one author with one language. In that case, the fields the Interest class should be models.ForeignKey, not models.ManyToManyField.
Erik
--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4736339F-EEBA-41C6-B9E7-D12B161A0B46%40cederstrand.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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/trinity-c759f3ff-0ab7-478c-8506-c7970ec28c5b-1415138875916%403capp-gmx-bs48.
For more options, visit https://groups.google.com/d/optout.