Little direction please Python MySQL
Bruno Desthuilliers
bruno.42.desthuilliers at websiteburo.invalid
Fri Nov 14 05:19:11 EST 2008
len a écrit :
> Hi all;
>
> I am looking for a little direction in moving from novice python MySQL
> to real world processing.
>
> I can connect to MySQL databases and have performed most of the
> various select, create, update, insert, etc given the examples in the
> various books and internet tutorials not to many problems.
>
> Here is my problem. I need to start doing this in the really world at
> my company converting some older cobol system and data to python
> programs and MySQL. I have gotten past packed decimal fields and
> various other little tidbits. My problem is the data files aren't
> little three of four field files but Customer File with 98 fields
> etc. I understand building dictionaries and building with zip and I
> have even seen a reference to using __setattr__ in an empty class but
> I'm having a hard time moving past the little code snippts to real
> code.
>
> As you can image the data coming from old cobol files fieldname are
> generally very large and tons of code that might start looking like;
>
> order['ordhdr_sales_amount'] += order['ordlin_sales_qty'] * order
> ['ordlin_sales_price']
>
> could start becoming quite cumbersum.
>
> I'm sure that there is someway to make all of this less verbose using
> classes and such but I need some direction.
You may want to have a look at SQLAlchemy. It will require some
additional learning, but chances are you'll waste less time than trying
to roll your own half-backed ORM-like system.
My 2 cents...
More information about the Python-list
mailing list