pydal | A pure Python Database Abstraction Layer | SQL Database library
kandi X-RAY | pydal Summary
kandi X-RAY | pydal Summary
pyDAL is a pure Python Database Abstraction Layer. It dynamically generates the SQL/noSQL in realtime using the specified dialect for the database backend, so that you do not have to write SQL code or learn different SQL dialects (the term SQL is used generically), and your code will be portable among different types of databases. pyDAL comes from the original web2py's DAL, with the aim of being compatible with any Python program. pyDAL doesn't require web2py and can be used in any Python context.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a table
- Close fileobj
- Open a file - like object
- Log a message to the database
- Parse query
- Wrap expression
- Create a new ExpressionExpressionExpression object
- Generate patterns for a given table
- Reconnect the connection
- Validate the image
- Validate a record
- Performs bulk update operation
- Return dictionary of db instances
- Create a query for this query
- Compute the GT
- Delete an IMAP mailbox
- Validate value
- Insert data into the table
- Yield subnets from other
- Validate a value
- Validate a password
- Import table from csv file
- Build the pipeline query
- Delete all uploaded files in a dataset
- Validate the value
- Collapse IP addresses into network addresses
pydal Key Features
pydal Examples and Code Snippets
Community Discussions
Trending Discussions on pydal
QUESTION
I believe i am following the code here: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=insert#sum-avg-min-max-and-len
The insert works fine. The max() lines gives an error: pydal.objects.Expression object at 0x0000024D079AF748
What am I doing wrong?
The model:
...ANSWER
Answered 2020-Mar-28 at 00:10You're not getting an error. Rather, you are returning two PyDAL Expression
objects (the .max()
method of a DAL Field
object returns an Expression
object). If you are then trying to include those objects in your view, they will be converted to strings, and when you convert an arbitrary Python object to a string, you get a default string representation of the object like .
Presumably what you meant to do was to query the database to find the max name (which would be the last one alphabetically) and the max id
. To get those values, you can do something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pydal
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page