Hi,

Well, I figured a fix that gets me going. I've got a feeling it's not
complete though, for example, the same problem probably exists in
HABTM. Patch is below.

There was a simple test case in my earlier mail. I can look at
incorporating these two issues into the unit tests. Not used nose
before, but I guess it's not too hard. Any preference on what files
you'd like me to add the tests to?

Paul


Index: elixir/relationships.py
===================================================================
--- elixir/relationships.py     (revision 183)
+++ elixir/relationships.py     (working copy)
@@ -260,6 +260,9 @@
                 # the relation and the backref
                 kwargs.pop('secondary', None)

+                # the name becomes they key; avoid duplicate
specification
+                kwargs.pop('key', None)
+
                 # define backref for use by the inverse
                 self.backref = backref(self.name, **kwargs)
                 return
@@ -421,7 +424,7 @@

                 # build the list of column "paths" the foreign key
will
                 # point to
-                target_path = "%s.%s" % (target_desc.tablename,
pk_col.name)
+                target_path = "%s.%s" % (target_desc.tablename,
pk_col.key)
                 schema = target_desc.table_options.get('schema',
None)
                 if schema is not None:
                     target_path = "%s.%s" % (schema, target_path)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to