McA wrote:
> Hi all,
>
> I'm intersted in using sqlalchemy and started to read the manuals.
> I didn't find a hint for my question, so I'm asking here. I hope it's
> not too annoying.
>
> Most code examples in the documentation use something like this
>   
>>> >from sqlalchemy.XXXX import YYYY
>>>       
>
>   
I am just experimenting with sqlalchemy, but I am pretty sure to start 
using it soon, I wondered about this too, to me it was confusing to look 
at code and not easily able to see where things come from.

Having seen the wxPython project move to use the namespace as of 2.6 
(with I think two transition releases), I have done all the tests so far 
doing the following type of import and corresponding code.  This has not 
caused any problems so far and to while a little bit more typing makes 
the code more readable, especially for newbies.

But I wonder why this is not done by everyone, i.e. what are the reasons 
not to do it this way?

import sqlalchemy as sa
import sqlalchemy.orm as sao

metadata = sa.MetaData()

cbbottle_table = sa.Table( u'cbbottle', metadata,
            sa.Column( u'cbbottleid', sa.Integer(), 
sa.Sequence('gen_cbbottle_cbbottleid'),
            primary_key= True, nullable= False),
            sa.Column( u'maturityfirst', sa.Integer()),
            sa.Column( u'maturitybest', sa.Integer()),
            sa.Column( u'maturitypast', sa.Integer()),
...
        sa.Column( u'fk_cbvintageid', sa.Integer(), 
sa.ForeignKey(u'cbvintage.cbvintageid')),
)

Werner
> My question is: Is this the good/proper way to import the sqlalchemy
> stuff.
> I'm concerned about polluting the current namespace. I could assume
> that
> class names like 'Table' are too common to reserve them for the
> sqlalchemy
> classes.
>
> What would you recommend? How are the gurus out there using
> sqlalchemy?
>
> Thanks in advance.
>
> Best regards
> Andreas Mock
>
>
> >
>
>
>   


--~--~---------~--~----~------------~-------~--~----~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to