town6.api
Classes
An API endpoint. |
|
An API endpoint. |
|
An API endpoint. |
|
An API endpoint. |
|
An API endpoint. |
Module Contents
- class town6.api.MeetingApiEndpoint(request: onegov.core.request.CoreRequest, extra_parameters: dict[str, list[str]] | None = None, page: int | None = None)[source]
Bases:
onegov.api.models.ApiEndpoint[onegov.org.models.meeting.Meeting]An API endpoint.
API endpoints wrap collection and do some filter mapping.
To add a new endpoint, inherit from this class and provide the missing functions and properties at the bottom. Note that the collection is expected to be to provide the functionality of
onegov.core.collection.Pagination.- property collection: onegov.org.api.PaginatedCollection[onegov.org.models.meeting.Meeting][source]
Return an instance of the collection with filters and page set.
- item_data(item: onegov.org.models.meeting.Meeting) dict[str, Any][source]
Return the data properties of the collection item as a dictionary.
For example:
{ 'name': 'Paul', 'age': 40 }
- item_links(item: onegov.org.models.meeting.Meeting) dict[str, Any][source]
Return the link properties of the collection item as a dictionary. Links can either be string or a linkable object.
For example:
{ 'website': 'https://onegov.ch', 'friends': FriendsApiEndpoint(app).for_item(paul), 'home': ApiEndpointCollection(app) }
- class town6.api.PoliticalBusinessApiEndpoint(request: onegov.core.request.CoreRequest, extra_parameters: dict[str, list[str]] | None = None, page: int | None = None)[source]
Bases:
onegov.api.models.ApiEndpoint[onegov.org.models.political_business.PoliticalBusiness]An API endpoint.
API endpoints wrap collection and do some filter mapping.
To add a new endpoint, inherit from this class and provide the missing functions and properties at the bottom. Note that the collection is expected to be to provide the functionality of
onegov.core.collection.Pagination.- property collection: onegov.org.models.political_business.PoliticalBusinessCollection[source]
Return an instance of the collection with filters and page set.
- item_data(item: onegov.org.models.political_business.PoliticalBusiness) dict[str, Any][source]
Return the data properties of the collection item as a dictionary.
For example:
{ 'name': 'Paul', 'age': 40 }
- item_links(item: onegov.org.models.political_business.PoliticalBusiness) dict[str, Any][source]
Return the link properties of the collection item as a dictionary. Links can either be string or a linkable object.
For example:
{ 'website': 'https://onegov.ch', 'friends': FriendsApiEndpoint(app).for_item(paul), 'home': ApiEndpointCollection(app) }
- class town6.api.ParliamentarianApiEndpoint(request: onegov.core.request.CoreRequest, extra_parameters: dict[str, list[str]] | None = None, page: int | None = None)[source]
Bases:
onegov.api.models.ApiEndpoint[onegov.org.models.parliament.RISParliamentarian]An API endpoint.
API endpoints wrap collection and do some filter mapping.
To add a new endpoint, inherit from this class and provide the missing functions and properties at the bottom. Note that the collection is expected to be to provide the functionality of
onegov.core.collection.Pagination.- property collection: onegov.org.api.PaginatedCollection[onegov.org.models.parliament.RISParliamentarian][source]
Return an instance of the collection with filters and page set.
- item_data(item: onegov.org.models.parliament.RISParliamentarian) dict[str, Any][source]
Return the data properties of the collection item as a dictionary.
For example:
{ 'name': 'Paul', 'age': 40 }
- item_links(item: onegov.org.models.parliament.RISParliamentarian) dict[str, Any][source]
Return the link properties of the collection item as a dictionary. Links can either be string or a linkable object.
For example:
{ 'website': 'https://onegov.ch', 'friends': FriendsApiEndpoint(app).for_item(paul), 'home': ApiEndpointCollection(app) }
- class town6.api.CommissionApiEndpoint(request: onegov.core.request.CoreRequest, extra_parameters: dict[str, list[str]] | None = None, page: int | None = None)[source]
Bases:
onegov.api.models.ApiEndpoint[onegov.org.models.parliament.RISCommission]An API endpoint.
API endpoints wrap collection and do some filter mapping.
To add a new endpoint, inherit from this class and provide the missing functions and properties at the bottom. Note that the collection is expected to be to provide the functionality of
onegov.core.collection.Pagination.- property collection: onegov.org.api.PaginatedCollection[onegov.org.models.parliament.RISCommission][source]
Return an instance of the collection with filters and page set.
- item_data(item: onegov.org.models.parliament.RISCommission) dict[str, Any][source]
Return the data properties of the collection item as a dictionary.
For example:
{ 'name': 'Paul', 'age': 40 }
- item_links(item: onegov.org.models.parliament.RISCommission) dict[str, Any][source]
Return the link properties of the collection item as a dictionary. Links can either be string or a linkable object.
For example:
{ 'website': 'https://onegov.ch', 'friends': FriendsApiEndpoint(app).for_item(paul), 'home': ApiEndpointCollection(app) }
- class town6.api.ParliamentaryGroupApiEndpoint(request: onegov.core.request.CoreRequest, extra_parameters: dict[str, list[str]] | None = None, page: int | None = None)[source]
Bases:
onegov.api.models.ApiEndpoint[onegov.org.models.parliament.RISParliamentaryGroup]An API endpoint.
API endpoints wrap collection and do some filter mapping.
To add a new endpoint, inherit from this class and provide the missing functions and properties at the bottom. Note that the collection is expected to be to provide the functionality of
onegov.core.collection.Pagination.- property collection: onegov.org.api.PaginatedCollection[onegov.org.models.parliament.RISParliamentaryGroup][source]
Return an instance of the collection with filters and page set.
- item_data(item: onegov.org.models.parliament.RISParliamentaryGroup) dict[str, Any][source]
Return the data properties of the collection item as a dictionary.
For example:
{ 'name': 'Paul', 'age': 40 }
- item_links(item: onegov.org.models.parliament.RISParliamentaryGroup) dict[str, Any][source]
Return the link properties of the collection item as a dictionary. Links can either be string or a linkable object.
For example:
{ 'website': 'https://onegov.ch', 'friends': FriendsApiEndpoint(app).for_item(paul), 'home': ApiEndpointCollection(app) }