Re: Django-admin set foreign key to Null for inlines selected item instead of delete

2014-07-16 Thread Aeh. ABID
This is not for my use case, it was about setting to null foreign key when selecting inline items to be deleted On Tuesday, July 15, 2014 1:38:07 PM UTC+1, ROHITH KUMAR Miryala wrote: > > > >> >> B-id=models.ForeignKey('B',on_delete=models.SET_NULL) >> > -- You received this message because you

Re: Django-admin set foreign key to Null for inlines selected item instead of delete

2014-07-15 Thread ROHITH KUMAR Miryala
> > > B-id=models.ForeignKey('B',on_delete=models.SET_NULL) > -- 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 pos

Re: Django-admin set foreign key to Null for inlines selected item instead of delete

2014-07-14 Thread Aeh. ABID
Indeed introducing m2m relationship was just the solution for this case, now I have B form change with AB_B as Inlines tabular item. thanks a lot On Sunday, July 13, 2014 7:48:05 PM UTC+1, Aeh. ABID wrote: > > > > I Have a model AB that holds two foreign keys A_id and B_id. > > class AB(

Re: Django-admin set foreign key to Null for inlines selected item instead of delete

2014-07-13 Thread Mike Dewhirst
On 14/07/2014 9:23 AM, Aeh. ABID wrote: i'm bit confused here, shouldn't ovverride delete() instead of save() ? and how to retrieve selected items ? Not really. You don't want to delete anything. You want to break a link. Making the foreign key field null will do that. It sounds like you mig

Re: Django-admin set foreign key to Null for inlines selected item instead of delete

2014-07-13 Thread Aeh. ABID
i'm bit confused here, shouldn't ovverride delete() instead of save() ? and how to retrieve selected items ? On Sunday, July 13, 2014 7:48:05 PM UTC+1, 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.For

Re: Django-admin set foreign key to Null for inlines selected item instead of delete

2014-07-13 Thread Mike Dewhirst
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.CharFi

Django-admin set foreign key to Null for inlines selected item instead of delete

2014-07-13 Thread Aeh. ABID
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 o