views
djangomain.views
¤
Attributes¤
schema_view = get_schema_view(openapi.Info(title='Paricia API', default_version='v1', description='API for the Paricia project', terms_of_service='https://github.com/ImperialCollegeLondon/paricia', contact=openapi.Contact(email='contact@snippets.local'), license=openapi.License(name='BSD License')), public=True, permission_classes=[permissions.AllowAny])
module-attribute
¤
Classes¤
HomePageView
¤
Bases: TemplateView
View for displaying the home page and map dash app.
Station
¤
Bases: PermissionsBase
Main representation of a station, including several metadata.
Attributes:
Name | Type | Description |
---|---|---|
visibility |
str
|
Visibility level of the object, including an "internal" option. |
station_id |
int
|
Primary key. |
station_code |
str
|
Unique code for the station. |
station_name |
str
|
Brief description of the station. |
station_type |
StationType
|
Type of the station. |
country |
Country
|
Country where the station is located. |
region |
Region
|
Region within the Country where the station is located. |
ecosystem |
Ecosystem
|
Ecosystem associated with the station. |
institution |
Institution
|
Institutional partner responsible for the station. |
place_basin |
PlaceBasin
|
Place-Basin association. |
station_state |
bool
|
Is the station operational? |
timezone |
str
|
Timezone of the station. |
delta_t |
DeltaT
|
Interval of data adquisition (in minutes). |
station_latitude |
Decimal
|
Latitude of the station, in degrees [-90 to 90]. |
station_longitude |
Decimal
|
Longitude of the station, in degrees [-180 to 180]. |
station_altitude |
int
|
Altitude of the station. |
influence_km |
Decimal
|
Area of influence in km2. |
station_file |
ImageField
|
Photography of the station. |
station_external |
bool
|
Is the station external? |
Functions¤
__str__()
¤
Return the station code.
Source code in station/models.py
474 475 476 |
|
clean()
¤
Set the default delta_t value if not provided.
Source code in station/models.py
482 483 484 485 486 |
|
get_absolute_url()
¤
Return the absolute url of the station.
Source code in station/models.py
478 479 480 |
|
set_object_permissions()
¤
Set object-level permissions.
This method is called by the save method of the model to set the object-level permissions based on the visibility level of the object. In addition to the standard permissions for the station, the view_measurements permission is set which controls who can view the measurements associated to the station.
Source code in station/models.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 |
|