Hi,
I'm assuming you're wanting to use the relay contacts to drive the motor in one direction until it hits the end stop, then reverse it until it hits the other end stop, then repeat.
You didn't mention how much current the DC motor draws, so I'll assume that it's bigger than that latching relay you linked can handle. PS that relay is not simple to use with a single 12VDC supply and two SPST NO switches.
I've attached a diagram for what it sounds like you asked for; there are two standard [non-latching] relays, one to latch the direction based on the switches, and the other is to reverse the voltage and drive the motor.
There is a problem with this approach in that the motor is switched at full speed in one direction, then immediately switched in full speed in the other direction without a chance to slow down. You may have some large stall currents due to this. An improved version would use some electronics to delay the switch on in the new direction; e.g. once it hits the end stop the motor is turned off (perhaps slowed using dynamic breaking), then half a second later it is turned on the the other direction.