Hello guys,
I have recently made a decision to start using the Pyramid (python web
framework) for my projects from now on.
I have also decided to use SQLalchemy, and I want to use raw MySQL
(personal reasons) but still keep the ORM features.
The first part of the code in models.py reads:
DBSess
Thanks for the reply guys it has been very informative.
My main reason for using raw is that I have spent so much time
learning MySQL, to me it seems counter productive to learn SQLALchemy
methodologies from scratch.
Ok, so maybe manually executing CREATE is not a great idea, but what
about perfo
When trying to use Mako with the Pyramid framework, by going into the
development.ini file, and adding the line
mako.directories = testProject:templates
in:
[app:testProject]
and then creating a simple html file called template.mako in the
templates subdirectory I get an:
ImportError: No modul
Lets assume, I have the following route set up:
config.add_route('pages', '/{page}/', view='testproject:views.pages',
view_renderer='testproject:templates/page.mak')
Would it be possible to make the template name e.g page.mak a variable
that matches the name of the response path.
something like
for each page would be rather
tedious wouldn't it?
On Feb 24, 8:36 pm, Chris McDonough wrote:
> On Thu, 2011-02-24 at 12:13 -0800, AwaisMuzaffar wrote:
> > Lets assume, I have the following route set up:
>
> > config.add_route('pages', '/{page}/', view=&
.
>
> On Feb 24, 3:13 pm, AwaisMuzaffar wrote:
>
> > Lets assume, I have the following route set up:
>
> > config.add_route('pages', '/{page}/', view='testproject:views.pages',
> > view_renderer='testproject:templates/page.mak
Hi Guys,
I have the following code for the view:
def pages_view(request):
path = request.path.split('/')[1]
dbsession = DBSession()
page = dbsession.query(PagesTable).from_statement(
'SELECT * FROM pages WHERE
path=:page_path').params(page_path=path).first()
pages_dir = os
I have the following view:
def view1(request):
varOne = 'test string'
return render_to_response('page.mak', {'varOne':varOne},
request=request)
Which gets invoked with:
config.add_route('page', '/mypage/', view='myproject.views.view1')
Next, I have another view:
def view2(request)
Just to add:
config.add_view('myproject.views.view2', route_name='page')
results in a conflict error. (I've done some reading about this in the
documentation)
config.add_view('myproject.views.view2', route_name='page')
On Mar 14, 10:05 pm,
ll be greatly appreciated.
Kind Regards,
Awais M.
On Mar 14, 11:03 pm, AwaisMuzaffar wrote:
> Just to add:
> config.add_view('myproject.views.view2', route_name='page')
> results in a conflict error. (I've done some reading about this in the
> documentatio
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
11 matches
Mail list logo