sol.models.rate -- Player rates — SoL 4 developers documentation

# `sol.models.rate` -- Player rates

class `sol.models.rate.` `Rate`(**kwargs)

  The Glicko rating of a player.

  `caption`(html=None, localized=True)

    A description of the rate.

  `date`

    Rating date.

  `deviation`

    The value of Glicko deviation.

  `idplayer`

    Related `player` ID.

  `idrate`

    Primary key.

  `idrating`

    Related rating's ID.

  `player`

    The related `player`.

  `rate`

    The value of Glicko rating.

  `serialize`(serializer)

    Reduce a single rate to a simple dictionary.

    Parameters

      serializer -- a `Serializer` instance

    Return type

      dict

    Returns

      a plain dictionary containing a flatified view of this rate

  `update`(data, missing_only=False)

    Update entity with given data.

    Parameters

      - data -- a mapping kind of container

      - missing_only -- a boolean flag, `False` by default

    Return type

      dict

    Returns

      a mapping between field name and a tuple `(oldvalue, newvalue)`, for each modified field

    First call `check_update()` to assert the validity of incoming data, then update the instance fields.

    If missing_only is `True` then only the fields that are currently empty (that is, their value is either `None` or an empty string) are updated. Note that in this case an exception is made for `bool` fields: since in SoL they always have a value (i.e. they are never missing), they are always updated.