Answered step by step
Verified Expert Solution
Link Copied!

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 = AppConfig(reload=True)
if not request.env,web2py_runtime_gae:
# if NOT running on Google App Engine use SQLite or other DB
db = DAL("mysql://root: rootalocalhost/test?set_encoding=utf8mb4",
migrate_enabled=False)
else:
#??x
# connect to Google BigTable (optional 'google:datastore://namespace')
#
db= DAL('google:datastore +ndb')
# store sessions and tickets there
#
session. connect ( request, response, db=db)
#
# or store session in Memcache, Redis, etc.
# from gluon, contrib. fiemdb import MEMDB
# from google.appengine.api. memcache import client
# session.connect (request, response, db= MEMDB(Client ()))
#
db.define_table('authors',
Field('id', 'integer'),
Field('name', requires=IS_NOT_EMPTY()),
Field('bio', 'text'),
Field('email', requires=IS_EMAIL()),
db. define_table('books',
Field'('id', 'integer'),
Field('titie', requires=IS_NOT_EMPTY()),
Field('author', 'reference authors'),
'requires=IS_INT_IN_RANGE (1000,3000),
What would happeb if you tried to insert a book with no author?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

What is your greatest strength?

Answered: 1 week ago