» Home » sqlalchemy » Page 1
Migrating from SQLObject to SQLAlchemy :: Can SQLAlchemy support zero caching and autoload table updates?
by Lafe in Programming Languages

I want to know if SQLAlchemy can support instant loading of the current state of an object from the database when another process updates some attributes of the same object.

I want to mention, I am migrating from SQLObject to SQLAlchemy. Using SQLObject, currently, I have one table like:

class MyConfiguration(SQLObject):
class sqlmeta:

How Can I Automatically Populate SQLAlchemy Database Fields? (Flask-SQLAlchemy)
by XLNC in Databases

I've got a simple User model, defined like so:

# models.py
from datetime import datetime
from myapp import db
class User(db.Model):
id = db.Column(db.Integer(), primary_key=True)
email = db.Column(db.String(100), unique=True)
password = db.Column(db.String(100))
date_updated = db.Column(db.DateTime())
def __init__(self, email, pas

Many-to-many in sqlalchemy. Preventing SQLAlchemy from inserting into a table if a tag already exists
by David Mercer in Programming Languages

I have a few ORM mapped tables, which (pared down) look like this:

class Tag(Base):
__tablename__ = 'tags'
tag_name = Column(String, primary_key=True)
task2tag_assoc = Table('tasktags', Base.metadata,
Column('task_id', UUID, ForeignKey('tasks.task_id', ondelete='cascade'),
Column('tag_name', String, Fore

Managing seed data with SqlAlchemy and SqlAlchemy-migrate
by IlLogiK in Programming Languages

I'm using SqlAlchemy in my Pylons application to access data and SqlAlchemy-migrate to maintain the database schema.

It works fine for managing the schema itself. However, I also want to manage seed data in a migrate-like way. E.g. when ProductCategory table is created it would make sense to seed it with categories data.

Looks like SqlAlchemy-migrate does not support thi

Postgres inheritance with SQLAlchemy: SQLAlchemy Relationships
by Jouni in Databases

I have many types of authentications, therefore I have one base postgres table (called "authentications"), and other types of authentications are derived from it. For example, an entity that gets authenticated using a password is called "password_authentications" and it inherits from the "authentications" table using postgres. The schema is thus:

CREATE TABLE authentications (
flask-sqlalchemy or sqlalchemy
by Steve Downing in Databases

I am new in both flask and sqlalchemy, I just start working on a flask app, and I am using sqlalchemy for now. I was wondering if there is any significant benefit I can get by using the package flask-sqlalchemy vs the sqlalchemy. I could not find enough motivations in http://packages.python.org/Flask-SQLAlchemy/index.html or maybe I did not understand the value!! I would appreciate your clarifi

just one row from sqlalchemy
by kema in Programming Languages
import re
from sqlalchemy import *
db = create_engine('sqlite:///code.db')
db.echo = True
metadata = MetaData(db)
halo4 = Table('emblem_codes', metadata, autoload=True)
## Get One Unused Code ##
s = select([halo4.c.code, halo4.c.status=='None'])
result = s.execute()
for row in result:
Multithreading and Sqlalchemy
by bps in Programming Languages

I am given the task to update a database over the network with sqlalchemy. I have decided to use python's threading module. Currently I am using 1 thread, aka the producer thread, to direct other threads to consume work units via a queue.

The producer thread does something like this:

def produce(self, last_id):
unit = session.query(Request).order_by(Reques

dump csv from sqlalchemy
by Will in Programming Languages

For some reason, I want to dump a table from a database (sqlite3) in the form of a csv file. I'm using a python script with elixir (based on sqlalchemy) to modify the database. I was wondering if there is any way to dump the table I use to csv.

I've seen sqlalchemy serializer but it doesn't seem to be what I want. Am I doing it wrong? Should I call the sqlite3 python module after cl

Example using BLOB in SQLAlchemy
by Surya in Databases

does anybody have example how to use BLOB in SQLAlchemy?


Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .