0
votes
0answers
5 views

SQLAlchemy Many-to-many table with multiple foreign key entires

I'm new with sqlalchemy and I want to do this as simply as possible, yet correctly. I want to track domain use across multiple companies on a monthly basis, so I set up the following tables: class ...
2
votes
2answers
16 views

SqlAlchemy select with max, group_by and order_by

I have to list the last modified resources for each group, for that I can do this query: model.Session.query( model.Resource, func.max(model.Resource.last_modified) ...
0
votes
1answer
21 views

Saving a Unicode Text with “\n” to Oracle DB via Python SQLAlchemy cx_Oracle

I am using Python SQLAlchemy cx_Oracle. And I am storing a string like this "1 Some Road\nSome Place\nSome City" into a db.Text field. But after saving it to it, what I get back is: "1 Some ...
0
votes
1answer
15 views

Python does not sort sql query result

results = conn.execute(SEARCH_SQL, dict(fingerprint="{"+fp_str+"}")).fetchall() print sorted(results) I retrieve some datas from database by using sql alchemy. results is like that: [(0.515625, ...
1
vote
1answer
19 views

SQL or SQLAlchemy expression to get nearest upcoming TV episodes

I have the following Flask-SQLAlchemy models, but the SQL tables should be easy to figure out to those who don't know SQLAlchemy: from myapp.api import db class Show(db.Model): id = ...
-6
votes
0answers
25 views

Python - How to pass string array form “python” to “oracle stored procedure” [on hold]

Python - How to pass string array form "python" to "oracle stored procedure" using SQL Alchemy - cx_Oracle
0
votes
0answers
24 views

Pyramid / SQLAlchemy model binding in Celery tasks

I am trying to set up Celery tasks. Our main app is Pyramid with SQLAlchemy. So I have a task defined as: from celery.contrib.methods import task from apipython.celerytasks import celery class ...
2
votes
1answer
138 views

Inconsistent behavior with sqlalchemy row update from form submission on sqlite3 database

Currently I have a table in my database with id, name (str), and data (int) columns. There is an html radio button form where selecting one button adds 1 to the corresponding entry in the database: ...
0
votes
0answers
21 views

Proper use of sqlalchemy scoped_session and pyramid's models

I'm having problem with finding a proper way of using db queries. I don't have much experience with web development, it's like 6 months of working afterhours (so it's like max 10h a week). I choose ...
3
votes
0answers
529 views

SQLAlchemy ─ Mapping a Class against Multiple Tables

# ! /usr/bin/env python # -*- coding: utf-8 -*- # login_frontend.py """ Python 2.7.3 Cherrypy 3.2.2 PostgreSQL 9.1 psycopy2 2.4.5 SQLAlchemy 0.7.10 """ I'm ...
0
votes
1answer
33 views

python 3.x no module named sqlalchemy after installation

I'm trying to install sqlalchemy to interact with mysql database for my python 3.x with ubuntu 12.04, but then when I import the sqlalchemy it says no module named sqlalchemy. This is what i did with ...
1
vote
3answers
1k views

SQLAlchemy query where a column contains a substring

I'm constructing a query using SQLAlchemy and SQLite3 in which I'd like to select rows in which a String column contains a particular substring. What is the best way to accomplish this?
0
votes
1answer
1k views

Python: SQLAlchemy ImportError: No module named pysqlite2

I'm running python 2.7.3 which I manually installed in my home directory as I don't have root access. 2.6.6 is installed on the system, but I really need 2.7. When I run the app, SQLAlchemy throws ...
0
votes
1answer
24 views

Translate SQL referencing parent clause to SQLAlchemy

I'm basically trying to get this SQL query working in SQLAlchemy: SELECT p.id, (SELECT COUNT(*) FROM response r WHERE <conditions on r> AND r.prompt_id = p.id) FROM prompt p WHERE ...
1
vote
1answer
12 views

How do you determine sqlalchemy driver from the session?

Some libraries and sites (like kotti) expose a database session that is loaded from a configuration file (it uses pyramid). In general you can ignore the driver for sqlalchemy, but there are a few ...

15 30 50 per page