Answered step by step
Verified Expert Solution
Question
1 Approved Answer
from gluon.contrib,appconfig import AppConfig fram aluan.tonls import Auth configuration = AppConfig ( reload = True ) if not request.env,web 2 py _ runtime _ gae:
from gluon.contrib,appconfig import AppConfig
fram aluan.tonls import Auth
configuration AppConfigreloadTrue
if not request.env,webpyruntimegae:
# if NOT running on Google App Engine use SQLite or other DB
db DALmysql:root: rootalocalhosttestsetencodingutfmb
migrateenabledFalse
else:
#
# connect to Google BigTable optional 'google:datastore:namespace
#
DALgoogle:datastore
# store sessions and tickets there
#
session. connect request, response,
#
# or store session in Memcache, Redis, etc.
# from gluon, contrib. fiemdb import MEMDB
# from google.appengine.api. memcache import client
# session.connect request response, MEMDBClient
#
dbdefinetableauthors
Fieldid 'integer'
Fieldname requiresISNOTEMPTY
Fieldbio 'text'
Fieldemail requiresISEMAIL
db definetablebooks
Field'id 'integer'
Fieldtitie requiresISNOTEMPTY
Fieldauthor 'reference authors'
'requiresISINTINRANGE
What would happeb if you tried to insert a book with no author?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started