Re: Deleting and creating a model

2008-09-13 Thread Ross
I think you would either have to assign the antenna's phone: antenna.phone = phone or refetch the antenna from the database so Django creates the object with the newly-created reference. The antenna you are looking at is only coming from memory when you do antenna.phone, not from the database. Y

Deleting and creating a model

2008-09-13 Thread Karish
Hi, I have two models in a one-to-one relationship: Phone and Antenna. In other words, within the Phone class I have this field: antenna = models.OneToOneField(Antenna, related_name='phone') What I want to do, given a specific antenna, is to delete its phone and add a different phone: antenna.