Re: automatic addition of several ForeignKeys to model

2010-12-29 Thread gintare
Thanks. The thing which i wanted must be done in forms. It is not for models and database. I mean there must be function in views.py which checks if some item already exists in database and add information about this item (item.pk) to another synonim item. On 27 Gruo, 21:15, Emmanuel Mayssat

Re: automatic addition of several ForeignKeys to model

2010-12-27 Thread Emmanuel Mayssat
yes and no ;-) I am not sure I understand clearly, but I believe you want to have let's say 2 word1 links in word2 For that you need yo use the related_name as otherwise in word1, django tries to create 2 word2 fields (which result in an error) 149 class Mentorship(models.Model): 154 mentee =

automatic addition of several ForeignKeys to model

2010-12-27 Thread gintare
Hello, I would like to add ForeignKey which would ass many items to class as much i append-create-give. class word1(models.Model): item=models.CharField(blank=True) class word2(models.Model): itemSynonims=models.ForeignKey(word1) i would like to add several word1 to the class word2.