jeudi 5 mai 2016

unable to insert new record using web2py sample application

I am new to web2py, i created a simple application followed by http://ift.tt/QfrEEE

using this i can get the front end form page and i can enter the details and submit those and check in the appadmin page db.registration table those are not shown, below is my code

default.py controller:

def form_a():
form = SQLFORM(db.registration)
return dict(form=form)

db.py model:

db = DAL('sqlite://storage.sqlite')
db.define_table('registration',
Field('firstname', requires=IS_NOT_EMPTY()),
Field('lastname', requires=IS_NOT_EMPTY()),
Field('gender', requires=IS_IN_SET(['Male', 'Female'])),
Field('username', requires=IS_NOT_EMPTY()),
Field('password', 'password'),
Field('about_you', 'text'),
Field('image', 'upload'))

default/form_a.html view:

<h5> User Registration Form </h5>
<br  />

<br  />

Aucun commentaire:

Enregistrer un commentaire