Hi to all,
and thanks for the great work with this great tool!
Probably i'm approaching the problem in the wrong way, but i have 2
entity, Contest and Company.
I nedd to invite one or more company to one contest, for every contest
i only need to know how many company and which have been invited. I'm
using declarative_base so these are my 2 classes:

Base = declarative_base()
class Contest(Base):
        __tablename__ = 'contests'
        id = Column(Integer, primary_key=True)
        name = Column(Unicode(20))
        def __init__(self, name):
                self.name = name

class Company(Base):
        __tablename__ = 'companies'
        id = Column(Integer, primary_key=True)
        name = Column(Unicode(20))
        def __init__(self, name):
                self.name= name

class Invite(Base):
        __tablename__ = 'invites'
        id = Column(Integer, primary_key=True)
        contest_id = Column(Integer, ForeignKey('contests.id'))
        company_id = Column(Integer, ForeignKey('companies.id'))

How should i design the Invite table? should i treat it as a many 2
many relation?
Any help appreciated
Thanks Fabrizio

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en.

Reply via email to