On 14/07/2014 4:48 AM, Aeh. ABID wrote:
I Have a model AB that holds two foreign keys A_id and B_id. |class AB(models.Model): A_id= models.ForeignKey('A') B_id= models.ForeignKey('B') field_1= models.CharField(max_length=200, blank=True) field_2= models.CharField(max_length=200, blank=True)| When editing A or B, AB items are edited inlines, what I want to achieve is that when editing let's say B I want to keep the selected AB items and set the foreign key B_id to null instead of deleting them.
Just do B_id = None in the save() method of AB ...
thanks for any hint http://stackoverflow.com/q/24726046/288387?sem=2 -- 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 <mailto:django-users+unsubscr...@googlegroups.com>. To post to this group, send email to django-users@googlegroups.com <mailto: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/f336fd6a-896c-4ed0-b55e-8e2a37d35d60%40googlegroups.com <https://groups.google.com/d/msgid/django-users/f336fd6a-896c-4ed0-b55e-8e2a37d35d60%40googlegroups.com?utm_medium=email&utm_source=footer>. 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/53C30781.8090603%40dewhirst.com.au. For more options, visit https://groups.google.com/d/optout.