14201 allow searching for ASN with prefix AS

This commit is contained in:
Arthur Hanson 2024-09-18 10:23:36 -07:00 committed by Jeremy Stretch
parent 44c7786cd9
commit 8e6a15a25e
2 changed files with 5 additions and 0 deletions

View File

@ -149,3 +149,7 @@ class ASN(PrimaryModel):
return f'{self.asn} ({self.asn // 65536}.{self.asn % 65536})'
else:
return self.asn
@property
def prefixed_name(self):
return f'AS{self.asn_with_asdot}'

View File

@ -19,6 +19,7 @@ class ASNIndex(SearchIndex):
model = models.ASN
fields = (
('asn', 100),
('prefixed_name', 110),
('description', 500),
)
display_attrs = ('rir', 'tenant', 'description')