I leave the lager in the primary for a month usually. For a shorter time only if I need to free up a primary, but then I will lager it in the keg for a slightly longer period than is typical (a little more than one month). I rarely do a d rest anymore. When I rack to the keg, I do so with a keg that has been purged of O2 (I store my kegs under CO2 pressure with a little Star San in there, which I remove by depressing the out post on the keg.
Of course YMMV with a different SOP....