CBS Films released the first trailer for “Middle School: The Worst Years of My Life,” a film based on the book by James Patterson and Chris Tebbetts.

The chronicles the trials and triumphs of Rafe Khatchadorian, as he uses his wits to battle bullies, hormones and the tyrannical, test-obsessed Principal Dwight.

Rafe has an epic imagination…and a slight problem with authority. Both collide when he transfers to an oppressive, rule-crazy middle school. Drowning in do’s and don’ts, Rafe and his scheming best friend Leo hatch a plan to break every rule in the school’s Code of Conduct. It’s Ferris Bueller meets Home Alone as their battle with Principal Dwight explodes into chaos both real and imagined. But Dwight displays his own fiendish creativity, striking back at the rulebreakers. Meanwhile, Rafe struggles to hide his misbehavior from Jeanne, the straight-A, overachieving girl of his dreams, and at home, his mother’s boyfriend — a moochy, jack-of-no-trades named Bear — threatens to become his stepfather.

Rafe’s revolution leaps from the page to the screen in this ambitious live-action/animated comedy based on the New York Times bestseller “Middle School: The Worst Years of My Life” by legendary novelist James Patterson.

The film was directed by Steve Carr and was produced by Leopoldo Gout and Bill Robinson of James Patterson Entertainment. Chris Bowman, Hubbel Palmer and Kara Holden wrote the screenplay for the project, which is set to release this October. Lauren Graham, Adam Pally, Rob Riggle and Isabela Moner are featured in the film.