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/export_views.py.md
Matt Griswold 677f94f550 Support 202111 (#1101)
* Block registering private ASN ranges

* Add a continental region field for facilities #1007

* Incorrect order of search results #232

* Allow users to upload a small logo to their record #346

* Sponsor badge CSS and text translation issues #453

* IXP and Facility summary #18

* Add sales email and phone contact to ix object #949

* Increase timeout timer for IX-F JSON importer to 30s #962

* IX-F manually triggered import bugs #1054

* remove survey notifications

* IX-F importer: manual add followed by IX-F prompted add can result in "The server rejected your data" #807

* performance fix for net view

* api documentation generate broken #956

* fix poc set missing from net view

* Auto focus cursor on search field on main website #695

* PeeringDB website has a poor choice of line-breaks for IPv6 addresses. #748

* Delete childless org objects #838

* linting

* poetry lock

* re-add mistakingly dropped translation to email template

* fix template variables

* regen docs

* regen api docs

* add u2f api

* fix merge cruft

* fido u2f webauthn first steps

* dont need this

* typo

* first ux steps for security key management, u2f views

* u2f auth

* linting

* Cascade delete when performed by superuser in django-admin #735

* security key passwordless login

* reset webauthn migrations

* security key 2fa

* linting

* ux cleanup

* cleanup

* Add IXP to AS record / dropdown limited #469

* ignore orgs that have pre-dated or finished sponsorships attached

* split out to django_security_keys

* default to 90 days

* make URL required for new objects #374

* move CONN_MAX_AGE to proper location and expose as env var (#1060)

* Error message for invalid password on email change

* Registering a new facility or exchange organization is broken #1062

* Creating a facility that matches the name of a soft-deleted facility will cause the entry to bypass the verification queue #901

* irr source validator doesn't allow for hyphens in source #921

* split out javascript

* split out js

* Clicking "Add" to add a user api-key without providing a name for the key raises Internal Error #1033

* remove security key admin views

* global stats don't show up at login screen #284

* Possible for "pending" exchange to have "deleted" ixlan (#1077)

* webauthn finalizations

* oidc support for oauth provider #1070

* Revert "Merge branch 'gh_1070' into 'support_202111'"

* remove unused dev mounts

* linting

* add django-security-key and relock poetry

* re-add imports removed through linting

* docs regen

* oauth toolkit pinned to 1.6.1
django-security-keys pinned to 1.0.1

* remove debug message

* linting

* linting

Co-authored-by: Stefan Pratter <stefan@20c.com>
Co-authored-by: David Poarch <dpoarch@20c.com>
2022-01-11 08:56:47 -06:00

171 lines
3.3 KiB
Markdown

Generated from export_views.py on 2022-01-11 07:58:24.072700
# peeringdb_server.export_views
Define export views used for IX-F export and advanced search file download.
# Classes
---
## AdvancedSearchExportView
```
AdvancedSearchExportView(peeringdb_server.export_views.ExportView)
```
Allow exporting of advanced search result data.
### Methods
#### fetch
`def fetch(self, request)`
Fetch data from API according to GET parameters.
Note that `limit` and `depth` will be overwritten, other API
parameters will be passed along as-is.
Returns:
- dict: un-rendered dataset returned by API
---
#### generate
`def generate(self, request)`
Generate data for the reftag specified in self.tag
This function will call generate_<tag> and return the result.
Arguments:
- request <Request>
Returns:
- list: list containing rendered data rows ready for export
---
#### generate_fac
`def generate_fac(self, request)`
Fetch facility data from the API according to request and then render
it ready for export.
Arguments:
- request <Request>
Returns:
- list: list containing rendered data ready for export
---
#### generate_ix
`def generate_ix(self, request)`
Fetch exchange data from the API according to request and then render
it ready for export.
Arguments:
- request <Request>
Returns:
- list: list containing rendered data ready for export
---
#### generate_net
`def generate_net(self, request)`
Fetch network data from the API according to request and then render
it ready for export.
Arguments:
- request <Request>
Returns:
- list: list containing rendered data ready for export
---
#### generate_org
`def generate_org(self, request)`
Fetch organization data from the API according to request and then render
it ready for export.
Arguments:
- request <Request>
Returns:
- list: list containing rendered data ready for export
---
#### get
`def get(self, request, tag, fmt)`
Handle export.
LGTM Notes: signature-mismatch: order of arguments are defined by the
url routing set up for this view. (e.g., /<tag>/<fmt>)
The `get` method will never be called in a different
context where a mismatching signature would matter so
the lgtm warning can be ignored in this case.
---
## ExportView
```
ExportView(django.views.generic.base.View)
```
Base class for more complex data exports.
### Methods
#### generate
`def generate(self, request)`
Function that generates export data from request.
Override this.
---
#### response_csv
`def response_csv(self, data)`
Return Response object for CSV response.
Arguments:
- data <list>
Returns:
- HttpResponse
---
#### response_json
`def response_json(self, data)`
Return Response object for normal json response.
Arguments:
- data <list|dict>: serializable data, if list is passed you will need
to specify a value in self.json_root_key
Returns:
- JsonResponse
---
#### response_json_pretty
`def response_json_pretty(self, data)`
Return Response object for pretty (indented) json response.
Arguments:
- data <list|dict>: serializable data, if list is passed tou will need
to specify a value in self.json_root_key
Returns:
- HttpResponse: http response with appropriate json headers, cannot use
JsonResponse here because we need to specify indent level
---