[sqlalchemy] why does attribute_mapping_collection not throw a valueerror on key mismatch?

2015-12-09 Thread Pau Tallada
thinking in implementing a custom collection class just to detect those errors. Am I missing something? Thanks in advance :) Pau. -- -- Pau Tallada Crespí Dep. d'Astrofísica i Cosmologia Port d'Informació Científica (PIC) Tel: +34 93 586 8233

Re: [sqlalchemy] AttributeError: 'psycopg2._psycopg.connection' object has no attribute '_logger'

2014-06-02 Thread Pau Tallada
allowed to display. Can you please invoke the statement “show standard_conforming_strings” on your connection and/or Postgresql database so I can see what it’s saying? On May 30, 2014, at 12:04 PM, Pau Tallada tall...@pic.es wrote: Hi, I don't know if I am doing something wrong

Re: [sqlalchemy] AttributeError: 'psycopg2._psycopg.connection' object has no attribute '_logger'

2014-06-02 Thread Pau Tallada
Or this one: (Pdb) p cursor.close() *** InternalError: InternalError('current transaction is aborted, commands ignored until end of transaction block\n',) 2014-06-02 14:15 GMT+02:00 Pau Tallada tall...@pic.es: Hi Michael, It did not happen every time. I'm pretty sure with 0.8.x it did

[sqlalchemy] AttributeError: 'psycopg2._psycopg.connection' object has no attribute '_logger'

2014-05-30 Thread Pau Tallada
, in _safe_close_cursor self.connection._logger.error( AttributeError: 'psycopg2._psycopg.connection' object has no attribute '_logger' -- -- Pau Tallada Crespí Dep. d'Astrofísica i Cosmologia Port d'Informació Científica (PIC) Tel: +34 93 586 8233

Re: [sqlalchemy] single table hierarchy: disable polymorphism and load all as base class

2014-03-25 Thread Pau Tallada
-24 11:23 GMT+01:00 Pau Tallada tall...@pic.es: No, polymorphic_on=None does not have any effect :( I'll keep trying :P Thanks! Pau. 2014-03-17 18:56 GMT+01:00 Michael Bayer mike...@zzzcomputing.com: er, guessing, polymorphic_on=None also for that class? not sure of the mapper’s

Re: [sqlalchemy] single table hierarchy: disable polymorphism and load all as base class

2014-03-24 Thread Pau Tallada
No, polymorphic_on=None does not have any effect :( I'll keep trying :P Thanks! Pau. 2014-03-17 18:56 GMT+01:00 Michael Bayer mike...@zzzcomputing.com: er, guessing, polymorphic_on=None also for that class? not sure of the mapper’s tolerance. On Mar 17, 2014, at 12:10 PM, Pau Tallada

[sqlalchemy] single table hierarchy: disable polymorphism and load all as base class

2014-03-17 Thread Pau Tallada
of on-demand polymorphism myself into the __new__ method of the Base class. Thanks! Pau. -- -- Pau Tallada Crespí Dep. d'Astrofísica i Cosmologia Port d'Informació Científica (PIC) Tel: +34 93 586 8233 -- -- You received this message

Re: [sqlalchemy] single table hierarchy: disable polymorphism and load all as base class

2014-03-17 Thread Pau Tallada
Great! I think it works for my needs :D Thank you very much! Pau. 2014-03-17 12:28 GMT+01:00 Michael Bayer mike...@zzzcomputing.com: On Mar 17, 2014, at 6:48 AM, Pau Tallada tall...@pic.es wrote: Hi everyone :) I have an application with some kind of dynamic model. Several plugins

Re: [sqlalchemy] single table hierarchy: disable polymorphism and load all as base class

2014-03-17 Thread Pau Tallada
mapper configured. Configure a primary mapper first before setting up a non primary Mapper. 2014-03-17 13:09 GMT+01:00 Pau Tallada tall...@pic.es: Great! I think it works for my needs :D Thank you very much! Pau. 2014-03-17 12:28 GMT+01:00 Michael Bayer mike...@zzzcomputing.com: On Mar

Re: [sqlalchemy] single table hierarchy: disable polymorphism and load all as base class

2014-03-17 Thread Pau Tallada
, Pau Tallada tall...@pic.es wrote: Hi, Can it be done in declarative? I've tried several ways, but I cannot find a working one :/ Basically, I think I need to redefine some self-referential relationships, as they link against the polymorphic class. Meta = declarative_meta() class

Re: [sqlalchemy] Rolling back all changes between unit tests

2013-07-24 Thread Pau Tallada
+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out. -- -- Pau Tallada Crespí Dep

Re: [sqlalchemy] Re: How to update large data?

2013-07-08 Thread Pau Tallada
...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out. -- -- Pau Tallada Crespí Dep

Re: [sqlalchemy] twophase error sqlalchemy

2013-06-26 Thread Pau Tallada
to take it up with the zope.transaction folks first. On Jun 25, 2013, at 5:49 AM, Pau Tallada tall...@pic.es wrote: Hi! I think I've stepped on the same or similar bug. I have a software which uses zodb transactions to synchronize operations in two databases. In the end, the two

Re: [sqlalchemy] twophase error sqlalchemy

2013-06-25 Thread Pau Tallada
+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- -- Pau Tallada Crespí Dep

Re: [sqlalchemy] rs.cursor.fetchall is skipping the first record when stream_results is True

2013-04-30 Thread Pau Tallada
On Apr 29, 2013, at 9:49 AM, Pau Tallada tall...@pic.es wrote: Hi, I have some very big datasets that we want to process in batches of reasonable size. In order to do that, we enable the 'stream_results' execution option (available in Postgresql) and we use the fetchmany method to retrieve

[sqlalchemy] rs.cursor.fetchall is skipping the first record when stream_results is True

2013-04-29 Thread Pau Tallada
. -- -- Pau Tallada Crespí Dep. d'Astrofísica i Cosmologia Port d'Informació Científica (PIC) Tel: +34 93 586 8233 -- -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails

Re: [sqlalchemy] interaction between lazy=noload and contains_eager()

2013-01-30 Thread Pau Tallada
include turning it into a synonym() which would allow it to be a little bit more transparent. On Jan 28, 2013, at 4:55 AM, Pau Tallada wrote: Hi, Sorry to insist on this :P But there is any way to get this kind of behaviour, the virtual column/relationship? Thanks! Pau. 2013/1/24

Re: [sqlalchemy] interaction between lazy=noload and contains_eager()

2013-01-28 Thread Pau Tallada
Hi, Sorry to insist on this :P But there is any way to get this kind of behaviour, the virtual column/relationship? Thanks! Pau. 2013/1/24 Pau Tallada tall...@pic.es Hi Michael, As always, thank you very much for your dedication :) I recognize that I am always trying to reach the edges

[sqlalchemy] interaction between lazy=noload and contains_eager()

2013-01-23 Thread Pau Tallada
it? Thank you very much! -- -- Pau Tallada Crespí Dep. d'Astrofísica i Cosmologia Port d'Informació Científica (PIC) Tel: +34 93 586 8233 -- -- You received this message because you are subscribed to the Google Groups sqlalchemy group

Re: [sqlalchemy] interaction between lazy=noload and contains_eager()

2013-01-23 Thread Pau Tallada
Ok, thank you very much :D I'll keep poking, and i'll try to provide a sample code :P 2013/1/23 Michael Bayer mike...@zzzcomputing.com On Jan 23, 2013, at 6:49 AM, Pau Tallada wrote: One final comment. With the contains_eager query, the instances that are part of the collection

Re: [sqlalchemy] interaction between lazy=noload and contains_eager()

2013-01-23 Thread Pau Tallada
= session.query(Node).filter_by(name='n2').options(joinedload('ancestors')).one() print n2.ancestors do NOT produce the same result when the collection is lazy='noload'. In the latter, the collection is empty, even after we fetch its contents with a joinedload. 2013/1/23 Pau Tallada tall...@pic.es

[sqlalchemy] Load parent on child deletion

2012-03-21 Thread Pau Tallada
is the child of another one, that parent instance is not notified of its child removal and so the event is not fired. I tried working with the cascade rules but I have not been successful. Is this behaviour supported? Thanks! Pau. -- -- Pau Tallada Crespí Dep

Re: [sqlalchemy] Load parent on child deletion

2012-03-21 Thread Pau Tallada
Yes, I meant that :P I'll try with the before_flush_event. Thanks!! 2012/3/21 Michael Bayer mike...@zzzcomputing.com On Mar 21, 2012, at 5:18 AM, Pau Tallada wrote: Hi! I have a model with a parent-child relationship on the same entity. The children collection on a parent instance has

Re: [sqlalchemy] postgres with .. select queries

2012-03-02 Thread Pau Tallada
email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. -- -- Pau Tallada Crespí Dep. d'Astrofísica i

Re: [sqlalchemy] postgres with .. select queries

2012-03-01 Thread Pau Tallada
options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. -- -- Pau Tallada Crespí Dep. d'Astrofísica i Cosmologia Port d'Informació Científica (PIC) Tel: +34 93 586 8233 -- -- You received this message

Re: [sqlalchemy] Possible bug with join condition on self-referential outer joins

2012-02-09 Thread Pau Tallada
for testing in any case, just wanted to report that a strategy has been devised that solves the issue - thanks ! On Feb 8, 2012, at 5:31 AM, Pau Tallada wrote: Uhm, the test I attached on previous mail fails using this branch: $ python test_relationships.py Traceback (most recent call last

Re: [sqlalchemy] Possible bug with join condition on self-referential outer joins

2012-02-08 Thread Pau Tallada
workings.It would take several days to come up with a general solution so I can't give you a fix for this right now. http://www.sqlalchemy.org/trac/ticket/1401 On Feb 1, 2012, at 5:40 AM, Pau Tallada wrote: Hi! I have a table with a self-reference of two columns that represents a tree

Re: [sqlalchemy] Possible bug with join condition on self-referential outer joins

2012-02-08 Thread Pau Tallada
, line 222, in go NotImplementedError 2012/2/8 Pau Tallada tall...@pic.es Thank you very much! I'll test it ASAP :) 2012/2/8 Michael Bayer mike...@zzzcomputing.com I have good news on this front, in that I've nailed down how this will work, including a patch that gets this basic thing

[sqlalchemy] Possible bug with join condition on self-referential outer joins

2012-02-01 Thread Pau Tallada
! Pau. -- -- Pau Tallada Crespí Dep. d'Astrofísica i Cosmologia Port d'Informació Científica (PIC) Tel: +34 93 586 8233 -- -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

Re: [sqlalchemy] SqlAlchemy dynamic query generation

2011-12-23 Thread Pau Tallada
. -- -- Pau Tallada Crespí Dep. d'Astrofísica i Cosmologia Port d'Informació Científica (PIC) Tel: +34 93 586 8233 -- -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

Re: [sqlalchemy] Populate sample data

2011-08-04 Thread Pau Tallada
/sqlalchemy?hl=en. -- -- Pau Tallada Crespí Dep. d'Astrofísica i Cosmologia Port d'Informació Científica (PIC) Tel: +34 93 586 8233 -- -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

Re: [sqlalchemy] bidirectional attribute_mapped_collection not working (with example)

2011-08-04 Thread Pau Tallada
Hi Michael, Thank you very much for your response! I'll try to code some workaround, and post it here if it works. Thank you again! 2011/8/3 Michael Bayer mike...@zzzcomputing.com On Aug 3, 2011, at 12:32 PM, Pau Tallada wrote: Hi! I have a model with a many-to-many relation, similar

[sqlalchemy] bidirectional attribute_mapped_collection not working (with example)

2011-08-03 Thread Pau Tallada
Hi! I have a model with a many-to-many relation, similar to the Broker/Holding/Stocks example in the docs. I've set up relationships between both sides using the association object pattern. Finally, I've set up the collection class of those relationships to an attribute_mapped_collection. It