1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00
Files
peeringdb-peeringdb/docs/dev/modules/documents.py.md
Stefan Pratter be9deaf2f8 Support 202309 (#1458)
* fixes #1260 - playwright tests
fixes #1394 - v2 search failing to find some names
fixes #1374 - Search to include new objects: Campus & Carrier
fixes #1164 - better rdap error reporting
fixes #1368 - Facility data export into Google Earth KMZ
fixes #1328 - Support web updates from a source of truth
fixes #1257 - Help text covers non-compliant email addresses
fixes #1313 - Improve email confirmation control - add 3 month option & maybe set new default value
fixes #1380 - Reset 'Social Media' to '[]' if field has no value

* linting

* remove target=_blank

* bump ES version to 8.10

* Cache and ES updates (#1459)

* elasticsearch major version pin and relock

* set decimal fields to python value on client save for load_data

* force use of redis password

* add default_meta to render

* add generated, clean up var names

* run pre-commit

* update ES for https and password

* rm cruft

* isort

---------

Co-authored-by: 20C <code@20c.com>
Co-authored-by: Matt Griswold <grizz@20c.com>
2023-10-24 12:17:03 -05:00

2.8 KiB

Generated from documents.py on 2023-08-15 16:04:08.595120

peeringdb_server.documents

Functions


is_valid_latitude

def is_valid_latitude(lat)

Validates a latitude.


is_valid_longitude

def is_valid_longitude(long)

Validates a longitude.


Classes


FacilityDocument

FacilityDocument(peeringdb_server.documents.GeocodeMixin, django_elasticsearch_dsl.documents.DocType)

Cleans up invalid lat/lng values beforee passing them to the geo code field

GeocodeMixin

GeocodeMixin(peeringdb_server.documents.StatusMixin)

Cleans up invalid lat/lng values beforee passing them to the geo code field

Methods

cached_facilities

def cached_facilities(self, instance)

Caches all facilties for network or internet exchange relations. This is to speed up processing of those documents as they will need to collect all facilities associated with the object to determine geo coordinates and country and state


prepare_country

def prepare_country(self, instance)

Prepares country for the country field

For Facility and organization this will read country from the object itself

For Network and internet exchange this will return a list of country codes for all facilities associated with the object


prepare_geocode_coordinates

def prepare_geocode_coordinates(self, instance)

Prepares geo coordinates for the geocode_coordinates field

For Facility and organization this will read lat/lng from the object itself

For Network and internet exchange this will return lists of coordinates for all facilities associated with the object


prepare_state

def prepare_state(self, instance)

Prepares state for the state field

For Facility and organization this will read state from the object itself

For Network and internet exchange this will return a list of states for all facilities associated with the object


InternetExchangeDocument

InternetExchangeDocument(peeringdb_server.documents.GeocodeMixin, django_elasticsearch_dsl.documents.DocType)

Cleans up invalid lat/lng values beforee passing them to the geo code field

NetworkDocument

NetworkDocument(peeringdb_server.documents.GeocodeMixin, django_elasticsearch_dsl.documents.DocType)

Cleans up invalid lat/lng values beforee passing them to the geo code field

OrganizationDocument

OrganizationDocument(peeringdb_server.documents.GeocodeMixin, django_elasticsearch_dsl.documents.DocType)

Cleans up invalid lat/lng values beforee passing them to the geo code field

StatusMixin

StatusMixin(builtins.object)

Ensures only objects with status=ok are indexed and deleted from the index if status is no longer ok

Methods

update

def update(self, thing, **kwargs)

Updates the document with the given kwargs.