[Grok-dev] adaption problem
faassen at startifact.com
Thu Aug 21 09:19:40 EDT 2008
I'm trying to understand your description:
> Part of the project is having a list of members and a list of users.
> A member should have at most one user account which specifies things
> like username and password for the given member. For reasons outside of
> this discussion, these are in a separate table/class.
> In any case... when I'm viewing the list of members, I'd like to add a
> user account for a given member.
So you have a button that you can click to get a form to add a new user
account or something like that?
> At this point, I have the id of the
> member in question as a foreign key into the other table, but don't
> seem to be able to actually grab it because I can't import from the
> module where the model is defined, but only from the corresponding
> interface, which I'm using for the GUI.
This is where you lost me. :)
You have the id of the member in question. What is "the other table"
here? The users table? What are you trying to grab? What model is
defined? What do you mean with 'importing'?
Unfortunately the version of bzr on my system is too old to access your
code. Apart from that it should be possible to rephrase your underlying
problem a bit better.
What I would do is.. I go to some member's page. Now I want to create a
user account, so I press some button. There's a form (or there's already
enough information) to create a new User object (which is a mapped
object by SQLAlchemy?). The User object will have a foreign key to the
Member object, so you can do something like myuser.member = themember
I'm not sure how adaptation is involved here at all yet.
More information about the Grok-dev