Skip to content

Book update TODO-List #366

@BuhtigithuB

Description

@BuhtigithuB
  • 1) describe {{=ASSIGNJS(js_var = python_var)}}

  • 2) new syntax to store .table files in DB itself instead of in the filesystem (works with any DB)

    from gluon import DAL, Field

    from gluon.dal import InDBMigrator

    db = DAL(uri, adapter_args=dict(migrator=InDBMigrator))
  • 3) new syntax to connect to MySQL and Potgresql on GAE

Follow instructions https://cloud.google.com/appengine/docs/flexible/python/using-cloud-sql then use DAL//web2py URI:

"google:MySQLdb://username:password@/dbname?unix_socket=/cloudsql/projectname:dbzone:dbinstancename"

"google:psycopg2://username:password@/dbname?unix_socket=/cloudsql/projectname:dbzone:dbinstancename"

In this case the adapter_args=dict(migrator=InDBMigrator)) is the default behavior.

  • 4) If you need to select lots of data and you do not want web2py to parse it into object but get the raw data as returned by the DB as a list of tuples:
rows = db(query).select(processor=lambda *a,**b: a[0])
  • 5. the ANY_OF validator also needs to be documented

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions