Take the 2-minute tour ×

I have models like :

class A(models.Model):

    b = ForeignKey(B,unique=True, db_index=True)
    #other fields

        self.b.some_field = 'value'

class B(models.Model):

    #fields here

The problem here is when I save A's value and hit save (either from admin or from the shell) The value of the corresponding B instace (i.e self.b) save does not get called. The object b is not getting the value value it is supposed to get.

What is going on here ?

share|improve this question
That should work. Can you provide a real example? –  Daniel Roseman Jun 23 '13 at 17:13
self=super(A,self).save(*args,**kwargs) should work –  karthikr Jun 23 '13 at 17:47
Don'y you need to create a B instance before trying to save it? –  chachan Jun 24 '13 at 12:12

Your Answer



Browse other questions tagged or ask your own question.