Re: Why is my database session disappearing?

2011-09-13 Thread AwaisMuzaffar
Ok I get what you mean by mutate now! Okay I have resolved it thanks! On Sep 13, 10:13 pm, AwaisMuzaffar wrote: > I see. That clears it. So can you clarify what you mean by mutating > the settings? could you provide an example? Thank you very much for > your reply. > > On

Re: Why is my database session disappearing?

2011-09-13 Thread AwaisMuzaffar
I see. That clears it. So can you clarify what you mean by mutating the settings? could you provide an example? Thank you very much for your reply. On Sep 13, 9:51 pm, Michael Merickel wrote: > This is a subtle error that is on the docket to get fixed in the future. The > issue here is that the s

Why is my database session disappearing?

2011-09-13 Thread AwaisMuzaffar
I am trying to store a session factory in the apps settings object, following this: https://docs.pylonsproject.org/projects/pyramid_cookbook/dev/sqla.html#using-a-non-global-session Below is my code, copied and pasted: # request.py from pyramid.request import Request from pyramid.decorator impo

Re: SQLalchemy issue when extending Pyramid application

2011-09-11 Thread AwaisMuzaffar
Its very easy to replicate this error: Create two apps 'MainApp' and 'ChildApp' using the pyramid_routesalchemy scaffolds (change development.ini for both to use their own mysql database) In 'MainApp' _init_.py do this: def main(global_config, **settings): ## lots of code here def site_

Re: SQLalchemy issue when extending Pyramid application

2011-09-11 Thread AwaisMuzaffar
On Sep 11, 12:18 am, cd34 wrote: > On Sep 10, 4:55 pm, AwaisMuzaffar wrote: > > > Hi, > > > I have a "Main Application", and in this application I have the > > following in the _init_.py file: > > > def main(global_config, **settings): > >

Re: SQLalchemy issue when extending Pyramid application

2011-09-10 Thread AwaisMuzaffar
doing so, especially if I am going to be having loads of applications using it. Thanks. On Sep 10, 10:26 pm, Chris McDonough wrote: > On Sat, 2011-09-10 at 14:11 -0700, AwaisMuzaffar wrote: > > Sorry for duplicating! I did not realise and I cannot undo it! > > >

Re: SQLalchemy issue when extending Pyramid application

2011-09-10 Thread AwaisMuzaffar
Sorry for duplicating! I did not realise and I cannot undo it! On Sep 10, 9:55 pm, AwaisMuzaffar wrote: > Hi, > > I have a "Main Application", and in this application I have the > following in the _init_.py file: > > def main(global_config, **settings): >

SQLalchemy issue when extending Pyramid application

2011-09-10 Thread AwaisMuzaffar
Hi, I have a "Main Application", and in this application I have the following in the _init_.py file: def main(global_config, **settings): # various config settings config.include(site_configs) def site_configs(config): config.add_route('portfolio', '/portfolio', view='mainapp.vie

Pyramid, Mod_WSGI and Webfaction help needed

2011-08-10 Thread AwaisMuzaffar
Hi Guys, I followed the following guide (http://www.kemeneur.com/clients/pylons/ docs/pyramid/tutorials/modwsgi/index.html) to set up my application using mod_wsgi in WebFaction. However, I am a little bit puzzled about a few things. When I create a new app as shown in step 6 in webfaction: $

Re: Simple Jquery AJAX question

2011-06-16 Thread AwaisMuzaffar
Thanks for the reply. It has been very helpful. Regards, Awais On Jun 16, 4:47 pm, Michael Merickel wrote: > On Thu, Jun 16, 2011 at 10:03 AM, AwaisMuzaffar > wrote: > > >    config.add_route('ajax', '/ajax/', view='testproject.views.ajax')

Re: Simple Jquery AJAX question

2011-06-16 Thread AwaisMuzaffar
add_route correctly. Is this how it is suppose to be done? Thanks. Awais, On Jun 16, 2:21 pm, Robert Jackiewicz wrote: > Hi AwaisMuzaffar, > > 1. To be able to call a python function via an ajax call you will have to > make the function in your python module a callable view and t

Simple Jquery AJAX question

2011-06-16 Thread AwaisMuzaffar
1- In my pyramid package directory, if I create a file called somefunction.py and I want to call this function using $.post, what URL would I specify to call this function. and: 2- And if I have a view function called aview created in views.py, can I call this function by simply referring the $.p

Re: Pyramid (SQL Alchemy) - Making the tables globally available

2011-06-12 Thread AwaisMuzaffar
Hi, Thanks for your reply. It has been very helpful, and I can finally make some progress. BTW, I am pretty sure I am subscribed to this group. Kind Regards, Awais M. On Jun 12, 9:59 pm, Chris McDonough wrote: > On Sun, 2011-06-12 at 13:21 -0700, AwaisMuzaffar wrote: > > Could someo

Pyramid (SQL Alchemy) - Making the tables globally available

2011-06-12 Thread AwaisMuzaffar
Could someone please tell me how one can make table classes and 'dbsession()' created using sqlalchemy in pyramid available globally, so I can query those tables within my templates. Thanks. Awais M. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" g

Re: Help with using the Before Render Event

2011-04-16 Thread AwaisMuzaffar
le 'myblog_templates_pages_home_mak', line 38 in render_body File '/Users/Awais/virtualenv/lib/python2.6/site-packages/Mako-0.3.6- py2.6.egg/mako/runtime.py', line 181 in __str__ raise NameError("Undefined") NameError: Undefined On Apr 16, 8:21 pm, Chris McDonough

Help with using the Before Render Event

2011-04-16 Thread AwaisMuzaffar
Hi Guys, When I use the before render event like so: from pyramid.events import subscriber from pyramid.events import BeforeRender @subscriber(BeforeRender) def add_global(event): event['mykey'] = 'foo' How exactly do I call these variables my templates. I can't seem to find this out f

Re: Help with creating view functions

2011-03-13 Thread AwaisMuzaffar
n (thus it is > undefined). > > Michael > > On Sat, Mar 12, 2011 at 4:33 PM, AwaisMuzaffar > wrote: > > > > > Hi, > > > Thanks I will read into it more. I assumed it was the same thing. > > > I have also tried: > > > def blog_view(re

Re: Help with creating view functions

2011-03-12 Thread AwaisMuzaffar
Hi, Thanks I will read into it more. I assumed it was the same thing. I have also tried: def blog_view(request): variable = 'hello world' return render_to_respomse('myblog:templates/pages/my-blog.mak', {'variable':variable}, request=request) And, I recieve the following error: URL: http