Perhaps I have been up too many hours, but my syntax foo is fizzling.
Given the following class, I want to compute the string length of
"position" instead of storing it as another attribute which can get out of
sync. eg.
class Position(Base):
__tablename__ = 'position'
id =
I have successfully installed SQLAlchemy 1.0.9, & can enable foreign key
constraint support on each connection by hooking the event as specified in
the following:
http://docs.sqlalchemy.org/en/latest/dialects/sqlite.html
SQLite also allows pragma settings to be queried in the command-line shell
I have a CSV file with lots of redundant data which models many-to-many
relationships. I'm needing to scrub the data as it is inserted into the
database littered with unique constraints. Is there a way to insert the
data once without querying for each object before inserting?
I'm sure this is a
On Wed, Apr 17, 2013 at 2:59 PM, Michael Bayer mike...@zzzcomputing.comwrote:
James Hartley jjhart...@gmail.com writes:
Is it possible to map Table instances back to classes defined through
declarative_base()?
the typical form is:
Base = declarative_base()
some_table = Table
Starting with the Wiki article on implementing views:
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/Views
Is it possible to map Table instances back to classes defined through
declarative_base()? I'm using SQLAlchemy 0.7.1.
Thanks.
--
You received this message because you are subscribed
On Wed, Apr 17, 2013 at 6:20 AM, Lele Gaifax l...@metapensiero.it wrote:
James Hartley jjhart...@gmail.com writes:
Is it possible to map Table instances back to classes defined through
declarative_base()?
...I assume you are asking whether you can map a view onto a
Python class using
-to-many, I don't see the use of relationship() here, you'd
likely find it easier to use rather than assigning primary key identities
to foreign key attributes directly:
http://docs.sqlalchemy.org/en/rel_0_8/orm/tutorial.html#building-a-relationship
On Apr 3, 2013, at 2:49 PM, James Hartley jjhart
I have implemented a (simplified) one-to-many relationship which works, but
I suspect I am reimplementing functionality in a suboptimal fashion which
is already done by SQLAlchemy. The following short example:
8---
#!/usr/bin/env python
import datetime
from sqlalchemy
Embarrassingly, I'm gotten lost in calling SQL functions in SQLAlchemy
0.7.1.
I can boil the problem down to the following table structure:
CREATE TABLE words (
id INTEGER NOT NULL,
timestamp DATETIME NOT NULL,
word TEXT NOT NULL,
PRIMARY KEY (id),
UNIQUE
On Wed, Oct 26, 2011 at 10:15 AM, Michael Bayer mike...@zzzcomputing.comwrote:
On Oct 26, 2011, at 1:04 PM, James Hartley wrote:
On Wed, Oct 26, 2011 at 2:22 AM, Stefano Fontanelli
s.fontane...@asidev.com wrote:
Hi James,
you cannot define two mapper properties that use the same name
I suspect this is user error, but I am not ferreting out my mistake.
I'm porting some older code to SQLAlchemy 0.71 on top of Python 2.7.1. Code
which had originally implemented foreign keys without using REFERENCES
clauses in CREATE TABLE statements previously ran fine. Now, adding formal
I'm needing to extract domain information from stored email addresses --
something akin to the following:
SELECT DISTINCT (REGEXP_MATCHES(email, '@(.+)$'))[1] AS domain
FROM tablename
WHERE email ~ '@.+$'
While I was able to gather the information through session.execute(), I
didn't find an
I'm using SQLAlchemy 0.6.4 on top of OpenBSD utilitizing PostgreSQL 8.4.4.
As a first project, I am gathering statistics on the availability of another
Open Source project. The schema is normalized, the following SQL query
(which works at the console) to find the latest snapshot is giving me
13 matches
Mail list logo