[Grok-dev] adaption problem

Toni Mueller support at oeko.net
Wed Aug 20 08:23:39 EDT 2008



Hi,

I'm working on this project:

http://on-ngo-members.alioth.debian.org/ (fetch with bzr)

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. 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.

Although I have a constructor that takes that integer, I get a

	TypeError ('Could not adapt', 1, interface-spec)

That's probably because an interface cannot be instantiated.

I'm currently out of my wits as to how to access these other classes
(the member-user example is only one out of several), while keeping the
model tied as closely as possible to the relational database to ensure
referential integrity?

TIA!

Kind regards,
--Toni++


More information about the Grok-dev mailing list