as long as all the existing tests pass feel free to add it in ! thanks
On Aug 25, 2009, at 7:54 PM, kindly wrote:
>
> Hello,
>
> The version recipe on the wiki will version if the object is dirty,
> but I thought it would be more useful if it did it only when there was
> an actual change.
>
>
Hello,
The version recipe on the wiki will version if the object is dirty,
but I thought it would be more useful if it did it only when there was
an actual change.
The diff is below, added a test too, and I would be happy to upload it
after someone looks over it?
The recipe is at
http://www.sq
I have a client I'm doing new product integration work that requires
some complicated joins against legacy db tables.
Most of their tables all have primary keys which SqlSoup can cope with
readily. There are a few, however, that lack a primary key. A table I
need to process is called itemattribut
Marin wrote:
>
> On Aug 18, 11:40 pm, Philip Jenvey wrote:
>> There's a README.unittests that should tell you all you need to know.
>>
>> Basically you need a test database, possibly a 'test_schema' depending
>> on the db (see the bottom of the doc), then run:
>>
>> nosetests -v --dburi=some://
Based on Michael Bayer's hint, I built this instance-level changeable
object. It used Declarative, which actually makes it a bit tougher, but
this code should work for pypo's also. It's hackish in that it just monkeys
with __setattr__, but it's clear(ish) what's happening.
---
On Aug 18, 11:40 pm, Philip Jenvey wrote:
> There's a README.unittests that should tell you all you need to know.
>
> Basically you need a test database, possibly a 'test_schema' depending
> on the db (see the bottom of the doc), then run:
>
> nosetests -v --dburi=some://uri/db
I run the tests
Hey,
Michael Bayer wrote:
> at the very least if you could
> add a trac ticket that's targeted at 0.5.6 with "high" priority it can be
> the next thing I look at.
I've added ticket 1519:
http://www.sqlalchemy.org/trac/ticket/1519
I may look into adding the tests later this week myself, but at
There is a way to catch every modify event at the time it is being modify.
This is some code I use to send events when attribute are modified.
There is an attribute that you can put on the model class
__sa_instrumentation_manager__ = SetListener
and then here is code to handle modify events:
c
Martijn Faassen wrote:
>
> Hey Michael,
>
> Cool that you managed to reproduce the issue.
>
> Michael Bayer wrote:
>
>> and a potential fix is this:
>>
>> Index: lib/sqlalchemy/orm/session.py
>> ===
>> --- lib/sqlalchemy/orm/session.p
Seth wrote:
>
> Michael,
>
> Thank you for your quick reply, however I must apologize as I'm a bit
> of a SQLAlchemy newbie.
>
> In the app I'm using the tables are setup using DeclarativeBase, so
> the mapper() function is confusing me with its need for a class to be
> defined as well as a table_
That won't quite work for me - I'm not really 'building up' the
metadata, I'm introspecting it using SqlSoup so the schema name gets
put there automatically.
I had hoped to do this automatically, but I really only have to copy
the schema once, so what I did is just "print repr(table._table)" for
phrrn...@googlemail.com wrote:
> You are correct: the code-snippet will cause an exception to be thrown
> when SA attempts to flush any changes. However, the connection
> callable is called *per-instance* and it is supposed to return the
> connection to use to perform the flush. Inside the callabl
Hey Michael,
Cool that you managed to reproduce the issue.
Michael Bayer wrote:
> and a potential fix is this:
>
> Index: lib/sqlalchemy/orm/session.py
> ===
> --- lib/sqlalchemy/orm/session.py (revision 6289)
> +++ lib/sqlalc
Michael,
Thank you for your quick reply, however I must apologize as I'm a bit
of a SQLAlchemy newbie.
In the app I'm using the tables are setup using DeclarativeBase, so
the mapper() function is confusing me with its need for a class to be
defined as well as a table_name = Table(); and then usi
Seth wrote:
>
> I'm trying to set up a relation from one table to another that will
> give me a count of the unique user_id's that have posted a comment to
> a post.
>
> For example: I've set up "post" as the parent table, and "comments" as
> the child table (with post_id, user_id, comment_body, e
I'm trying to set up a relation from one table to another that will
give me a count of the unique user_id's that have posted a comment to
a post.
For example: I've set up "post" as the parent table, and "comments" as
the child table (with post_id, user_id, comment_body, etc). What I
want to be ab
Martijn Faassen wrote:
>
> Hi there,
>
> I'm looking at the remove() method in
> sqlalchemy.orm.identify.WeakInstanceDict, as this is where the assertion
> error is raised.
>
> In the 'self' dictionary there is indeed an
> sqlalchemy.orm.state.InstanceState object with under the key (it's the
> on
look into buildng your metadata first with no schema, then copying it to
the MSSQL schema using tometadata(m, schema='myschema'). the schema name
change should be propagated into foreign keys. unfortunately it doesn't
seem to support un-setting the schema name at the moment so that's why the
r
Martijn Faassen wrote:
>
> Michael Bayer wrote:
>> 1. whats this ?
>>
>> File "bin/devpython", line 25, in ?
>> execfile(sys.argv[0])
>
> That's a buildout-generated Python script that just controls what's on
> the python path. It effectively behaves like the Python interpreter.
> I've never
Hi there,
I'm looking at the remove() method in
sqlalchemy.orm.identify.WeakInstanceDict, as this is where the assertion
error is raised.
In the 'self' dictionary there is indeed an
sqlalchemy.orm.state.InstanceState object with under the key (it's the
only entry in the dictionary), but it's
You are correct: the code-snippet will cause an exception to be thrown
when SA attempts to flush any changes. However, the connection
callable is called *per-instance* and it is supposed to return the
connection to use to perform the flush. Inside the callable, you can
peek at the mapper and/or th
Michael Bayer wrote:
> 1. whats this ?
>
> File "bin/devpython", line 25, in ?
> execfile(sys.argv[0])
That's a buildout-generated Python script that just controls what's on
the python path. It effectively behaves like the Python interpreter.
I've never had any problems with it before in
So I moved it onto my linux box, since we have issues that show up
differently on osx/linux due to dictionary ordering - but the program
still runs fine. So I've run it on python 2.6 and 2.4, OSX and linux.
It doesn't even seem like it could be GC related since you are holding a
strong referen
I'm trying to use SQLAlchemy to move a database from SQLServer to
SQLite (so I can play with it at home on my linux box). I've gotten
surprisingly far - I'm very impressed with SQLAlchemy! But I'm facing
a problem with MS Sql's 'schema names' - which other dbs refer to a
'owners', I think. Sadl
Hey,
I now also tested the program with sqlite3 3.6.10: same problem.
pysqlite2.5.5 is in use.
Regards,
Martijn
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send ema
Hey,
Michael Bayer wrote:
> the program works for me, I get:
That's interesting. I've tested the script with Python 2.4, Python 2.5,
and Python 2.6, with SQLAlchemy 0.5.5 and trunk. sqlite version is
3.4.2. I get the assertion error each time.
The output I get when echo is True (on SA trunk/P
Hey,
phrrn...@googlemail.com wrote:
> I implemented a very crude flush/commit-time version of this today
> that disables all modifications. Michael suggested the use of
> connection_callable to provide fine-grained control of which engine to
> use for modifications. I haven't gone through all the
> -Original Message-
> From: sqlalchemy@googlegroups.com
> [mailto:sqlalch...@googlegroups.com] On Behalf Of Stephen Hansen
> Sent: 25 August 2009 07:34
> To: sqlalchemy@googlegroups.com
> Subject: [sqlalchemy] Tracking Last Update timestamp for models
>
> Hi all.
>
> I'm working on co
28 matches
Mail list logo