Mohsen Pahlevanzadeh <m.pahlevanza...@gmail.com> writes: > Dear all, > > When i using Session = Session(); i get the following error: > > UnboundLocalError: local variable 'Session' referenced before assignment > > > *Wher's my problem?*
The message seems reasonably clear, doesn't it? Putting aside the not recommended idiom of *redefining* a symbol in that way, you should import/define the "session maker function" from somewhere before you can use it. As said, I'd recommend using different names, to avoid confusion, for example session = SessionMaker() hth, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- 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 sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out.