jo wrote:
>  I was using heavily the column_prefix and my code is full of it, as in:
>
>  mapper(Anagrafica,
>         tbl['anagrafica'],
>         column_prefix = 'anagrafica_',
>         extension=History(),
>         properties = {
>             'comune'         : relation( Comune, primaryjoin  =
> tbl['anagrafica'].c.id_comune == tbl['comune'].c.id ),
>             'nazione'        : relation( Nazione, primaryjoin =
> tbl['anagrafica'].c.cod_cittadinanza ==
> tbl['nazione'].c.codic...
>             'comune_nascita' : relation( Comune, primaryjoin  =
> tbl['anagrafica'].c.id_comune_nascita == tbl['comune'].c.id),
>             'nazione_nascita': relation( Nazione, primaryjoin =
> tbl['anagrafica'].c.cod_nazione_nascita ==
> tbl['nazione'].c.co...
>             'professione'    : relation( Professione ),
>             'titolo_studio'  : relation( TitoloStudio ),
>         }
>      )

column_prefix remains available.  That above code is compatible with 0.6.

>
>  and again I was using
>  from sqlalchemy.ext.selectresults import SelectResults
>  and I see these things are incompatible with new releases.

the Query object *is* the "SelectResults" object, in 0.3.6 all of
SelectResults functionality was merged into it and modern Query usage is
based around the SelectResults methods of filter(), order_by(), etc.  That
you're using SelectResults makes your migration easier.

The one thing I see you're using that was removed is Class.c.  You can
restore this easily to any class:

from sqlalchemy.util import classproperty

class RestoreCMixin(object):
    @classproperty
    def c(cls):
        return class_mapper(cls).mapped_table.c


class MyClass(MySuperClass, RestoreCMixin):
    ...






>
>                    take a look:  Bolletta = Table('bolletta',
> database.metadata,     Column('id',   Integer,
> nullable=False, primary_key=True),     Column('data',
> Date)     )   postgres session
>                      | oracle session
> ---------------------------------------------------------------|---------------------------------------------------------------
> In [1]: from sqlalchemy import select, func
>        | In [1]: from sqlalchemy import select, func
>
>     | In [2]:
> select([Bolletta.c.data]).execute().scalar()
> | In [2]: select([Bolletta.c.data]).execute().scalar()
> SELECT bolletta.data FROM bolletta
>        | SELECT bolletta.data FROM bolletta
>                                                    |
> Out[2]: datetime.date(2007, 12, 31)
>        | Out[2]: datetime.date(2010, 4, 7)
>                                                   | In
> [3]:
> select([func.max(Bolletta.c.data)]).execute().scalar()
> | In [3]:
> select([func.max(Bolletta.c.data)]).execute().scalar()
> SELECT max(bolletta.data) FROM bolletta
>        | SELECT max(bolletta.data) FROM bolletta
>
> | Out[3]: datetime.date(2010, 4, 7)
>          | Out[3]: *datetime.datetime(*2010, 4, 7, 0,
> 0),)
> ---------------------------------------------------------------|---------------------------------------------------------------
>   j  -- You received this message because you are
> subscribed to the Google Groups "sqlalchemy" group. To
> post to this group, send email to
> [email protected]. 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.
>
>  --  Jose Soares Sferacarta Net  Via Bazzanese 69 40033 Casalecchio di
> Reno Bologna - Italy Ph  +39051591054 fax +390516131537
> web:www.sferacarta.com  Le informazioni contenute nella presente mail ed
> in ogni eventuale file allegato sono riservate e, comunque, destinate
> esclusivamente alla persona o ente sopraindicati, ai sensi del decreto
> legislativo 30 giugno 2003, n. 196. La diffusione, distribuzione e/o
> copiatura della mail trasmessa, da parte di qualsiasi soggetto diverso
> dal destinatario, sono vietate. La correttezza, l’integrità
> e la sicurezza della presente mail non possono essere garantite. Se avete
> ricevuto questa mail per errore, Vi preghiamo di contattarci
> immediatamente e di eliminarla. Grazie.  This communication is intended
> only for use by the addressee, pursuant to legislative decree 30 June
> 2003, n. 196. It may contain confidential or privileged information. You
> should not copy or use it to disclose its contents to any other person.
> Transmission cannot be guaranteed to be error-free, complete and secure.
> If you are not the intended recipient and receive this communication
> unintentionally, please inform us immediately and then delete this
> message from your system. Thank you.
>   --
>  You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
>  To post to this group, send email to [email protected].
>  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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
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