Hello,
I've become quite used to SQLAlchemy's Declarative style notation for
defining data to be stored in SQL.
Does anyone know of library that will do something similar for simple
XML?
Basically I need objects (and attributed collections of objects) that
are effectively records for groups of s
So I have several questions:
1) Is the the raw SQL I am using sane?
2) How can I use SQLAlchemy to simply things?
3) How would I add tables events_c? events_d?
4) Since the events_x tables are already defined with
declarative_base, is there a reasonable way to make an SQLAlchemy
"Events"
quot;Events" object that knows where to retrieve and insert event records
based on the "event_type" field?
Thank you,
AF
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
T
On Oct 27, 8:03 am, Mike Conley wrote:
> On Mon, Oct 26, 2009 at 10:09 PM, Bobby Impollonia wrote:
>
> Let's say you have 2 mapped classes
> class Stuff1(Base):
> --- etc.
> class Stuff2(Base)
> --- etc.
>
> You can do something like this
>
> q1 = session.query(Stuff1.co
On Oct 26, 8:48 pm, AF wrote:
> Hello,
>
> I don't know if this is even possible is SQL, so please bear with
> me :)
>
> There are a couple a tables (say, a & b) that are used as "logs" for
> two different processes. They both have the same simp
Hello,
I don't know if this is even possible is SQL, so please bear with
me :)
There are a couple a tables (say, a & b) that are used as "logs" for
two different processes. They both have the same simple structure.
(id, time_stamp, user_id, message)
I would like to create a query that mer
Hello,
For instance if I have data tables for users, orders, and
order_line_items how would I generate a report that lists:
1) users,
2) and for each user, his/her orders,
3) and for each order, all the order_line_items
I guess I could do it in a loop in python, but I wonder of there is a
bette
Hello,
This may be a simple questions
What is the correct way to:
1) Define a "time stamp" column that takes on the current "UTC" time
by default.
2) Query for records that more than 15 minutes old?
For #1, is it some thing like this?
"Column('time_stamp', DateTime, default = datetime.u
Hello,
I'm writing a basic SQLAlchemy application, and have started to
explore the concept of unit testing in general and specifically with
nose.
Since I am new to both SQLAlchey and nose, I do not know where to
start.
Right now the app is at the point where:
1) The tables are defined with dec
Hello,
I have a table of records in the database that I want to run read
queries against, but I do want to include all of them in the search.
(There are a couple of filtering parameters to exclude records from
the searched pool, including an aptly named "is_active" flag.)
Traditionally, I would
Hello all,
Has anyone here used the "sqlamp: Materialized Path for SQLAlchemy"
library?
I am wondering:
1) Does it seem to work well?
2) Did you use it with Declarative Base, and if so, how did you
configure it?
Thank you,
:)
--~--~-~--~~~---~--~~
You received
Hello,
What is the correct way to use remote_side & single_parent relation
parameters under Declarative Base?
I'm trying to create an Adjacency List Relationship as suggested in
the docs, but I am not sure how to do this with Declarative Base.
I tried:
children = relation("Node", backref=backr
Hello,
Where do you folks recommend storing the database connection string in
my application. Clearly not in the same file with my declaratively
defined model objects.
And more generally, how do you recommend laying out an SQLAlchemy
based application? (In what files to define the engine, sess
Am starting to experiment with declarative base.
In the code block at:
http://www.sqlalchemy.org/docs/05/ormtutorial.html#building-a-relation
Why does __init__() not contain any mention of the foreign key
"user_id"?
In what way is the Address object expected to be instantiated such
that it rec
Hello,
Given hierarchical data similar to:
http://www.sqlalchemy.org/docs/05/mappers.html?#adjacency-list-relationships
With out resorting to brute force recursive queries in my objects:
1) Is there any way to retrieve all a node's children / sub-children?
2) Is there a way to retrieve the lis
Hello,
I have tables: Users & Departments. (SQlite)
Each "User" is assigned to one Department. (User.dept_id =
Department.id )
Now, I want to make once User in each Dept the "default user".
As in:
Department.default_user_id = User.id
i.,e. Column('default_user_id', ForeignKey('users.id'))
Hello
Assuming a table of Users, Choices and UserChoices... (many-to-many)
How can I generate a list for a user showing only the choices they
have _not_ opted in for?
Thank you
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goo
Hello,
Can validators be defined at table / mapper level? (Is it even a
good idea?)
I ask, since it's at the table definition layer that I define what
datatypes my columns have, so it seems natural to place the policing
function there as well.
:)
--~--~-~--~~~---~-
Hello,
Perhaps this is more of a Python question that SQLalchemy.. but...
How can I assign a random number to a DB field by default?
I tried:
default = random.randrange(1000,1) on the table definition, but I
get the same number each time?
Ideas?
--~--~-~--~~~-
tered" and "computed"
version of an existing relation, how should I do this?
See the code below.
Thank you,
AF
Code:
=
users_table = Table('users', metadata,
Column('id', Integer, primary_key=True),
I'm probably just missing something... here is my code:
engine = create_engine('sqlite:///:memory:', echo=True,
convert_unicode=True)
Session = sessionmaker(bind=engine)
session = Session()
metadata = MetaData()
users_table = Table('users', metadata,
Column('id', Integer,
Hello,
I'm using sqlite and "convert_unicode = True "on the engine.
How can I force coerce string based object attributes in to unicode?
(I had thought "convert_unicode = True" would do this)
Here is what I am seeing...
Setup code:
engine = create_engine('sqlite:///:memory:', echo=True,
conver
Hello,
I have several CGI and cron scripts and that I would like coordinate
via a "First In / First Out" style buffer.That is, some processes
are adding work units, and some take the oldest and start work on
them.
Since I need the queue to both survive system crashes and provide an
audit rec
23 matches
Mail list logo