title: Web2Py - Create table from user input
body: <p>I'm trying to create a table in a database in web2py. I'm new to this and trying to get a hold of the MVC structure and how to call in between.
  What I have done is in /modles/db.py I created a DB:</p>
  
  <pre><code>TestDB = DAL("sqlite://storage.sqlite")
  </code></pre>
  
  <p>Then in my /controllers/default.py I have:</p>
  
  <pre><code>def index():
      form = FORM(INPUT(_name='name', requires=IS_NOT_EMPTY()),
                INPUT(_type='submit'))
  
      if form.process().accepted:
          TestDB().define_table(form.vars.name, Field('testField', unique=True))
          return dict(form=form)
  
      return dict(form=form)
  </code></pre>
  
  <p>But this isn't working. Could somebody help me with understanding how to achieve this?</p>
  
  <p>Thank you.</p>