Hello friends, I need some help about Elixir and the ManyToMany relations. 
Well, let me explain you, for some weeks I had read examples like this:


from elixir import *

metadata.bind = "mysql://root:pa...@localhost/DB"
metadata.bind.echo = True

class Movie(Entity):
        title = Field(Unicode(30), primary_key=True)
        year = Field(Integer, primary_key=True)
        description = Field(UnicodeText)
        releasedate = Field(DateTime)

        director = ManyToOne('Director')
        genres = ManyToMany('Genre')
        actors = ManyToMany('Actor')#, tablename='movie_casting')

        def __repr__(self):
            return '<Movie "%s" (%d)>' % (self.title, self.year)

class Person(Entity):
        using_options(inheritance='multi')

        name = Field(Unicode(60))

        def __repr__(self):
            return '<Person "%s">' % self.name

class Actor(Person):
        using_options(inheritance='multi')

        movies = ManyToMany('Movie')#, tablename='movie_casting')

        def __repr__(self):
            return '<Actor "%s">' % self.name

class Director(Person):
        using_options(inheritance='multi')

        movies = OneToMany('Movie')

        def __repr__(self):
            return '<Director "%s">' % self.name

class Genre(Entity):
        name = Field(Unicode(15), primary_key=True)

        movies = ManyToMany('Movie')

        def __repr__(self):
            return '<Genre "%s">' % self.name

setup_all(True)


...but I always get the same error:

Traceback (most recent call last):
 
    setup_all(True)

    setup_entities(entities)
 
    method()
 
    self.call_builders('create_tables')
 
    getattr(builder, what)()
  
    if self.inverse.secondary_table:
  
    raise TypeError("Boolean value of this clause is not defined")
TypeError: Boolean value of this clause is not defined


... I'm working in Ubuntu 9.10 and I don't know how to solve this, please I 
need some help.
Thanks a lot.

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