On Mon, Feb 07, 2011 at 01:32:52PM -0500, Michael Bayer wrote:
> >> Otherwise you can append your AttributeExtension into the listeners
> >> collection on the attribute, I'd have to check the source of attributes.py
> >> to recall the exact name of the collection.
> >
> > a hint here would be appr
On Mon, Feb 07, 2011 at 10:26:18AM -0500, Michael Bayer wrote:
> Its easier to do in 0.7 where you just say
> event.listen(MyObject.attribute, "append", fn),
> any time you want.Though we haven't implemented "remove" yet.
> I'd wait for the 0.7 betas if possible.
nice!, but it's not an op
Hi,
I have a join between 2 tables (User/Adresses, complete code below). I create a
mapper as
the join of the 2 classes as:
m = orm.mapper(Join, User.__table__.outerjoin(Address.__table__) ,
properties = {
'j_id' : [Address.__table__.c.user_id, User.__table__.c.
Hi again, sorry for flooding with email this week...
I stumbled on the CircularDependencyError in some occasions with self
referencing models. I do understand that it can be tricky to INSERT and DELETE
but I'm just updating rows.
I reduced my problem to the bare minimum. It works both on 0.5.8 an
On Tue, Aug 24, 2010 at 02:48:37PM -0400, Michael Bayer wrote:
> > Info option is clearly very handy. At the moment I implemented an image
> > field in sqlkit, (that's just a bunch of handler in the gui). In order to do
> > that I used a type inherited with no addition, just to understand that that
On Sat, Aug 21, 2010 at 01:45:48PM -0400, Michael Bayer wrote:
> > columns in a property
> > column = prop.columns[0]
> >
> > props = []
> > for pr in mapper.iterate_properties:
> > if isinstance(pr, properties.RelationProperty):
> > if pr.direction.name in ('MANYTOO
Hi,
is there a way to set the type of a column added to a mapper with
column_property?
m = mapper(New, t, properties={
'my_bool': column_property(
func.my_bool(t.c.id, type=Boolean)
)
})
func 'my_bool' is a stored procedure on Postgresql and
On Tue, Dec 15, 2009 at 05:34:16AM -0800, Nebur wrote:
> If you like, I'd run your test in my environment (Py2.5,MySQL or
> SQLite). Can you mail it or put it to something like pastebin ?
thanks Nebur. It'll take quite a long time to isolate it. It's a test setup,
it's
not a test snipper thought
On Tue, Dec 15, 2009 at 04:56:39AM -0800, Nebur wrote:
> Are you sure ? Did you check that really nothing happened in the DB ?
> (Sorry for the distrust ;-) I'd expect myself to miss such a check
> sometimes, e.g. when it's late in the evening...)
Yes totally sure. I can repeat it in my setup. It'
Hi,
I have been using session with autocommit=True and autoflush=False for a
while now. I'm pretty happy with this but now I find something that I
cannot understand: a session with dirty set full, after a begin() is
empty, but no update is issued. How can that be possible? (And yes!
sess
Hi,
docs suggests (Mapping a Class against Multiple Tables) to build a mapper
as this:
class AddressUser(object): pass
j = join(users_table, addresses_table)
mapper(AddressUser, j, properties={
'user_id': [users_table.c.user_id, addresses_table.c.user_id]
})
On Fri, Dec 04, 2009 at 02:52:37PM -0500, Michael Bayer wrote:
>
> On Dec 4, 2009, at 2:20 PM, Alessandro Dentella wrote:
>
> > On Fri, Dec 04, 2009 at 01:27:46PM -0500, Michael Bayer wrote:
> >>
> >> On Dec 4, 2009, at 1:18 PM, Alessandro Dentella wrote:
>
On Fri, Dec 04, 2009 at 01:27:46PM -0500, Michael Bayer wrote:
>
> On Dec 4, 2009, at 1:18 PM, Alessandro Dentella wrote:
>
> >>> Is the only solution to attach an instance (u.job = myjob) or is there
> >>> another solution that doesn't require me to buil
> > Is the only solution to attach an instance (u.job = myjob) or is there
> > another solution that doesn't require me to build the instance?
>
> if you want SQLA's delete-orphan capability, that's the only way. If you
> want to rely upon CASCADE rules in your DB to handle it instead, that's
>
Hi,
I'm stuck with the code below raise FlushError complaining:
Traceback (most recent call last):
File "", line 49, in
File "/misc/src/sqlalchemy/sqlalchemy/lib/sqlalchemy/orm/session.py", line
673, in commit
self.transaction.commit()
File "/misc/src/sqlalchemy/sqlalch
> Movie is attached to a Director or not. like the FAQ says, we choose
> not to get into generating "events" from foreign keys being set.
> which is not a "forever" rule, but if you look in trac there are about
> 300 ORM issues open that I'd rather get resolved before I have the
> time
[Sorry for reposting, Erroneously sent to another thread.]
In faq 5.13 it's explained why setting bar.foo_id would not generate the
object bar.foo.
I stumble in the same problem when creating a Movie in an example with
Director/Movie and a relation -'movies' on director- that has
'delete-orphan
In faq 5.13 it's explained why setting bar.foo_id would not generate the
object bar.foo.
I stumble in the same problem when creating a Movie in an example with
Director/Movie and a relation -'movies' on director- that has
'delete-orphan'.
running::
f = m.Movie(title="my title")
f.directo
On Thu, Jul 23, 2009 at 02:48:12PM -0400, Michael Bayer wrote:
>
> add passive_deletes = True
Thanks and sorry for the noise on such trivial question, present in the
faq... , I've already used it and... forgot!
sandro
--~--~-~--~~~---~--~~
You received this mess
On Sat, May 23, 2009 at 02:43:33PM -0400, Michael Bayer wrote:
>
>
> On May 23, 2009, at 10:15 AM, Alessandro Dentella wrote:
>
> >
> > Hi,
> >
> > when from my pygtk application i commit, I really do::
> >
> >if self.session.a
Hi,
when from my pygtk application i commit, I really do::
if self.session.autocommit:
self.session.begin()
self.session.commit()
I'm normally using session.autocommit = True as a mean to prevent all
those 'idle in transaction' processes (that prev
Hi,
in a sessionExtension.after_flush hook I create objects (namely todo
actions depending on what people have inserted/updated).
At present I create these objects in the current session, but I do
understand is not clean as the flush has already occurred. It almost
works, objects are r
On Tue, May 05, 2009 at 06:01:27AM -0700, GHZ wrote:
>
> try :
>
> m = mapper(MyJoin, a_table.join(b_table), properties={
> 'a_id' : [Table_a.__table__.c.id, Table_b.__table__.c.a_id]
> })
>
> from:
> http://www.sqlalchemy.org/docs/05/mappers.html#mapping-a-class-against-multiple-tables
Hi,
how should I configure a mapper that represents a join between two tables
so that inserting a new object writes the foreign key between the two in
the proper way?
class Table_a(Base):
__tablename__ = 'a'
id = Column(Integer, primary_key=True)
descri
Hi,
i'm playing with outerjoin defined in the mapper. I'm getting results
different from what I expected, so that I would like to understand which is
the underline logic.
Where a Query w/ outerjoin SELECT has in the backend n rows and would have m
rows in a simple join, I only get m rows plus on
Hi,
I have a structure as this:
fossati
setup (module with attribute USER)
models/cliente(User)
calendar (Entry)
apps/job
in calendar.py:
from cliente import User
class Entry(Base):
...
user = relation(User, s
Hi,
I have a definition similar to this::
class Ticket(Base):
__tablename__ = 'ticket'
id = Column(Integer, primary_key=True)
assigned_to_id = Column(ForeignKey(User.id))
assigned_to = relation(User, primaryjoin = assigned_to_id == User.id,
Hi,
in the following code new_film is added to a director film list and then
removed, before committing.
I just realized that this makes it vanish from the session. What's the
rationale behind it? I fear I don't understand something becouse I would
have thought it should stay in the session
Hi,
is there a way to get the session an object belongs to?
I have been looking around and cannot find any function/way for that...
Thanks in advance
sandro
*:-)
--
Sandro Dentella *:-)
http://sqlkit.argolinux.orgSQLkit home page - PyGTK/python/sqlalchemy
--~--~-~--
Hi,
I'd like to get programmatically the class to which a relation
points. Suppose I have the following situation:
class Project(Base):
...
staff = relation(User, secondary=project_manager)
manager = relation(User, secondary=project_staff)
Now I want to get User class s
Hi,
i'm adding in sqlkit library some signals around commit, and particularly
in post-commit phase.
As I'd like to have the possibility to see which attributes where modified
from within the callback I used 'after_flush' method of SessionExtension.
So I have 2 questions:
1. Triv
On Thu, Feb 19, 2009 at 12:57:07PM +0100, Alessandro Dentella wrote:
> Hi,
>
> in a working setup I added a ForeignKey to table 'cliente_cliente' as
> follows (client_id):
>
> class Project(Base):
> __tablename__ = "ticket_project"
>
Hi,
in a working setup I added a ForeignKey to table 'cliente_cliente' as
follows (client_id):
class Project(Base):
__tablename__ = "ticket_project"
__table_args__ = {'useexisting' : True}
id = Column(Integer, primary_key=True)
date_create = Column(Date(),
serve
On Sun, Feb 01, 2009 at 04:41:11PM -0500, Michael Bayer wrote:
> Here you go, its a psycopg2 bug. Familiarize yourself with the
> attached test case, then post it on the psycopg2 mailing list.
Thanks a lot for you fast and valuable help, as usual. I verified that
version 2.0.8 of psycopg2 doe
> stack trace you posted doesn't make sense to me though, as its issuing
> a SELECT statement but PG is raising an exception for an UPDATE /
> DELETE ? I've never seen that before. If you can provide a self-
> contained test case which reproduces that behavior we can try it out.
Here is is.
> "connection already closed" is a psycopg2 error indicating that the
> socket has been shut down. looking at your output, I see a raw
> execute() occuring within the string conversion of your Project object
> and theres a module called sqlkit/db/utils.py causing an exception
> throw.
Hi,
i'm trying to understand how to cope with errors from the database and I
don't completely understand the following behaviour.
I try to delete a Project that has integrity constrains, so correctly the
db complains and SA raises an OperationalError. Right now I'm not trying
to unders
On Wed, Jan 07, 2009 at 01:12:48PM -0500, Michael Trier wrote:
> Hi
>
> On Wed, Jan 7, 2009 at 9:35 AM, sandro dentella wrote:
>
>
> I realize now that autoloading a float field in Sqlite returns a
> SLNumeric rather that Float. The schema is:
>
> is this a known issue?
>
>
> It
> in another place comparing str fails just because a join has ON join
> condition inverted (but semantically equivalent). What's the correct
> way to test if two queries are semantically equivalent?
>
> Thanks
>
> sandro
> *:-)
>
>
>
>
>
> Hi sandro, did you want to
On Tue, Nov 18, 2008 at 11:31:38AM -0500, Michael Bayer wrote:
>
>
> is_modified() has a flag "passive" which when set to True, disables lazy
> loaders from executing. As it turns out the flag was also not hooked up
> so you'd have to use the latest trunk to get this.
>
> the reason it wants t
On Tue, Nov 18, 2008 at 10:27:32AM -0500, Michael Bayer wrote:
>
>
> is_modified() shouldn't trigger a flush. is that with rc4 ?
no it was svn rev. 4935. It's still the same with rev. 5311.
I verified again: autoflush=False, just works. Autoflush=True
shows that
## here session.new is not emp
On Sat, Oct 11, 2008 at 11:19:31PM -0400, Michael Bayer wrote:
>
>
> On Oct 11, 2008, at 1:44 PM, sandro dentella wrote:
>
> >
> > Hi,
> >
> > I started using the .join() method on query and that' s really
> > powerful, with reset_joinpoint and the list of attributes setting the
> > path of re
> Yep:
>
>m = sqlalchemy.orm.class_mapper(User)
Thanks a lot!
*:-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsu
43 matches
Mail list logo