-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
date is None with MySQL #1086
Comments
Peewee is using |
I reported it to pymysql. I guess you are right, it should be fixed in pymysql, but it might make sense to also provide a work-around in peewee. Or at least, for now when this is not fixed, how would an easy work-around look like to use this in peewee? Basically doing |
The problem is that the |
Not at all a bug in peewee. |
Via
pwiz
on my MySQL database, I get:Then, when iterating
entry in Pub.select()
,entry.publish_date
is alwaysNone
, although all entries in the database have the date set (or at least part of it, such as year, i.e. an entry like2016-00-00
).Why is that? Maybe
formats
is wrong? How to fix this?I guess that
peewee
will usepymsql
under the hood. So I tried to do this simple thing:And then iterating
row in cur
, I will only getrow == (None,)
.So, not sure if this is a bug in peewee or in pymysql.
When casting the value beforehand to
char
, it works, i.e. I get the value as a string:So, should peewee automatically do this? How can I do that myself now as a work around?
(Also asked on StackOverflow here.)
The text was updated successfully, but these errors were encountered: