rankade.models.Base

Module Contents

Classes

RankadeObject

Base class for all objects returned from the server. All models should inherit from this class.

ResultList

Base class for lists of items from server.

Page

Base class for page of items from server .

Data

T

API

T = 'TypeVar(...)'
class RankadeObject[source]

Bases: abc.ABC

Base class for all objects returned from the server. All models should inherit from this class.

class ResultList(initlist=None)[source]

Bases: collections.UserList[rankade.models.Base.T], rankade.models.Base.RankadeObject

Base class for lists of items from server.

Parameters:

data (List[rankade.models.Base.T]) – List of RankadeObjects returned by the sever.

Initialization

_content_class: ClassVar[Type[RankadeObject]] = None

Classvar to be overridden on each subclass to allow the an object in the list to be created from a dict returned from the server.

data: List[rankade.models.Base.T] = None

List of RankadeObjects returned by the sever.

classmethod from_dict(data_dict: Union[MutableMapping[str, Any], MutableSequence[MutableMapping[str, Any]]])[source]

Create a ResultList instance from a dict.

class Page(initlist=None)[source]

Bases: rankade.models.Base.ResultList[rankade.models.Base.T]

Base class for page of items from server .

Parameters:
  • data (List[rankade.models.Base.T]) – List RankadeObject objects.

  • page (int) – Current page number.

  • totalPages (int) – Total Pages.

  • rowsForPage (int) – Max number of items on page.

Initialization

page: int = 'field(...)'

Page number

totalPages: int = 'field(...)'

Total pages

rowsForPage: Optional[int] = None

How many items the server will return on each page.