- "use two apps" - How? Don't I still need to check against the auth session of the private app to see if the user is logged in, and so still would load models each time. - "move all public controllers under the same file" - This is totally impractical and goes against your own directive to use many small controllers. - "use lazy_tables" - I'll try this, but it doesn't solve the issue of loading and parsing the model files each time (guess it's time to put my models in modules)
On Tuesday, August 28, 2012 11:31:22 PM UTC-4, Massimo Di Pierro wrote: > > oops. Do not have a solution other than use two apps or move all public > controllers under the same file or use lazy_tables. > > On Tuesday, 28 August 2012 22:28:09 UTC-5, Yarin wrote: >> >> But my app has 13 private controllers and 1 public controller? >> >> On Tuesday, August 28, 2012 11:21:46 PM UTC-4, Massimo Di Pierro wrote: >>> >>> You just need two controllers say: >>> >>> controllers/public.py >>> controllers/private.py >>> >>> then put your model files like db.py in >>> >>> models/private/db.py >>> >>> They will not load when you call actions in public. >>> >>> Massimo >>> >>> On Tuesday, 28 August 2012 22:19:03 UTC-5, Yarin wrote: >>>> >>>> And now I'm also not sure how to go about separating the public site >>>> into a separate application- wouldn't I still need to hit the 'real' >>>> application to check the whether the user is logged in or not, thereby >>>> requiring model loads on every request anyway? >>>> >>>> On Tuesday, August 28, 2012 11:09:43 PM UTC-4, Yarin wrote: >>>>> >>>>> Thanks guys but don't understand how conditional models could be >>>>> applied here. I thought conditional models were models specific to a >>>>> single >>>>> controller/function? My app has many controllers that use the models, and >>>>> only a few basic pages where I don't want models to load- how would >>>>> conditional models solve that? >>>>> >>>>> Don't really feel like wrapping all my model code in IFs either. >>>>> >>>>> Probably go with the separate app for now, and check out lazy tables >>>>> when they come out.. >>>>> >>>>> On Tuesday, August 28, 2012 10:07:45 PM UTC-4, rochacbruno wrote: >>>>>> >>>>>> - You can use conditional models. >>>>>> >>>>>> - You can use IF on models >>>>>> >>>>>> if not request.controller == "public": >>>>>> # my logic goes here >>>>>> >>>>>> - You can go to the option B (simple separate app) >>>>>> >>>>>> - You can serve the login form as static html file >>>>>> http://yourapp/static/public.html >>>>>> >>>>>> - You can use lazy_tables and not worry about it. >>>>>> >>>>>> >>>>>> On Tue, Aug 28, 2012 at 10:52 PM, Yarin <ykes...@gmail.com> wrote: >>>>>> >>>>>>> A basic architecture question: >>>>>>> >>>>>>> We're putting together a typical web app where non-logged in users >>>>>>> reach a public-facing basic 'brochure' site, and then log in to reach >>>>>>> the >>>>>>> 'real' application. With such a setup, it makes no sense to be loading >>>>>>> models for the public portion of the site, as it's just some >>>>>>> semi-static >>>>>>> pages and a login form. So I'm wondering >>>>>>> >>>>>>> - a) Is there a way to prevent models loading at the request or >>>>>>> controller level? >>>>>>> - b) Should the 'public' site be part of the same application at >>>>>>> all, or should it be a separate light-weight application with a >>>>>>> login form >>>>>>> that then points to the 'real' application? >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> --