Self-avoiding walks and the Ising and Heisenberg models