Kashif wrote:
>
> Hi,
>  I have tried all kinds of tutorials, but I cant get two simple tables
> mapped.

pretty much this exact example is present in *the* tutorial which is the
ORM tutorial at http://www.sqlalchemy.org/docs/ .



>
> Here are the tables:
>
> class User(object):
>     def __init__(self,username,password):
>          self.username = username
>          self.password = password
>
>
> class Email(object):
>     def __init__(self, address, user):
>          self.address = address
>          self.user = user
>
>
> All I wish to accomplish is the following:
>
> tom_user  = User("tom","passy")
> tom_email = Email("t...@someemail.com", tom_user)
> session.add(tom_user)
> session.add(tom_email)
> session.commit()
>
> But this doesnt work, can someone flesh out the tables and the mapping
> for me so I know what I am doing wrong.
>
> Thanks
> Kashif
>
> >
>


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

Reply via email to