A food or beverage preparation machine for preparing a flowable food product or a beverage by mixing a fluid with a precursor ingredient, said machine comprising: - a base having a fluid source, a pump means suitable for conducting said fluid from the source through fluid-conducting pipes to a fluid delivery port, and - a functional element detachable from the base, comprising connecting means (6, 7, 8) for connecting fluidly to the delivery port of the base, characterized in that said base and said detachable functional element both have cooperating magnetic releasable attachment means comprising: (i) at least one first permanent magnetic element attached to the detachable functional element or to the base, said first magnetic element being located on a wall surface that also comprises the connecting means (6, 7, 8), respectively the fluid delivery port, and (ii) at least two second magnetic elements (18, 20) attached to the base or, respectively, attached to the detachable functional element, said corresponding magnetic elements being located on a wall surface that also comprises the fluid connection port, respectively the connecting means (6, 7, 8), and one of said second magnetic elements having a permanent opposite polarity to that of the first magnetic element, such that: - when the detachable element is fluidly and functionally connected to the base, magnetic elements of the detachable element and base in alignment have opposed polarities so as to be magnetically attracted, and then - by rotating the detachable element relative to the base, magnetic elements of said detachable element and base are brought in a new alignment where two aligned magnetic elements have same polarities, such that said detachable element is repelled outwardly from the base, and both are consequently disconnected from one another. - a base having a fluid source, a pump means suitable for conducting said fluid from the source through fluid-conducting pipes to a fluid delivery port, and - a functional element detachable from the base, comprising connecting means (6, 7, 8) for connecting fluidly to the delivery port of the base, (i) at least one first permanent magnetic element attached to the detachable functional element or to the base, said first magnetic element being located on a wall surface that also comprises the connecting means (6, 7, 8), respectively the fluid delivery port, and (ii) at least two second magnetic elements (18, 20) attached to the base or, respectively, attached to the detachable functional element, said corresponding magnetic elements being located on a wall surface that also comprises the fluid connection port, respectively the connecting means (6, 7, 8), and one of said second magnetic elements having a permanent opposite polarity to that of the first magnetic element, - when the detachable element is fluidly and functionally connected to the base, magnetic elements of the detachable element and base in alignment have opposed polarities so as to be magnetically attracted, and then - by rotating the detachable element relative to the base, magnetic elements of said detachable element and base are brought in a new alignment where two aligned magnetic elements have same polarities, such that said detachable element is repelled outwardly from the base, and both are consequently disconnected from one another.