Hi I'm trying to use a database view in my model, but I get errors about a 
primary key since there is none. I want to use a view to make it easier to 
give the user form where they can assign a project_role to a project_role. 
I can do it using the primary key ID's from my database, but it's not very 
meaningful to a user to have to enter ID's instead of names. 

Here's the code I'm trying to use to define my view in the model:
class ProjectRoleView(DeclarativeBase):
    __tablename__ = 'project_to_role_names'

    __table_args__ = {}
    
    #column definitions
    project_name = Column(u'project_name', VARCHAR(45))
    role_name = Column(u'role_name', VARCHAR(45))

Or would it be better to query the DB and do the joins and stuff in python 
instead of in mysql?

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to