docs: def _dict_to_model(self, data):
          """ Create new user model instance based on the received data.
  
          Note that the created user is not saved into database.
          """
  
          try:
              # we can do this because we have same fields
              # in the representation and in the model:
              user = models.User(**data)
          except TypeError:
              # client sent bad data
              raise errors.BadRequest()
          else:
              return user