The tacker.api.api_common
Module¶
-
class
tacker.api.api_common.
NoPaginationHelper
(request, primary_key='id')¶
-
class
tacker.api.api_common.
NoSortingHelper
(request, attr_info)¶
-
class
tacker.api.api_common.
PaginationEmulatedHelper
(request, primary_key='id')¶ Bases:
tacker.api.api_common.PaginationHelper
-
get_links
(items)¶
-
paginate
(items)¶
-
update_fields
(original_fields, fields_to_add)¶
-
-
class
tacker.api.api_common.
PaginationHelper
(request, primary_key='id')¶ Bases:
object
-
get_links
(items)¶
-
paginate
(items)¶
-
update_args
(args)¶
-
update_fields
(original_fields, fields_to_add)¶
-
-
class
tacker.api.api_common.
PaginationNativeHelper
(request, primary_key='id')¶ Bases:
tacker.api.api_common.PaginationEmulatedHelper
-
paginate
(items)¶
-
update_args
(args)¶
-
-
class
tacker.api.api_common.
SortingEmulatedHelper
(request, attr_info)¶ Bases:
tacker.api.api_common.SortingHelper
-
sort
(items)¶
-
update_fields
(original_fields, fields_to_add)¶
-
-
class
tacker.api.api_common.
SortingHelper
(request, attr_info)¶ Bases:
object
-
sort
(items)¶
-
update_args
(args)¶
-
update_fields
(original_fields, fields_to_add)¶
-
-
class
tacker.api.api_common.
SortingNativeHelper
(request, attr_info)¶ Bases:
tacker.api.api_common.SortingHelper
-
update_args
(args)¶
-
-
class
tacker.api.api_common.
TackerController
(plugin)¶ Bases:
object
Base controller class for Tacker API.
-
tacker.api.api_common.
get_filters
(request, attr_info, skips=None)¶ Extracts the filters from the request string.
Returns a dict of lists for the filters: check=a&check=b&name=Bob& becomes: {‘check’: [u’a’, u’b’], ‘name’: [u’Bob’]}
-
tacker.api.api_common.
get_limit_and_marker
(request)¶ Return marker, limit tuple from request.
Parameters: request – wsgi.Request possibly containing ‘marker’ and ‘limit’ GET variables. ‘marker’ is the id of the last element the client has seen, and ‘limit’ is the maximum number of items to return. If limit == 0, it means we needn’t pagination, then return None.
-
tacker.api.api_common.
get_next_link
(request, items, id_key)¶
-
tacker.api.api_common.
get_page_reverse
(request)¶
-
tacker.api.api_common.
get_pagination_links
(request, items, limit, marker, page_reverse, key='id')¶
-
tacker.api.api_common.
get_previous_link
(request, items, id_key)¶
-
tacker.api.api_common.
get_sorts
(request, attr_info)¶ Extract sort_key and sort_dir from request.
Return as: [(key1, value1), (key2, value2)]
-
tacker.api.api_common.
list_args
(request, arg)¶ Extracts the list of arg from request.