2023-04-12 14:41:30 +03:00
|
|
|
Generated from util.py on 2023-04-12 10:09:44.563425
|
2021-10-15 03:25:38 -05:00
|
|
|
|
|
|
|
|
# peeringdb_server.util
|
|
|
|
|
|
|
|
|
|
Assorted utility functions for peeringdb site templates.
|
|
|
|
|
|
|
|
|
|
# Functions
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## coerce_ipaddr
|
|
|
|
|
`def coerce_ipaddr(value)`
|
|
|
|
|
|
|
|
|
|
ipaddresses can have multiple formats that are equivalent.
|
|
|
|
|
This function will standardize a ipaddress string.
|
|
|
|
|
|
|
|
|
|
Note: this function is not a validator. If it errors
|
|
|
|
|
It will return the original string.
|
|
|
|
|
|
2022-11-08 19:25:32 +02:00
|
|
|
---
|
2023-04-12 14:41:30 +03:00
|
|
|
## generate_social_media_render_data
|
|
|
|
|
`def generate_social_media_render_data(data, social_media, insert_index, dismiss)`
|
|
|
|
|
|
|
|
|
|
Generate the data for rendering the social media in view.html.
|
|
|
|
|
This function will insert the generated social media data to `data`.
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
## v2_social_media_services
|
|
|
|
|
`def v2_social_media_services()`
|
|
|
|
|
|
|
|
|
|
Until v3 website is still set through the main `website` property
|
|
|
|
|
of the object, we need to skip it here so it is not rendered to
|
|
|
|
|
the UX as a pickable choice in the social media dropdown
|
|
|
|
|
|
2023-05-16 21:04:05 +03:00
|
|
|
---
|