Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Book update TODO-List #366

Open
2 of 5 tasks
BuhtigithuB opened this issue Aug 9, 2017 · 4 comments
Open
2 of 5 tasks

Book update TODO-List #366

BuhtigithuB opened this issue Aug 9, 2017 · 4 comments

Comments

@BuhtigithuB
Copy link
Collaborator

BuhtigithuB commented Aug 9, 2017

  • 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
@wish7code
Copy link
Contributor

@BuhtigithuB
Copy link
Collaborator Author

@wish7code, I think you point 6 has been fullfill since then :

placeholders is an optional sequence of values to be substituted in or, if supported by the DB driver, a dictionary with keys matching named placeholders in your SQL.

Can you confirm?

Thanks

@wish7code
Copy link
Contributor

@BuhtigithuB Documentation has improved indeed, I remember placeholders being not mentioned at all. Still I find below 2010 mailing list explanation much more clear than the book, especially @Richard_Galka answer back then, see

https://groups.google.com/forum/#!topic/web2py/a7p800sqdYg

Highly appreciate your efforts to make web2py documentation better!

@BuhtigithuB
Copy link
Collaborator Author

Can you extract the information and send a PR?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants