On Aug 19, 9:37 am, Enrico <[email protected]> wrote: > There's a moviedemo.db somewhere I believe. In that there'd be the > SQL Alchemy code declaring the movie table with movi_id as PK.
My problem isn't with the existence of the movie_id attribute of the Movie class. The query in the example searches the movie_id attribute of the Movie class using an undeclared "movie_id" variable. The variable movie_id itself isn't declared within the scope of the get_all method, unless I'm missing something. This is the line that uses movie_id: movie = DBSession.query(Movie).get(movie_id) Here's another comment from the 2.0 docs that mentions this problem [0]. > As for the __before__ , it's a bit of a hack that breaks the usual > RESTful mapping of URI's to controller methods for the purpose of > that particular example but I think the example mentions this. I don't think it does mention that "it's a bit of a hack that breaks the usual RESTful mapping". It just says: "One trick that I will explain, is how to use __before__ to get the related Movie object within all of your MovieDirectorController methods with a single define." Here's the link again: [1] > So, yes there is a better way to do this normally. Could you please explain what that better way is? [0] http://turbogears.org/2.0/docs/main/RestControllers.html#comment-15486264 [1] http://turbogears.org/2.1/docs/main/RestControllers.html#nesting-resources-with-restcontrollers -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

