Questions tagged [pyramid]

Pyramid is a Python-based web framework provided by the Pylons Project. Do not use the "pyramid" tag for displaying items in a pyramid shape.

Pyramid is a small, fast, down-to-earth Python web application development framework that is un-opinionated and very flexible. This allows it to be used in a variety of different projects where Pyramid's flexibility allows for easier integration with already-existing code/modules. Because it is un-opinionated it gives the developer a lot of choice in how to handle various aspects - such as sessions, authentication, authorization and more - without sacrificing support for those aspects or out-of-box ease of use.

It is developed as part of The Pylons Project. It is licensed under a BSD-like license with extra clauses.

Official Logo

Official Pyramid Logo

Official Icon

Official Pyramid Icon

2212 questions
1
vote
2 answers

how do I json encode this view?

New to python and Pyramid. I have a view that does pagination. How do I json encode it? I get an error "object at 0x2d16d90> is not JSON serializable" when I try this: @view_config(route_name="paginate") def paginate(request): query =…
user776942
1
vote
2 answers

Using NumPy in Pyramid

I'd like to perform some array calculations using NumPy for a view callable in Pyramid. The array I'm using is quite large (3500x3500), so I'm wondering where the best place to load it is for repeated use. Right now my application is a single page…
abroekhof
  • 796
  • 1
  • 7
  • 20
1
vote
1 answer

Sqlalchemy "double layer" query

So I didn't really know how to name my problem, so that was my best shot. Right now, my situation is I have a couple tables: Post --------- Id #.... Alert ------------- Id like_id Seen Like -------- id post_id And right now, I need to setup…
Wiz
  • 4,595
  • 9
  • 34
  • 51
1
vote
1 answer

jQuery.load() with object parameter to Pyramid causes "No JSON object could be decoded"

A simple call like this: type = 'theType'; category = 'theCategory'; $('#mydiv').load( '${request.route_url('theUrl')}', {type:type, category:category} ); results in a "No JSON object could be decoded" error when I try to access the…
Hollister
  • 3,758
  • 2
  • 20
  • 22
1
vote
2 answers

How do I go about storing session objects?

I have a few a few model classes such as a user class which is passed a dictionary, and wraps it providing various methods, some of which communicate with the database when a value needs to be changed. The dictionary itself is made from an…
Jaigus
  • 1,422
  • 1
  • 16
  • 31
1
vote
1 answer

Pyramid detecting a photo upload

So I have a settings page, and the user can upload a photo to the website with a post request from a form, but right now, I can't detect if the user uploaded a photo or not, since there are also other parts of the form, with one submit button at the…
Wiz
  • 4,595
  • 9
  • 34
  • 51
1
vote
1 answer

Coercing JSON parameters to integer

When I post data to the server as JSON via AJAX, values from form elements come is as strings (unicode). Here's a simple example: