On 12 mai, 19:16, Michael Bayer <[EMAIL PROTECTED]> wrote:
> lets all repeat the mantra...."association tables with any columns
> beyond the two foreign keys use the association object pattern".  I
> guess its a little too wordy to be catchy.   Documented 
> athttp://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_relatio...
>   .
>
> On May 12, 2008, at 10:45 AM, [EMAIL PROTECTED] wrote:

Thanks for answering and for your great work, Michael.
Sorry to ask stupid questions but I am learning...

You remind me that "association tables with any columns  beyond the
two foreign keys use the association object pattern"
I saw that.
I thought that is what I did in the answerMapper or the askMapper and
the questionMapper which link the tables users and questions).

Isn't it what I have done ?
No ?
If not, could you please tell me what is wrong in my model ?
May be the backref in the questionMapper should not be 'questions' ?
(See: # ManyToMany AnswerAssociation between questions and users
                    'users': relation(AnswerAss,
backref='questions') )

What I can't manage to do corresponds to the Mapper configuration
tutorial (Association object):
"# create parent, append a child via association
p = Parent()
a = Association()
a.child = Child()
p.children.append(a)"

I thought I could do:
q = Question(question = 'blabla')
a = askAss()
a.users = User(user_name = 'Michael')
q.users.append(a)
Python forwards this error: "AttributeError: type object 'AskAss' has
no attribute 'questions' ".
I am  a bit lost ...

Thanks again for any help
Dominique
--~--~---------~--~----~------------~-------~--~----~
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