title: Needs help on python web application with many to many relationship
body: <p>I am trying to make a web application in which there are 2 models user and company. A user can access any number of companies. many to many relationship between user and company. there is one autogenerated number which is used for application purpose. this autonumber is based on company. My concept in mind is that when a user login to the application there should be a list of companies that he has access. he select the company which ever he wants and proceed to application. this company should be the active company for that user. based this active company the autonumber generated. for eg : if company A selected then A0001.
  i am using flask framework
  Please advice how to achive this.</p>