1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Changelog and cleanup for #9935

This commit is contained in:
jeremystretch
2022-08-24 16:44:24 -04:00
parent eb2bf3469e
commit f70ef7a585
4 changed files with 33 additions and 27 deletions

View File

@@ -128,20 +128,26 @@ class WirelessLAN(WirelessAuthenticationBase, NetBoxModel):
return reverse('wireless:wirelesslan', args=[self.pk])
def get_wireless_interface_types():
# Wrap choices in a callable to avoid generating dummy migrations
# when the choices are updated.
return {'type__in': WIRELESS_IFACE_TYPES}
class WirelessLink(WirelessAuthenticationBase, NetBoxModel):
"""
A point-to-point connection between two wireless Interfaces.
"""
interface_a = models.ForeignKey(
to='dcim.Interface',
limit_choices_to={'type__in': WIRELESS_IFACE_TYPES},
limit_choices_to=get_wireless_interface_types,
on_delete=models.PROTECT,
related_name='+',
verbose_name="Interface A",
)
interface_b = models.ForeignKey(
to='dcim.Interface',
limit_choices_to={'type__in': WIRELESS_IFACE_TYPES},
limit_choices_to=get_wireless_interface_types,
on_delete=models.PROTECT,
related_name='+',
verbose_name="Interface B",