On 3/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > I didn't make that switch at this point because, by convention, > > TurboGears model classes are in yourproject.model. I wanted to avoid > > breaking other tools (tg-admin sql create, CatWalk, etc). > > Ah right, ok. The way I've rigged my project is to still have a model.py > file but it imports models from a models directory. That's how I did > controllers too. I still have a controller.py (root) file but it just > imports from a controllers directory.
Yes, that should work. You don't need a controller.py file, because TG looks in yourpackage.controllers for things, which will pick up either the package or the module called "controllers". (By the way, there's a reason one is singular and the other is plural: a project will have many controllers, but the "model" is the data model for the whole project.) > I haven't used 'sql create' or CatWalk so I'm assuming that when I do they'll > put stuff into my model.py and I should be ok? They don't actually put things in there. They pull the class definitions from there. So, importing is *generally* fine there, but "sql create" skips over imported classes unless you define some extra variable in model.py (I forget what it is offhand). Kevin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

