Re: [sqlalchemy] Missing table in FROM clause in generated subquery

2018-08-15 Thread kevin
I was missing the correlate(). Thanks a lot Mike! Best regards, Kevin On 16/08/2561 00:26, Mike Bayer wrote: On Tue, Aug 14, 2018 at 12:40 AM, wrote: Dear SQLAlchemy experts, I'm having difficulty generating an SQL query with SQLAlchemy. I'm trying to query a list of messages

[sqlalchemy] Missing table in FROM clause in generated subquery

2018-08-13 Thread kevin . thierry . citlao
t.msg.label('msg'), ]).where(t.src == Host.id) return subq tables = ((DEP, dst_dep), (ARR, dst_arr)) q = union_all(*[get_bs_subq(t[0], t[1]) for t in tables]).alias('res') How can I generate the proper, working SQL query with SQLAlchemy? Thank you. Best regards, Kevin

Re: [sqlalchemy] Checking for a unique constraint violation before inserting new records, is it recommended?

2018-08-05 Thread Kevin Isaac
Any updates to this Michael? I've been researching about this but couldn't find a better solution than parsing the error message with regex. Would love to hear if there's a better way of doing this. On Saturday, December 20, 2014 at 12:52:49 AM UTC+5:30, Michael Bayer wrote: > > > > alchemy1 > w

Re: [sqlalchemy] Oracle Boolean Attribute - SQL command not properly ended

2017-11-30 Thread Kevin Foley
Would using not_ be the appropriate way to get non current addresses? On Thursday, November 30, 2017 at 1:22:56 PM UTC-5, Kevin Foley wrote: > > Ah I see, I was using q = > s.query(A.is_current_address).filter(A.is_current_address==True), just > using A.is_current_address produ

Re: [sqlalchemy] Oracle Boolean Attribute - SQL command not properly ended

2017-11-30 Thread Kevin Foley
Ah I see, I was using q = s.query(A.is_current_address).filter(A.is_current_address==True), just using A.is_current_address produces the same results you have. Thanks! On Thursday, November 30, 2017 at 12:49:37 PM UTC-5, Mike Bayer wrote: > > On Thu, Nov 30, 2017 at 10:31 AM, Kevin

[sqlalchemy] Oracle Boolean Attribute - SQL command not properly ended

2017-11-30 Thread Kevin Foley
I created a Boolean attribute for an Oracle table that checks if an address is the customer's current address. @is_current_address.expression def is_current_address(cls): return and_(cls.eff_date <= func.current_date(), cls.term_date >= func.current_date()) When I try to run a query wit

[sqlalchemy] Re: sqlacodegen bug ?

2017-06-14 Thread Kevin Ernst
acodegen simply creates a Table variable, rather than a class as you would expect. Hopefully this can still help someone else in this situation, who comes here searching for a resolution. Cheers, Kevin On Tuesday, May 24, 2016 at 12:35:43 PM UTC-4, Jean-Luc Menut wrote: > > > But some

[sqlalchemy] Re: polymorphic_identity mutiple values for base class and/or subclass

2016-10-11 Thread Kevin Mcintyre
Just to note, when I do an save with a non-specified identity I get a warning, but when I do a query I get an exception. On Tuesday, October 11, 2016 at 8:20:25 PM UTC-7, Kevin Mcintyre wrote: > > I'm wondering if it's possible to have multiple values for a base class or

[sqlalchemy] polymorphic_identity mutiple values for base class and/or subclass

2016-10-11 Thread Kevin Mcintyre
I'm wondering if it's possible to have multiple values for a base class or any subclasses. For the employee, engineer, manager example was hoping to add a type 'janitor' into the employee class, and/or 'electrical_engineer' into the engineer class. -- You received this message because you ar

[sqlalchemy] Applying joins sequentially to select objects

2016-06-15 Thread Kevin Murphy
ept_alias, col == concept_alias.c.concept_id, isouter=True)) return select_obj metadata, select_obj = setup() select_obj = transform(metadata, 'main_table', select_obj) print("select_obj.compile(dialect=postgresql.dialect())) Thanks, Kevin -- You received this message

Re: [sqlalchemy] Composite foreign keys which has common parent foreign key in SQLalchemy

2015-06-26 Thread Kevin Qiu
= mydb.Column(mydb.String(62), mydb.ForeignKey('USER.email'), primary_key=True) staff_id = mydb.Column(mydb.String(20), index = True) __mapper_args__ = { 'polymorphic_identity':'STAFF', } On Thu, Jun 25, 2015 at 8:17 PM, Mike Bayer wrote: > > > On 6/25/15 2:

[sqlalchemy] Composite foreign keys which has common parent foreign key in SQLalchemy

2015-06-25 Thread Kevin Qiu
In the SQLalchemy documentation , it states "It is standard practice that the same column is used for both the role of primary key as well as foreign key to the parent table, and that the col

Re: [sqlalchemy] joined table inheritance child table query return different object after insertion

2015-06-25 Thread Kevin Qiu
inner to get started. For instance, I need the ORM part, the whole ORM section is 400 pages. It's a bit overwhelming when I started. On Tue, Jun 23, 2015 at 5:12 PM, Mike Bayer wrote: > > > On 6/23/15 6:06 AM, Kevin Qiu wrote: > > Thanks for response. How do you delete the join

Re: [sqlalchemy] joined table inheritance child table query return different object after insertion

2015-06-23 Thread Kevin Qiu
on that. On Mon, Jun 22, 2015 at 4:33 AM, Mike Bayer wrote: > > > On 6/21/15 1:46 PM, Kevin Qiu wrote: > > It's a test db, there's only one record being added to the table. And I > ensure that with a assertIn() test and it passes. > The original code was:

Re: [sqlalchemy] joined table inheritance child table query return different object after insertion

2015-06-21 Thread Kevin Qiu
p_rst.proj_s_date , internship_app.proj_s_date) return internship_app On Sunday, June 21, 2015 at 7:20:04 PM UTC+2, Michael Bayer wrote: > > did you try adding an ORDER BY to that query? calling query.first() will > return only the first result in an unordered list. It

[sqlalchemy] joined table inheritance child table query return different object after insertion

2015-06-21 Thread Kevin Qiu
I create a unit test that add new ProjApp object to the database, but the returned object shows it is not the same object inserted, I don't follow why it's like this because I have others tests on inserting a row to a different table, and returned shows the same row object. Test result:

[sqlalchemy] relationship supersedes the same relationship on inherited mapper can cause dependency issues during flush

2015-06-18 Thread Kevin Qiu
Error: SAWarning: Warning: relationship 'staff_obj' on mapper 'Mapper|ProjectApp|PROJECT_APP' supersedes the same relationship on inherited mapper 'Mapper|Application|APPLICATION'; this can cause dependency issues during flush self._check_conflicts() Application is a parent class which can't

[sqlalchemy] NameError: name 'Index' is not defined

2015-06-18 Thread Kevin Qiu
I try to define composite index on last_name, first_name on flask-sqlalchemy, the error says NameError: name 'Index' is not defined Code: class Student(mydb.Model): __tablename__ = 'STUDENT' __table_args__ = (Index('SearchNameIndices', "last_name", "first_name"), ) study_no = mydb.Column(mydb.Stri

Re: [sqlalchemy] column_property order_by error

2015-02-03 Thread Kevin S
y 2, 2015 at 5:57:49 PM UTC-5, Michael Bayer wrote: > > the workaround, or using git master? > > > > Kevin S > wrote: > > > Yes, that does fix the issue. > > > > -- > > You received this message because you are subscribed to the Google >

Re: [sqlalchemy] column_property order_by error

2015-02-02 Thread Kevin S
Yes, that does fix the issue. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalch

[sqlalchemy] column_property order_by error

2015-02-02 Thread Kevin S
1" in the order by, but other times it does a subquery. The rest of the query is always the same, since it comes from a test suite. Thanks, -Kevin -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and sto

[sqlalchemy] hybrid_property query into a JSON column with overrides (PostgreSQL)

2015-01-04 Thread Kevin
Hi, I'm using sqlalchemy with postgresql-9.3. I'm trying to create a query-able column in a table that checks for explicit user overrides before checking the original "raw" data in a JSON column. An example of what I'm trying to do is below. The 'raw_data' JSON may be something like: {'foo': '

[sqlalchemy] relationship join with same table twice

2014-12-08 Thread Kevin S
I am trying to construct a filter against a table that has two references to the same child table. But I am completely confused how to go about it. I've seen lots of examples for using aliases, but I have not been able to get any to work. So I'll just try to give my example simply, and ask what

[sqlalchemy] boolean column_property using exists

2014-11-05 Thread Kevin S
I've seen slight variations on this topic, but not exactly what I'm looking for. I want to use a column_property (or something like it) to map the existence of some Child relationship. Say for example, I have two summary pages in a web app. One for displaying rows of Parent objects, and one fo

Re: [sqlalchemy] Lazy load collection from a batch of objects with one query

2014-11-04 Thread Kevin S
g/zzzeek/sqlalchemy/wiki/UsageRecipes/DisjointEagerLoading, > > which illustrates how to use set_committed_value() which you’ll want to use > if you’re implementing loading. > > > On Nov 4, 2014, at 7:19 AM, Kevin S > > wrote: > > Yes, I would say that is an acceptabl

Re: [sqlalchemy] Lazy load collection from a batch of objects with one query

2014-11-04 Thread Kevin S
delayed > fashion though I don't know that the 3rd party extension does this. > > Sent from my iPhone > > On Nov 3, 2014, at 2:52 PM, Kevin S > > wrote: > > Ok, I think I understand some of the reasoning behind not wanting to > implement such a feature. I think

Re: [sqlalchemy] Lazy load collection from a batch of objects with one query

2014-11-03 Thread Kevin S
r wrote: > > > > On Nov 1, 2014, at 11:53 AM, Kevin S > > wrote: > > > > I think I've seen this sort of functionality in Hibernate, where it > tries to optimize if you are going to access some lazy loaded property on a > collection of objects. It can

[sqlalchemy] Lazy load collection from a batch of objects with one query

2014-11-01 Thread Kevin S
e case for not eager loading these kinds of relationships at query time, hence why I'm asking. -Kevin -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, se

Re: [sqlalchemy] Is there a good ORM tutorial? And advice on parent/child management

2014-01-10 Thread Kevin Horn
On Fri, Jan 10, 2014 at 10:55 AM, Paul Moore wrote: > On Friday, 10 January 2014 16:27:12 UTC, Kevin H wrote: > >> It sounds to me like the problem you're having has to do with how you are >> getting the reference to the package, which isn't shown in your example

Re: [sqlalchemy] Polymorphic joined-table inheritance

2014-01-10 Thread Kevin Horn
> > I have been looking at this code for quite some time and I can't figure > out what I am missing. > If any of you have any idea of what I could be possibly doing wrong, or > any ideas that I could > try, I will be very very happy to hear them, because I have run out of > ideas to try

Re: [sqlalchemy] Is there a good ORM tutorial? And advice on parent/child management

2014-01-10 Thread Kevin Horn
n more interested in a good "ORM for experienced SQL developers" > tutorial that tells me how the ORM differs from the core level (and where > its benefits lie). > > Thanks, > Paul > > -- > You received this message because you are subscribed to the Googl

Re: [sqlalchemy] Insert from JSON data (coping with unneeded fields and varying types)

2013-12-19 Thread Kevin Horn
bscr...@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. > -- -- Kevin Horn -- You received this message because

Re: [sqlalchemy] Creating Tables from a Schema defined in YAML

2013-08-22 Thread Kevin Horn
ns first, get them into a list or tuple, and then use "star args" to pass them into the Table constructor. Something like this: columns = [Column(name, type) for name, type in some_kind_of_iterable_generated_from_your_yaml] table = Table(theTableName, Metadata, *columns) though obviously that&#

Re: [sqlalchemy] automated mapping - sqlalchemy or sqlsoup or something else

2013-07-26 Thread Kevin Horn
ost 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. > > > -- -- Kevin Horn -- You received this message because you are subscribed to the

Re: [sqlalchemy] flask-sqlalchemy pysybase connections

2013-06-20 Thread Kevin S
e between the pysybase and the sybase-pyodbc dialects that suggest why that argument is valid for one, but not the other... Any hints? On Wednesday, June 19, 2013 4:35:51 PM UTC-4, Michael Bayer wrote: > > > On Jun 19, 2013, at 3:07 PM, Kevin S > > wrote: > > > Unfortunately,

Re: [sqlalchemy] flask-sqlalchemy pysybase connections

2013-06-19 Thread Kevin S
here some easy or brute force way to force that call to NOT "grab the GIL"? From my brief reading it sounded like c extensions are supposed to get around GIL issues, but again I am naive on the subject. On Sunday, June 16, 2013 1:10:03 PM UTC-4, Michael Bayer wrote: > > > On J

Re: [sqlalchemy] flask-sqlalchemy pysybase connections

2013-06-16 Thread Kevin S
On Jun 14, 2013, at 3:18 PM, Kevin S > > wrote: > > > I am running into a problem while developing a flask application using > flask-sqlalchemy. Now, I'm not even 100% sure my problem is sqlalchemy > related, but I don't know how to debug this particular issue. >

[sqlalchemy] flask-sqlalchemy pysybase connections

2013-06-14 Thread Kevin S
I am running into a problem while developing a flask application using flask-sqlalchemy. Now, I'm not even 100% sure my problem is sqlalchemy related, but I don't know how to debug this particular issue. To start, I have a sybase database that I want to see if I can build a report generating ap

Re: [sqlalchemy] complex many to many relationship

2013-03-28 Thread Kevin Stone
ce_assoc columns go here > ) > > Marker.references = relationship( > Reference, > secondary=reference_assoc, > primary_join=and_(Marker.marker_key == reference_assoc.object_key, > reference_assoc.type_key == 1), > secondary_join=(reference_assoc.ref_key == Refer

Re: [sqlalchemy] complex many to many relationship

2013-03-27 Thread Kevin S
marker_key 215, but really that referenceAssoc is not for a marker but for some other type. It should not bring back any markers. On Wednesday, March 27, 2013 1:14:43 PM UTC-4, Kevin S wrote: > > Also, is it appropriate to define a backref here? It returns wrong data. > When I get a Refe

Re: [sqlalchemy] complex many to many relationship

2013-03-27 Thread Kevin S
ese params : {'@_mgitype_key_1': 2, '@param_1': 215} That does not make sense as SQL and just returns a random marker. On Wednesday, March 27, 2013 1:05:26 PM UTC-4, Kevin S wrote: > > Thanks. I have it working for the Marker to Reference_Assoc relationship: > Marker.referen

Re: [sqlalchemy] complex many to many relationship

2013-03-27 Thread Kevin S
Reference. I am not sure how many relationships I need and on which classes to define them. On Wednesday, March 27, 2013 12:48:23 PM UTC-4, Simon King wrote: > > On Wed, Mar 27, 2013 at 4:13 PM, Kevin S > > wrote: > > Setup: I have been learning SQL Alchemy to build a protot

[sqlalchemy] complex many to many relationship

2013-03-27 Thread Kevin S
Setup: I have been learning SQL Alchemy to build a prototype (proof of concept) Flask app for our internal website. We want to replace our current site, which is made entirely of slow python CGIs and raw SQL. Our database (Postgres) is fairly large, but has some unusual table relationships, and

[sqlalchemy] How to avoid double join on the same table?

2012-11-23 Thread Kevin Q
suppose I have the following tables (in pseudo-code) User: * userid * name Thing * thingid * name * userid Thing.user = relation(User, User.userid==Thing.userid) Now, If I have the following query: query = session.query(Thing).option(joinedload('user')).join(User).filter(User.name == 'blah')

Re: [sqlalchemy] Detect whether a query already has a join on a table?

2012-11-22 Thread Kevin Qiu
ayer wrote: > > On Nov 21, 2012, at 9:26 PM, Kevin Q wrote: > > I want to avoid double joining on the same table. I know query._from_obj > is where the query stores the join elements. However, it's not there if the > join is from query.options(joinedload('some_relation'))

[sqlalchemy] Detect whether a query already has a join on a table?

2012-11-21 Thread Kevin Q
I want to avoid double joining on the same table. I know query._from_obj is where the query stores the join elements. However, it's not there if the join is from query.options(joinedload('some_relation')). For example, I have the following table relations: User: * userid * name Thing * thingid

Re: [sqlalchemy]

2012-11-07 Thread Kevin Horn
On Fri, Nov 2, 2012 at 2:09 PM, Michael Bayer wrote: > > On Nov 2, 2012, at 1:25 PM, Kevin Horn wrote: > >> I'm trying to copy some tables from MySQL to PostgreSQL, and it looked >> like Table.tometadata() was exactly what I needed. >> >> However, it

[sqlalchemy]

2012-11-02 Thread Kevin Horn
I'm trying to copy some tables from MySQL to PostgreSQL, and it looked like Table.tometadata() was exactly what I needed. However, it's not working. I keep getting a SQL syntax error when trying to create the new table. -- sqlalchemy.exc.ProgrammingError: (ProgrammingError) syntax er

[sqlalchemy] Re: 3 SQL Tables Mapped to a Single Declarative Base Class

2012-03-29 Thread kevin c
Mis-post: (3) should be: 3) What about if mmf_user.password is the MD5() of the password while auth_user.auth_password is a SHA1 salted version of it? -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@

[sqlalchemy] 3 SQL Tables Mapped to a Single Declarative Base Class

2012-03-29 Thread kevin c
s of User() that encompasses those 3 classes seamlessly 2) where User.username updates would update mmf_user.username as well as auth_user.auth_username? 3) What about if mmf_user.username is the MD5() of the password while auth_user.auth_password is a SHA1 salted version of it? Is this even

Re: [sqlalchemy] event interface

2010-12-30 Thread Kevin Horn
On Thu, Dec 30, 2010 at 11:50 AM, Michael Bayer wrote: > the twitterstream is leaning a lot towards not having the "on_", we'll see > what happens as the day goes on. > > For what it's worth, I think it's fine. It makes the interface seem very obvious to me.

[sqlalchemy] Oracle setinputsizes usage (just making sure)

2010-09-13 Thread Kevin Mills
when I have a rather large CLOB data structure). It seems that sqa does this automatically when I connect to the database. Am I reading it correctly or is there another step that I need to complete? Thanks, Kevin 43rd Law of Computing: Anything that can go wr fortune: Segmentation violation

Re: [sqlalchemy] Oracle's XMLTyoe

2010-09-12 Thread Kevin Mills
when I get back. I will also try to create a custom UserDefinedType and see if I can go from there. I just have yet to have any luck to find anything that directly interacts with an XML object in the database without having to convert it to anohter data type. Kevin 43rd Law of Computing: Any

Re: [sqlalchemy] callproc support

2010-03-22 Thread Kevin Wormington
Michael Bayer wrote: On Mar 22, 2010, at 3:48 PM, Kevin Wormington wrote: That's getting closer. Now if I could just figure out how to get it to use the parameters that I'm actually passing in engine.execute. It appears ibm_db_sa botches the sql (to "CALL BILLING.sub

Re: [sqlalchemy] callproc support

2010-03-22 Thread Kevin Wormington
ING', proxy=ProcedureProxy(), echo=True) subid=1000 balance=0 res = engine.execute(procedure("BILLING.subscriber_balance", subid, balance)) print res.context.callproc_result Michael Bayer wrote: On Mar 21, 2010, at 9:33 PM, Kevin Wormington wrote: As a test I altered the compile_

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
cute(statement, parameters) else: return execute(cursor, statement, parameters, context) Kevin Wormington wrote: I was able to get it working from just the ibm_db_dbi interface - the actual call has to be: cursor.callproc('BILLING.subscriber_balance',(subid,bal

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
return cursor.callproc(statement, parameters) to actually have the (subid,balance) in the parameters? Kevin Michael Bayer wrote: On Mar 21, 2010, at 8:07 PM, Kevin Wormington wrote: I just modified the compile to return just the procedure name and the cursor.callproc to send the statement and t

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
operation. Kevin Wormington wrote: I just modified the compile to return just the procedure name and the cursor.callproc to send the statement and the two parameters as a tuple and the DB2 receives the correct SQL: CALL BILLING.subscriber_balance(?,?) But I get the following back from ibm_db_dbi

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
.py", line 951, in _callproc_helper raise _get_exception(inst) ibm_db_dbi.DatabaseError: ibm_db_dbi::DatabaseError: Describe Param Failed: [IBM][CLI Driver] CLI0150E Driver not capable. SQLSTATE=HYC00 SQLCODE=-9 Looks like it doesn't like my values perhaps not being actual var

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
any arguments. Just not sure how to fix it. Michael Bayer wrote: On Mar 21, 2010, at 7:34 PM, Kevin Wormington wrote: From DB2 logs it appears that the following is what's getting sent to DB2 and resulting in the error: CALL BILLING.subscriber_balance(1000,?)( ) This is usi

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
Michael Bayer wrote: On Mar 21, 2010, at 5:44 PM, Kevin Wormington wrote: I have tried several different ways of getting plain execute to work including via the low-level ibm_db.execute interface with no luck. I have also tried changing the DB2 side to be a function instead of a stored

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
of the extra set of ()'s? Thanks, Kevin Michael Bayer wrote: On Mar 21, 2010, at 12:50 PM, Kevin Wormington wrote: Hi, I am using SQLAlchemy 0.5.8 with the ibm_db_sa (DB2) adapter and I am wanting to add simple session.callproc support so that I can get results from stored procedures th

Re: [sqlalchemy] Re: @comparable_using

2010-03-21 Thread Kevin Wormington
After fixing my cut&paste problem I just get DB2 sql errors from the sample code. I'm going to turn on some more logging in db2 and see what is actually reaching it. Kevin Matthew wrote: I got around this by switching to declarative and declaring my property like this:

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
Please disregard...cut & paste messed up the indention. Kevin Wormington wrote: I get the following when trying the example implemention: Traceback (most recent call last): File "test.py", line 6, in class procedure(ClauseElement): File "test.py", line 15, in

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
ompiler, **kw): return "%s(%s)" % (element.name, ",".join(str(expr) for expr in element.args)) Kevin Wormington wrote: Michael Bayer wrote: On Mar 21, 2010, at 12:50 PM, Kevin Wormington wrote: Hi, I am using SQLAlchemy 0.5.8 with the ibm_db_sa (DB2) adapte

Re: [sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
Michael Bayer wrote: On Mar 21, 2010, at 12:50 PM, Kevin Wormington wrote: Hi, I am using SQLAlchemy 0.5.8 with the ibm_db_sa (DB2) adapter and I am wanting to add simple session.callproc support so that I can get results from stored procedures that don't use a select or table forma

[sqlalchemy] callproc support

2010-03-21 Thread Kevin Wormington
ears that I would just need to add the method in the ibm dialect class and into engines/base.py to raise an exception for other dialects that don't support it. Can it really be that easy? Also, if I implement this will it be a possibility to get it integrated into future releases?

RE: [sqlalchemy] PG8000 UnicodeDecodeError

2010-02-06 Thread Kevin Ar18
> > Nope. Use the latest git trunk of pg8000, 1.07 has bugs. Note it was released on Jan 9 2009. > I actually tried really hard to do that, really I did. :) Github was broken > or something last night -- it wouldn't zip the files. > > BTW, let me make sure my install procedures are correct:

RE: [sqlalchemy] PG8000 UnicodeDecodeError

2010-02-06 Thread Kevin Ar18
> Nope. Use the latest git trunk of pg8000, 1.07 has bugs. Note it was released on Jan 9 2009. I actually tried really hard to do that, really I did. :) Github was broken or something last night -- it wouldn't zip the files. BTW, let me make sure my install procedures are correct: 1. Go to

[sqlalchemy] PG8000 UnicodeDecodeError

2010-02-05 Thread Kevin Ar18
So, I'm using PG8000 1.07 and SqlAlchemy 0.6beta1dev_r6718 and I get this error: UnicodeDecodeError: 'ascii' codec can't decode byte 0x8d in position 3: ordinal not in range(128) I saw a past message about this same thing that said to use a newer version of PG8000 Well, as far as I can tell, v

Re: [sqlalchemy] Table as dictionary?

2010-01-15 Thread Kevin Horn
make your mapped object behave like a dictionary by using __getitem__(), __setitem__(), etc. I don't know enough about SQLAlchemy internals to know whether that would interfere with anything SQLAlchemy itself is doing though. Kevin Horn -- You received this message because you are subscribed to t

RE: [sqlalchemy] How do you handle threading issues?

2009-12-19 Thread Kevin Ar18
The method that works 95% of the time is, just establish a connection to the database, start a transaction, do some work that stays within the thread, commit the transaction. Then throw all loaded state in that thread away, and reload it all on the next transaction. Its only if you expect

RE: [sqlalchemy] How do you handle threading issues?

2009-12-18 Thread Kevin Ar18
it really is that - simultaneous transactions are isolated from one another, and their results are only made visible to other transactions after they're committed. as far as locking, you generally choose between an "optimistic" and a "pessimistic" approach: Thanks. Ok, so I found an article

[sqlalchemy] How do you handle threading issues?

2009-12-17 Thread Kevin Ar18
Basic question: I have 1 app with multiple processes and threads. Each thread and/or process may end up trying to do something to the database at the same time. What is the solution to threading? How do web frameworks solve it? Is there some inherent design in databases and/or SQLAlchemy that

[sqlalchemy] Re: vertical partitioning

2009-09-30 Thread Kevin Horn
nal offence. >-- E. Dijkstra, 1975 > Check out the "Customizing Column Properties" in the Mapper Configuation docs: http://www.sqlalchemy.org/docs/05/mappers.html#customizing-column-properties If I understand correctly, this should do what you want. (Disclaimer: haven't

[sqlalchemy] Re: Inheritance + Pseudo-adjacency-list?

2009-09-23 Thread Kevin Horn
#x27;employees', order_by=id)) __mapper_args__ = {'polymorphic_identity':'person'} def __init__(self, first_name, middle_init, last_name): self.first_name = first_name self.middle_init = middle_init self.last_name = last_name def __repr__(se

[sqlalchemy] Re: Inheritance + Pseudo-adjacency-list?

2009-09-23 Thread Kevin Horn
On Wed, Sep 23, 2009 at 10:57 AM, Kevin Horn wrote: > > > On Wed, Sep 23, 2009 at 12:27 AM, Michael Bayer > wrote: > >> >> >> On Sep 22, 2009, at 11:59 AM, Kevin H wrote: >> >> > >> > I'm having some trouble developing

[sqlalchemy] Re: Inheritance + Pseudo-adjacency-list?

2009-09-23 Thread Kevin Horn
On Wed, Sep 23, 2009 at 12:27 AM, Michael Bayer wrote: > > > On Sep 22, 2009, at 11:59 AM, Kevin H wrote: > > > > > I'm having some trouble developing my model, and was hoping someone on > > this list could help... > > > > Here's what I want: &g

[sqlalchemy] Inheritance + Pseudo-adjacency-list?

2009-09-22 Thread Kevin H
I'm having some trouble developing my model, and was hoping someone on this list could help... Here's what I want: A BizEntity object A Person and Company object (both descended from BizEntity, using joined table inheritance) A Company.employees attribute, which points to a list of Persons who wo

[sqlalchemy] Re: Modifiable collections on a many-to-many, same table mapping

2009-03-05 Thread Kevin Dangoor
t;three ways to > persist the same thing", leading to errors like that. OK, I can see this case being a bit complex. I just wanted to be sure I wasn't missing some mechanism for handling it. Thanks! Kevin -- Kevin Dangoor work: http://labs.mozilla.com/ email: k...@blazingthi

[sqlalchemy] Re: Database migrations using declarative

2009-03-05 Thread Kevin Dangoor
able__ When you create new columns, don't forget that you need to flip the column declaration around class Bar(Base): foo = Column(String) becomes foo = Column('foo', String) I'm using declarative with sqlalchemy-migrate just fine. Kevin -- Kevin Dango

[sqlalchemy] Modifiable collections on a many-to-many, same table mapping

2009-03-05 Thread Kevin Dangoor
primaryjoin=Connection.followed_id==id, secondary=Connection.__table__, secondaryjoin=id==Connection.following_id) def follow(self, ou): self.i_follow.append(Connection(following=self, followed=ou)) S

[sqlalchemy] Problem sending imap iterator to Session.execute

2009-02-06 Thread Kevin Martin
I am migrating from SA 0.4 to SA 0.5.2 and I am having some problems. I am using the orm session object and issuing raw sql commands in some cases for performance reasons. Take the following example. I have a few hundred thousand tuples that will become new rows in 'mytable'. I want to issue a

[sqlalchemy] Re: parent/child relationship: what am I doing wrong?

2009-02-01 Thread Kevin Dangoor
Thanks for that link! It was late last night when I was looking at this and, embarrassingly enough, I hadn't gone to that particular section of the doc. Kevin On Sun, Feb 1, 2009 at 10:22 AM, Nebur wrote: > > Kevin, > did you already look at > http://www.sqlalchemy.org/doc

[sqlalchemy] Re: parent/child relationship: what am I doing wrong?

2009-02-01 Thread Kevin Dangoor
On Sun, Feb 1, 2009 at 10:17 AM, Eric Ongerth wrote: > > Kevin, the default behavior is for relations to be represented by > lists. If what you want is a tree structure where a directory can > only have a single parent, you would use backref=backref("parentdir", > use

[sqlalchemy] parent/child relationship: what am I doing wrong?

2009-02-01 Thread Kevin Dangoor
on a newly created Directory instance, both subdirs and parentdir are lists when I would expect parentdir to just be null or a Directory. This is using SQLAlchemy 0.5.2. I do hope there's something obvious that I missed... Thanks, Kevin --

[sqlalchemy] Re: MySQL String with no length broken as of r4705

2008-09-17 Thread Kevin Dangoor
t had just worked for me in the past. BTW, I should note that I'm just going to properly declare using UnicodeText and be done with it, but the behavior of mysql.py in this regard is suspect since it generates an expression that is not valid for CAST or table creation. Kevin --~--~-~--~--

[sqlalchemy] Re: MySQL String with no length broken as of r4705

2008-09-17 Thread Kevin Dangoor
t a TEXT column, possibly with a warning. Thanks for the quick response! Kevin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups

[sqlalchemy] MySQL String with no length broken as of r4705

2008-09-17 Thread Kevin Dangoor
AR without a length, and from what I see in the MySQL docs, this is the case all the way through MySQL 6. I have SQLAlchemy generate my tables and I also have an sqlalchemy- migrate migration in place to create a new table, which is how I spotted this. Am I missing something, or is this a bug? Tha

[sqlalchemy] Re: VIEW names?

2008-01-26 Thread Kevin Cole
On Jan 25, 2008 8:39 PM, Barry Hart <[EMAIL PROTECTED]> wrote: > > > >SA to be (i.e. would View act read-only, etc.. though I guess VIEWs > >aren't necessarily purely read-only in some cases ?). > > Right. For example, I think SQL Server views are updateable to some extent > (depending on whether

[sqlalchemy] Re: Flush error during session.merge()

2007-10-24 Thread Kevin Schmidt
Setting the instance key works fine. Thanks! Bye, Kevin Michael Bayer wrote: > > On Oct 24, 2007, at 12:17 PM, Kevin Schmidt wrote: > >> Hello all, >> >> I have a problem using session.merge() in version 0.3.10. I'm >> trying to merge an >>

[sqlalchemy] Flush error during session.merge()

2007-10-24 Thread Kevin Schmidt
us is an instance of class Census created by the SOAP library (ZSI), which should be the same as restoring an object via pickle. Am I doing something wrong? Do I have to use 0.4 for this to work? Help would be appreciated. Thanks, Kevin --~--~-~--~~~---~--~---

[sqlalchemy] Re: Problem with clear_mapper

2007-04-27 Thread Kevin Schmidt
? >> > > if you are creating all kinds of select() objects from which you want > to load instances, simply feed those into query.select() and the > appropriate instances will be returned (or use query.instances() > with the result of execute()). Thanks, that worked

[sqlalchemy] Re: Problem with clear_mapper

2007-04-26 Thread Kevin Schmidt
ot;) But that would mean I would define a new non_primary mapper every time, wouldn't it? Is this really a good idea for a server software? Is there maybe a way to update the used table without redefining the mapper? Bye, Kevin --~--~-~--~~~---~--~~ You received th

[sqlalchemy] Re: Problem with clear_mapper

2007-04-26 Thread Kevin Schmidt
r_mappers() because I use mod_python and my mappers are defined during init. Is there any other way I can get this select mapped to my object? Bye, Kevin Michael Bayer wrote: > > On Apr 25, 2007, at 6:06 PM, Kevin Schmidt wrote: > >> >> clear_mapper(customMapper)

[sqlalchemy] Problem with clear_mapper

2007-04-25 Thread Kevin Schmidt
lt = self.session.query(customMapper).select() clear_mapper(customMapper) Running that I get: Processing Failure c /usr/lib/python2.5/site-packages/sqlalchemy/orm/__init__.py:110:clear_mapper] What am I doing wrong here? Any help would be appreciated. Thanks, Kevin --~--~---

[sqlalchemy] Re: Object-oriented engine?

2007-03-22 Thread Kevin Dangoor
valid thought? Versant doesn't support SQL, most of its > calls are graph navigation. getchild(), getparent(), getattr() etc... > > Is this worth pursuing, and has anyone tried it? > > Thanks > > > > -- Kevin Dangoor TurboGears email: [EMAIL PROTE

[sqlalchemy] Re: python ORM

2006-12-11 Thread Kevin Dangoor
s > very hard to integrate plain SQL/result set logic with it since its > only an ORM. the only compelling features it has over SA are "extra > lazy loading" and a second-level cache, which while ive used neither, > could be implemented for SA someday. Sounds like y

[sqlalchemy] Re: python ORM

2006-12-11 Thread Kevin Dangoor
On 12/9/06, flyingfrog <[EMAIL PROTECTED]> wrote: > SQLAlchemy lets you define separately DB code and python classes, but > then you hve a real duplication. And to use database functionalities > you always need to access session objects or connections, making > sql-like queries. And i don't want t

[sqlalchemy] Re: SQLAlchemy at pycon 07

2006-12-01 Thread Kevin Dangoor
o meet you there! Kevin --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to [EMAIL P

  1   2   >