Hi all!

I'm quite new to sqlobject, so forgive me if I'm raising a issue that 
has already been discussed (as excuse I present only a technical issue: 
sourceforge is not cooperating when trying to search the list archives).

When trying to create a Many-to-Many relationship between two classes I 
came across the following bug (I presume): when checking for the join 
tables that need to be created the following lines are run:

sqlobject/main.py:
1469            if join.soClass.__name__ > join.otherClass.__name__:
1470                continue
1471            joins.append(join)

What this lines seam to do is stop any Many-to-Many relations where the 
first class as a "lower" name than the second on.

Is this intended? If so why?

Example snipet:

##############################################################################
class Capability (sqlobject.SQLObject):
    """
    A Hardware capability (or profile). Groups virtual machines.
    """
    name = sqlobject.StringCol ()
    description = sqlobject.StringCol ()
    vm = sqlobject.RelatedJoin ('VirtualMachine')
    targets = sqlobject.RelatedJoin ('Target')

class Target (sqlobject.SQLObject):
    """
    A physical host, capable of running one or more of the defined 
capabilities. 
    """
    name = sqlobject.StringCol ()
    IP = sqlobject.StringCol ()
    capabilities = sqlobject.RelatedJoin ('Capability')
##############################################################################


The table target_capability is not created. I believe it should be but 
the check in main.py:1469 stop it from happening.

Thanks in advance for your time,
Jose Miguel Pereira Tavares



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to