On Wednesday, December 28, 2016 at 6:10:27 PM UTC-8, Nabil Ontour wrote:
>
> Hello,
>
> I can't access my web2py page anymore, as it is showing the following
> error:
>
> <type 'exceptions.ValueError'> month must be in 1..12
>
> Variables
>
> datetime.date <type 'datetime.date'>
> val '2016-14-12'
> global datetime <module 'datetime' from '/usr/lib/python2.7/lib-dynload/
> datetime.x86_64-linux-gnu.so'>
> builtinint <type 'int'>
> val.split <built-in method split of str object>
> builtinmap <built-in function map>
>
> I am using SQLite.
>
> I can't access the database from the admin frontend either, as a query to
> the database returns the same error.
>
> I am not sure how that error arose, it might be that when you pick the
> calendar date from the pop up calendar, there is the possibility for a user
> to adjust the date "by hand" and change a 12 to a 14 for example, isn't
> that a bug then as it should be checked before entering that the date is
> valid?
>
> How can I fix this, right now, the whole page is down because of that.
> Thank you.
>
use the console command sqlite3 to open the database, and to delete or
correct the entry?
cd [mypath]/web2py/applications/myapp
sqlite3 databases/storage.sqlite
select * from mytable where mydate='2016-14-12' ;
delete from mytable where mydate='2016-14-12' ;
.quit
This error suggests that there is a disagreement between your validators
during data entry and the format specified for the table. ("2016-14-12" is
*possibly* a valid representation of December 14, 2016 in *some*
localization, but I don't recognize it.)
Can you show us your table definition and how the date is entered? You
mentioned a date picker; are you using it as a widget in a form?
/dps
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.