[sqlalchemy] Splitting concatenated fields into separate values

2011-10-04 Thread Kirk Strauser
I posted a recipe for splitting multiple fields (by byte range) out of single table columns at https://gist.github.com/1263055 . I have to interact with some legacy tables that aren't remotely closed to being 1NF. This lets me treat byte ranges without those columns as separate columns so I

Re: [sqlalchemy] Validation of new objects before committing

2011-09-28 Thread Kirk Strauser
On Sep 28, 2011, at 9:45 AM, Michael Bayer wrote: Also, there are type-based validations, fine, string, numeric, integer, dates, including length of strings. If someone throws on postgresql.INET, not really, unless the contract of TypeEngine objects is extended such that they *all* get

[sqlalchemy] Validation of new objects before committing

2011-09-27 Thread Kirk Strauser
Does SA natively support (or is there a module on PyPI that supports) client-side validation of SQLAlchemy objects? For example, I have this declarative class: class ImportedPayment(Base): __tablename__ = 'importedpayment' __table_args = {'schema': 'public'}

[sqlalchemy] Show SQL that would be executed to create a table - but don't do it?

2010-04-16 Thread Kirk Strauser
Given a largish file with a lot of table definitions in it, and SQLAlchemy 0.5.7, how can I see what SQL would be generated to create one specific table on a PostgreSQL database without actually attempting to create the table? -- Kirk Strauser -- You received this message because you

[sqlalchemy] Comparator factory generator for the substr() of columns

2009-09-17 Thread Kirk Strauser
in the general case. For example, I might've wanted something like: @comparable_using(substrcomparatormaker(typeofinv, 0, 3)) @property def shiptype(self): The shipment's type return {'FOO': 'Foo invoice', 'BAR': 'Bar invoice'}[self.typeofinv[:3]] -- Kirk Strauser

[sqlalchemy] Re: Fetching wrong values from a query involving composite primary keys

2009-07-31 Thread Kirk Strauser
(Customer.xrscustid==BillingInfo.xrscustid ))) Michael, a million thanks. Seriously. That did exactly what I needed, and should handle a bunch of similar issues with other legacy tables. I appreciate it! -- Kirk Strauser --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Re: Fetching wrong values from a query involving composite primary keys

2009-07-31 Thread Kirk Strauser
On Friday 31 July 2009 08:30:52 am Kirk Strauser wrote: On Thursday 30 July 2009 04:26:20 pm Michael Bayer wrote: you have to get the select() syntax right: BillingInfo = relation('BillingInfo', primaryjoin=and_(Invoice.pay2addrid==BillingInfo.pay2addrid,Invoice.cust om er

[sqlalchemy] Re: Fetching wrong values from a query involving composite primary keys

2009-07-31 Thread Kirk Strauser
' has no property '_deannotate' I think I'm going to put this on pause and take another look after I get back from vacation and my neurotransmitters are replenished. :-) -- Kirk Strauser --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: Fetching wrong values from a query involving composite primary keys

2009-07-31 Thread Kirk Strauser
saved screenfuls of SQL by converting to SA. -- Kirk Strauser --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: Fetching wrong values from a query involving composite primary keys

2009-07-30 Thread Kirk Strauser
and Integer references to the Customer table. This whole mess is based on data that are copied from Visual FoxPro tables on an hourly basis, and all new code is written to query PostgreSQL instead of VFP. -- Kirk Strauser --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: Fetching wrong values from a query involving composite primary keys

2009-07-30 Thread Kirk Strauser
/dist-packages/sqlalchemy/sql/expression.py, line 3239, in __init__ [_literal_as_column(c) for c in columns] TypeError: 'Column' object is not iterable Any idea where I might start digging into that? -- Kirk Strauser --~--~-~--~~~---~--~~ You received

[sqlalchemy] Merging output of several queries?

2008-05-21 Thread Kirk Strauser
? If not, is there an idiomatic approach for this? Thanks! -- Kirk Strauser --~--~-~--~~~---~--~~ 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

[sqlalchemy] Best way to handle in()

2007-08-28 Thread Kirk Strauser
enforcing main.childid=child.childid. Is there another way I should be approaching this? -- Kirk Strauser signature.asc Description: This is a digitally signed message part.

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Kirk Strauser
, 'literal': 'BILLGSCB', 'rdy2bill_invid': 1000346504, 'substr_1': 4} The killer part is the (substring(rdy2bill.xmlvars, %(substring)s) AS groupcode = in the WHERE clause. PostgreSQL apparently doesn't want that predicate to be named. Can that be disabled? -- Kirk Strauser

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Kirk Strauser
to be called once instead of twice). Fair enough. But then, is there something else I can do to get it to emit PostgreSQL-compatible SQL? -- Kirk Strauser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Kirk Strauser
On May 3, 2007, at 5:31 PM, Michael Bayer wrote: no wait, scratch my last email for a bit. try rev 2601. Perfect! That was exactly what it needed. I have to say that after using SQLAlchemy for about a week, I'm really excited about this. -- Kirk Strauser

[sqlalchemy] Queries on computed properties

2007-05-02 Thread Kirk Strauser
* from invoice where substr(invnum,1,4) = 'FOOI'; I've tried to RTFM, but I'm really a beginner with it and don't even know what to search for yet. -- Kirk Strauser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups