You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I defined my own custom date_of_birth field in 2 different tables without specifying the data type. I thought by default, web2py will validate as string.
The first table had no issues. I was able to successfully set the date_of_birth as string or group of random characters anyhow I wanted. But for the second table, I spent the whole night debugging my application, thinking I made a mistake somewhere but later to realize the next day that web2py was validating the date_of_birth field as a date type rather than as string.
I also found out that, it doesnt matter if I specify a data type (string) for my date_of_birth field. It still validates as a date.
It will be a good thing if it is documented somewhere in the book about default data types.
Why is this so? is it a bug or its intentional? and are there similar names we shouldn't use as field names aside those that return unacceptable by web2py when we do use them?
The text was updated successfully, but these errors were encountered:
Please show your code. pyDAL will have no idea this is a date field without that being specified somehow, so nothing in pyDAL or web2py would force validation as a date. There must be something else going on. Also, what do you mean that it "validates as a date"? Are you talking about form validation, or do you get an error from the database?
I defined my own custom date_of_birth field in 2 different tables without specifying the data type. I thought by default, web2py will validate as string.
The first table had no issues. I was able to successfully set the date_of_birth as string or group of random characters anyhow I wanted. But for the second table, I spent the whole night debugging my application, thinking I made a mistake somewhere but later to realize the next day that web2py was validating the date_of_birth field as a date type rather than as string.
I also found out that, it doesnt matter if I specify a data type (string) for my date_of_birth field. It still validates as a date.
It will be a good thing if it is documented somewhere in the book about default data types.
Why is this so? is it a bug or its intentional? and are there similar names we shouldn't use as field names aside those that return unacceptable by web2py when we do use them?
The text was updated successfully, but these errors were encountered: