API

□未翻訳

□翻訳中

□翻訳完了(細田謙二)

■レビュー(中垣健志)

API

models、controllers、viewsは、次のオブジェクトがすでにインポートされている環境で実行されます:

Models, controllers, and views are executed in an environment where the following objects are already imported for us:

グローバルオブジェクト:

Global Objects:

ナビゲーション:

Navigation:

国際化対応:

Internationalization:

1.

ヘルパー:

Helpers:

バリデータ:

Validators:

データベース:

Database:

下位互換性のために、SQLDB=DALとSQLField=Fieldとなっています。新しい構文であるDALとFieldを、古い構文の代わって使うことを推奨します。

For backward compatibility SQLDB=DAL and SQLField=Field. We encourage you to use the new syntax DAL and Field, instead of the old syntax.

他のオブジェクトとモジュールは同じライブラリで定義されます。しかし、そこまで頻繁に利用されるわけではないので、自動的にはインポートされません。

Other objects and modules are defined in the libraries, but they are not automatically imported since they are not used as often.

web2pyの実行環境におけるコアとなるAPIの構成要素は、後述する、request、response、session、cache、URL、HTTP、redirect、Tです。

The core API entities in the web2py execution environment are request, response, session,cache, URL, HTTP, redirect and T and are discussed below.

Auth、Crud、Serviceなどのいくつかのオブジェクトや関数は、”gluon/tools.py"で定義されています。それらは、必要な時にimportする必要があります:

A few objects and functions, including Auth, Crud and Service, are defined in "gluon/tools.py" and they need to be imported as necessary:

1.

from gluon.tools import Auth, Crud, Service