CBS is setting up a single-camera comedy based on the 2011 movie Bad Teacher. Community and Happy Endings writer/producer Hilary Winston is penning the pilot script.

Gene Stupnitsky and Lee Eisenberg, who wrote the movie, will serve as producers. Cameron Diaz starred in the summer comedy as a foul-mouthed, hard-drinking high school teacher who is about to leave her job to marry a wealthy man. She is forced to return to her old job when the marriage falls through, and inappropriate high jinks ensue. Jason Segel, Justin Timberlake, and Lucy Punch also starred in the film, which took in over $215 million worldwide.

If the project gets ordered to series, Hilary Winston will serve as showrunner, with Gene Stupnitsky and Lee Eisenberg executive producing. Sony Pictures Television will also produce the TV adptation, through their overall deal with Hilary Winston.