Revision 5cf968ab snf-cyclades-app/synnefo/neutron/models.py
b/snf-cyclades-app/synnefo/neutron/models.py | ||
---|---|---|
169 | 169 |
) |
170 | 170 |
|
171 | 171 |
name = models.CharField('nic name', max_length=128) |
172 |
machine = models.ForeignKey(VirtualMachine, related_name='neutron_nics') |
|
172 |
machine = models.ForeignKey(VirtualMachine, null=True, |
|
173 |
related_name='neutron_nics') |
|
173 | 174 |
network = models.ForeignKey(Network, related_name='neutron_nics') |
174 |
subnet = models.ForeignKey(Subnet, related_names='neutron_nics')
|
|
175 |
subnet = models.ForeignKey(Subnet, related_name='neutron_nics', null=True)
|
|
175 | 176 |
created = models.DateTimeField(auto_now_add=True) |
176 | 177 |
updated = models.DateTimeField(auto_now=True) |
177 | 178 |
index = models.IntegerField(null=True) |
... | ... | |
197 | 198 |
return network.floating_ips.filter(machine=self.machine, |
198 | 199 |
ipv4=self.ipv4, |
199 | 200 |
deleted=False).exists() |
200 |
|
|
201 |
|
|
202 |
|
Also available in: Unified diff