url
stringlengths
53
56
repository_url
stringclasses
1 value
labels_url
stringlengths
67
70
comments_url
stringlengths
62
65
events_url
stringlengths
60
63
html_url
stringlengths
41
46
id
int64
450k
1.69B
node_id
stringlengths
18
32
number
int64
1
2.72k
title
stringlengths
1
209
user
dict
labels
list
state
stringclasses
1 value
locked
bool
2 classes
assignee
null
assignees
list
milestone
null
comments
list
created_at
timestamp[s]
updated_at
timestamp[s]
closed_at
timestamp[s]
author_association
stringclasses
3 values
active_lock_reason
stringclasses
2 values
body
stringlengths
0
104k
reactions
dict
timeline_url
stringlengths
62
65
performed_via_github_app
null
state_reason
stringclasses
2 values
draft
bool
2 classes
pull_request
dict
https://api.github.com/repos/coleifer/peewee/issues/2018
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2018/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2018/comments
https://api.github.com/repos/coleifer/peewee/issues/2018/events
https://github.com/coleifer/peewee/pull/2018
495,540,074
MDExOlB1bGxSZXF1ZXN0MzE5MDY4NTcw
2,018
Update peewee.py
{ "login": "lvhaidong", "id": 12761304, "node_id": "MDQ6VXNlcjEyNzYxMzA0", "avatar_url": "https://avatars.githubusercontent.com/u/12761304?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lvhaidong", "html_url": "https://github.com/lvhaidong", "followers_url": "https://api.github.com/users/...
[]
closed
false
null
[]
null
[ "Nope. That's a mysql-only thing.", "How to set comment in the model, can be described in the database can see the details", "It is not supported by sqlite or postgres.", "I am use mysql, which field can be described in the database can see the details", "Are you averse to adding dv-specific features?", "...
2019-09-19T02:31:17
2019-09-28T13:59:11
2019-09-19T03:05:29
NONE
null
Add field comment info
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2018/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2018/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2018", "html_url": "https://github.com/coleifer/peewee/pull/2018", "diff_url": "https://github.com/coleifer/peewee/pull/2018.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2018.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/2017
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2017/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2017/comments
https://api.github.com/repos/coleifer/peewee/issues/2017/events
https://github.com/coleifer/peewee/issues/2017
495,486,548
MDU6SXNzdWU0OTU0ODY1NDg=
2,017
Unable to register or access Sqlite User Defined Functions
{ "login": "amandeep-r", "id": 39491878, "node_id": "MDQ6VXNlcjM5NDkxODc4", "avatar_url": "https://avatars.githubusercontent.com/u/39491878?v=4", "gravatar_id": "", "url": "https://api.github.com/users/amandeep-r", "html_url": "https://github.com/amandeep-r", "followers_url": "https://api.github.com/use...
[]
closed
false
null
[]
null
[ "You need to register the functions, which is not done automatically.\r\n\r\n```python\r\nfrom playhouse.sqlite_udf import median\r\n\r\ndb = SqliteDatabase(':memory:')\r\ndb.register_aggregate(median, 'median') # Will be available on all connections.\r\n```\r\n\r\nIf you want all of the functions/aggregates,\r\n\...
2019-09-18T22:36:05
2019-09-19T00:30:37
2019-09-18T23:04:53
NONE
null
Hello, I'm trying to use the median sqlite user defined function. I cloned peewee through git and ran the command, python setup.py build_ext -i , after installing it. I verified that my environment contains squlite3 as well. In a python terminal I am able to import playhouse._sqlite_udf and playhouse._sqlite_ext w...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2017/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2017/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2016
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2016/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2016/comments
https://api.github.com/repos/coleifer/peewee/issues/2016/events
https://github.com/coleifer/peewee/issues/2016
495,407,889
MDU6SXNzdWU0OTU0MDc4ODk=
2,016
New field type with custom sql conversion
{ "login": "tclarke", "id": 8740, "node_id": "MDQ6VXNlcjg3NDA=", "avatar_url": "https://avatars.githubusercontent.com/u/8740?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tclarke", "html_url": "https://github.com/tclarke", "followers_url": "https://api.github.com/users/tclarke/followers"...
[]
closed
false
null
[]
null
[ "Bro are you high? Do you english?", "my phone apparently autocorrected a bunch...nice way to build a community....", "This might help: https://github.com/coleifer/peewee/blob/master/tests/fields.py#L1134-L1167", "For those running across this, I extrapolated from the link above. The fix is:\r\n```\r\nr = Sel...
2019-09-18T19:16:36
2019-09-19T14:43:41
2019-09-18T19:37:44
NONE
null
I'm using trunk and some coffee I had running with the latest 2.x from pypi is no longer working. I'm implementing a Field for postgis point geometry. My conversation function to python used ``` q=SelectQuery(self.model_type, fn.ST_X(value).alias('x'), fn.ST_Y(value).alias('y')) r=q.first_row() return r.x, r.y ```...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2016/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2016/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2015
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2015/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2015/comments
https://api.github.com/repos/coleifer/peewee/issues/2015/events
https://github.com/coleifer/peewee/issues/2015
495,264,546
MDU6SXNzdWU0OTUyNjQ1NDY=
2,015
Peewee Decimal Field Max Digits
{ "login": "MatthewDLove", "id": 52387297, "node_id": "MDQ6VXNlcjUyMzg3Mjk3", "avatar_url": "https://avatars.githubusercontent.com/u/52387297?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MatthewDLove", "html_url": "https://github.com/MatthewDLove", "followers_url": "https://api.github.c...
[]
closed
false
null
[]
null
[ "Max digits corresponds to precision\r\nDecimal places corresponds to scale\r\n\r\nI'm not clear in your example whether you're using the \",\" as a thousands-separator or a decimal separator.\r\n\r\nIf unspecified, scale defaults to 5. So your example would be equivalent to:\r\n\r\n```\r\n\"price\" NUMERIC(15, 5) ...
2019-09-18T14:30:32
2019-09-18T16:06:19
2019-09-18T16:06:19
NONE
null
Hello, Thank you for this great ORM. I work at a crypto start-up and it's been very useful so far. We need to store values of monetary transactions, so we implemented a table using the decimal field (underlying table Postgres): class Order(CustomModel): .... price = DecimalField(max_digits=15) ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2015/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2015/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2014
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2014/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2014/comments
https://api.github.com/repos/coleifer/peewee/issues/2014/events
https://github.com/coleifer/peewee/issues/2014
494,279,056
MDU6SXNzdWU0OTQyNzkwNTY=
2,014
Union broken in MySQL due to parentheses problem
{ "login": "jakedt", "id": 2183986, "node_id": "MDQ6VXNlcjIxODM5ODY=", "avatar_url": "https://avatars.githubusercontent.com/u/2183986?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jakedt", "html_url": "https://github.com/jakedt", "followers_url": "https://api.github.com/users/jakedt/foll...
[]
closed
false
null
[]
null
[ "Yeah, this query is failing on MySQL but works OK for Sqlite or Postgres.\r\n\r\nFor sqlite, we have a rule to never put parentheses around the left- or right-hand side.\r\n\r\nFor postgres, we always do, since postgres handles it correctly.\r\n\r\nFor mysql, we have a rule to not put parentheses if the left- or r...
2019-09-16T21:10:35
2019-09-17T02:40:51
2019-09-17T00:43:26
NONE
null
I believe that https://github.com/coleifer/peewee/commit/36bd887ac07647c60dfebe610b34efabec675706 broke a weird query that we have. I believe that the outer level or parens are not being detected. Work in 3.6.4 Broken in 3.10.0 Repro case: ```python import logging from peewee import * from playhouse.db_url...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2014/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2014/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2013
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2013/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2013/comments
https://api.github.com/repos/coleifer/peewee/issues/2013/events
https://github.com/coleifer/peewee/issues/2013
493,811,566
MDU6SXNzdWU0OTM4MTE1NjY=
2,013
chalice with peewee
{ "login": "jlpl1999", "id": 47018632, "node_id": "MDQ6VXNlcjQ3MDE4NjMy", "avatar_url": "https://avatars.githubusercontent.com/u/47018632?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jlpl1999", "html_url": "https://github.com/jlpl1999", "followers_url": "https://api.github.com/users/jlp...
[]
closed
false
null
[]
null
[ "So I took a quick look. You can't really rely on state or local memory being preserved between any two requests w/a lambda function, so I'm not sure if connection pooling makes sense in that environment (though you could try it and measure).\r\n\r\nI'd just wrap the `route()` function to add a decorator that opens...
2019-09-16T01:18:55
2019-09-16T14:21:49
2019-09-16T14:21:48
NONE
null
Do you have any suggestion for chalice framework to open close connect with MySql only at https request occurred? thanks
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2013/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2013/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2012
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2012/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2012/comments
https://api.github.com/repos/coleifer/peewee/issues/2012/events
https://github.com/coleifer/peewee/issues/2012
492,495,843
MDU6SXNzdWU0OTI0OTU4NDM=
2,012
How do I install the C-extensions?
{ "login": "amjith", "id": 49260, "node_id": "MDQ6VXNlcjQ5MjYw", "avatar_url": "https://avatars.githubusercontent.com/u/49260?v=4", "gravatar_id": "", "url": "https://api.github.com/users/amjith", "html_url": "https://github.com/amjith", "followers_url": "https://api.github.com/users/amjith/followers", ...
[]
closed
false
null
[]
null
[ "I don't have sqlite3.h. I'll try to get that before trying again. ", "Yup. That was it. :man_facepalming: ", "The `setup.py` should print an error if you run `setup.py build_ext`...looks like maybe it got swallowed by `pip`? Not sure. At any rate, glad you got it sorted." ]
2019-09-11T22:25:12
2019-09-12T02:48:44
2019-09-11T22:33:34
NONE
null
The installation instruction mentioned that if Ihave cython installed then installing peewee will compile the C-extensions. But I'm not able to achieve taht result. First I installed Cython and then I pip installed peewee and tried to use the `CSqliteExtDatabase` but it is not installed. I have copied the output...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2012/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2012/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2011
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2011/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2011/comments
https://api.github.com/repos/coleifer/peewee/issues/2011/events
https://github.com/coleifer/peewee/issues/2011
492,319,726
MDU6SXNzdWU0OTIzMTk3MjY=
2,011
Question: how to export SQL which can be used in postgreSQL
{ "login": "trim21", "id": 13553903, "node_id": "MDQ6VXNlcjEzNTUzOTAz", "avatar_url": "https://avatars.githubusercontent.com/u/13553903?v=4", "gravatar_id": "", "url": "https://api.github.com/users/trim21", "html_url": "https://github.com/trim21", "followers_url": "https://api.github.com/users/trim21/fo...
[]
closed
false
null
[]
null
[ "seems that driver handle (escape) parameters itself instead of execute it as parameters in postgresql. Why doing that......", "Peewee follows the DB-API convention / interface for executing queries. The SQL query uses placeholders for values, which are then interpolated by the driver however that needs to happen...
2019-09-11T15:45:00
2019-09-11T16:57:43
2019-09-11T16:34:29
NONE
null
In using peewee to generate some SQL, but postgreSQL database use `%s` as a place holder which is not supported by postgresql server, any chance I get postgresql compatible SQL string (which use `%#` as placeholder? Is it possible now? If it's now supported now, any plan for it? Thank you very much.
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2011/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2011/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2010
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2010/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2010/comments
https://api.github.com/repos/coleifer/peewee/issues/2010/events
https://github.com/coleifer/peewee/issues/2010
492,063,711
MDU6SXNzdWU0OTIwNjM3MTE=
2,010
OperationalError on iregexp
{ "login": "kotofey-da-powah", "id": 33459842, "node_id": "MDQ6VXNlcjMzNDU5ODQy", "avatar_url": "https://avatars.githubusercontent.com/u/33459842?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kotofey-da-powah", "html_url": "https://github.com/kotofey-da-powah", "followers_url": "https://...
[]
closed
false
null
[]
null
[ "Your database (sqlite) doesn't support IREGEXP. Just use a normal regexp with case-insensitive matches/captures." ]
2019-09-11T07:25:25
2019-09-11T14:53:49
2019-09-11T14:53:49
NONE
null
Have a query that works fine: ``` groups = Group.select().where((Group.codename.regexp(q)) | (Group.study_program.regexp(q))) ``` But the 'iregexp' one is giving an sql operational error: ``` groups = Group.select().where((Group.codename.iregexp(q)) | (Group.study_program.iregexp(q))) ``` Traceback: ``` T...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2010/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2010/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2009
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2009/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2009/comments
https://api.github.com/repos/coleifer/peewee/issues/2009/events
https://github.com/coleifer/peewee/issues/2009
489,639,227
MDU6SXNzdWU0ODk2MzkyMjc=
2,009
TimestampField uses an undocumented power of 10
{ "login": "Sekenre", "id": 17621700, "node_id": "MDQ6VXNlcjE3NjIxNzAw", "avatar_url": "https://avatars.githubusercontent.com/u/17621700?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Sekenre", "html_url": "https://github.com/Sekenre", "followers_url": "https://api.github.com/users/Sekenr...
[]
closed
false
null
[]
null
[ "Originally this was expressed as 1, 10, 100, ... 1000000. I added the option to provide it as the exponent instead, but this broke the default of 1 (turning it into 10).\r\n\r\nFixed so that 0 and 1 both resolve to seconds resolution. To get 10th of a second, one needs to supply the resolution=10, but I don't thin...
2019-09-05T09:33:14
2019-09-05T16:00:36
2019-09-05T15:59:16
NONE
null
If I create a TimestampField(resolution=1) it will unexpectedly multiply the timestamps by 10. This is different from the default resolution of 1 second if the resolution is set to None. Resolution as a power (`10 ** x`) where x is in `range(7)` is undocumented and maybe a bit confusing. To resolve this in my own...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2009/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2009/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2008
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2008/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2008/comments
https://api.github.com/repos/coleifer/peewee/issues/2008/events
https://github.com/coleifer/peewee/issues/2008
489,437,436
MDU6SXNzdWU0ODk0Mzc0MzY=
2,008
DecimalField does not work correctly
{ "login": "ccodde", "id": 54917342, "node_id": "MDQ6VXNlcjU0OTE3MzQy", "avatar_url": "https://avatars.githubusercontent.com/u/54917342?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ccodde", "html_url": "https://github.com/ccodde", "followers_url": "https://api.github.com/users/ccodde/fo...
[]
closed
false
null
[]
null
[ "Sqlite only supports a couple different data-types: https://sqlite.org/datatype3.html\r\n\r\nSqlite interprets DECIMAL fields as REAL, which is a double-precision / float64. So that is why you are losing precision. Sqlite is optimizing the storage by treating the value as a numeric quantity, but it can only implem...
2019-09-04T22:40:19
2019-09-04T23:07:50
2019-09-04T23:07:50
NONE
null
When choosing a large type accuracy, the accuracy is not saved and the data is stored incorrectly. ```python from peewee import * from decimal import Decimal class Test(Model): value = DecimalField(max_digits=26, decimal_places=18) db = SqliteDatabase(':memory:') db.bind([Test]) Test.create_table() ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2008/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2008/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2007
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2007/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2007/comments
https://api.github.com/repos/coleifer/peewee/issues/2007/events
https://github.com/coleifer/peewee/issues/2007
488,931,377
MDU6SXNzdWU0ODg5MzEzNzc=
2,007
MySQL connection lost even autoconnect is enabled.
{ "login": "Nossiac", "id": 6194362, "node_id": "MDQ6VXNlcjYxOTQzNjI=", "avatar_url": "https://avatars.githubusercontent.com/u/6194362?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Nossiac", "html_url": "https://github.com/Nossiac", "followers_url": "https://api.github.com/users/Nossiac/...
[]
closed
false
null
[]
null
[ "Thanks, I haven't experimented too much with mysql-connector. There's a little helper class in `playhouse.mysql_ext`, but that's about it as most Peewee users stick with pymysql.\r\n\r\n> I changed mysql connection timeout to 10s, so it's quite easy to reproduce.\r\n\r\nYeesh, that seems extreme. What if you have ...
2019-09-04T04:19:46
2019-09-04T15:00:12
2019-09-04T15:00:12
NONE
null
Using peewee with mysql-connector. By default, a IDLE MySQL connection will timeout after 8 hours. When timeout happens, peewee runs into an exception: ``` File "/usr/local/lib/python3.6/site-packages/mysql/connector/connection.py", line 809, in cursor raise errors.OperationalError("MySQL Connection not a...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2007/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2007/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2006
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2006/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2006/comments
https://api.github.com/repos/coleifer/peewee/issues/2006/events
https://github.com/coleifer/peewee/issues/2006
488,926,033
MDU6SXNzdWU0ODg5MjYwMzM=
2,006
Chalice Python framework with Peewee
{ "login": "jlpl1999", "id": 47018632, "node_id": "MDQ6VXNlcjQ3MDE4NjMy", "avatar_url": "https://avatars.githubusercontent.com/u/47018632?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jlpl1999", "html_url": "https://github.com/jlpl1999", "followers_url": "https://api.github.com/users/jlp...
[]
closed
false
null
[]
null
[ "This is for tracking **issues**, not \"how-do-i\" questions. Please take it to stack overflow.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/contributing.html#questions" ]
2019-09-04T03:56:05
2019-09-04T12:42:02
2019-09-04T12:42:02
NONE
null
How do i do the before/after connection with mysql/aws RDS along with chalice serverless framework using PeeWee as ORM? thanks
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2006/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2006/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2005
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2005/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2005/comments
https://api.github.com/repos/coleifer/peewee/issues/2005/events
https://github.com/coleifer/peewee/issues/2005
488,495,790
MDU6SXNzdWU0ODg0OTU3OTA=
2,005
can't support 5.5.*-mariadb
{ "login": "City-Zero", "id": 19517295, "node_id": "MDQ6VXNlcjE5NTE3Mjk1", "avatar_url": "https://avatars.githubusercontent.com/u/19517295?v=4", "gravatar_id": "", "url": "https://api.github.com/users/City-Zero", "html_url": "https://github.com/City-Zero", "followers_url": "https://api.github.com/users/...
[]
closed
false
null
[]
null
[ "That's an ancient version of mariadb, first of all. Second of all, it doesn't matter because that version is so old it doesn't support any of the features that the version-check is designed to flip." ]
2019-09-03T09:33:45
2019-09-03T18:07:25
2019-09-03T18:07:25
NONE
null
https://github.com/coleifer/peewee/blob/cc02d32d05acfdfa2b4d01d99f646b56b6a3c754/peewee.py#L3813
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2005/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2005/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2004
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2004/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2004/comments
https://api.github.com/repos/coleifer/peewee/issues/2004/events
https://github.com/coleifer/peewee/issues/2004
488,356,554
MDU6SXNzdWU0ODgzNTY1NTQ=
2,004
DecimalField does not work correctly
{ "login": "twixmix", "id": 54825779, "node_id": "MDQ6VXNlcjU0ODI1Nzc5", "avatar_url": "https://avatars.githubusercontent.com/u/54825779?v=4", "gravatar_id": "", "url": "https://api.github.com/users/twixmix", "html_url": "https://github.com/twixmix", "followers_url": "https://api.github.com/users/twixmi...
[]
closed
false
null
[]
null
[]
2019-09-03T01:53:37
2019-09-04T22:40:54
2019-09-04T22:40:54
NONE
null
When choosing a large type accuracy, the accuracy is not saved and the data is stored incorrectly. ```python from peewee import * from decimal import Decimal class Test(Model): value = DecimalField(max_digits=26, decimal_places=18) db = SqliteDatabase(':memory:') db.bind([Test]) Test.create_table(...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2004/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2004/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2003
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2003/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2003/comments
https://api.github.com/repos/coleifer/peewee/issues/2003/events
https://github.com/coleifer/peewee/issues/2003
488,210,935
MDU6SXNzdWU0ODgyMTA5MzU=
2,003
Exception if sqlite database contains an incorrect type
{ "login": "huntfx", "id": 10235666, "node_id": "MDQ6VXNlcjEwMjM1NjY2", "avatar_url": "https://avatars.githubusercontent.com/u/10235666?v=4", "gravatar_id": "", "url": "https://api.github.com/users/huntfx", "html_url": "https://github.com/huntfx", "followers_url": "https://api.github.com/users/huntfx/fo...
[]
closed
false
null
[]
null
[]
2019-09-02T14:14:03
2019-09-03T00:24:12
2019-09-03T00:24:12
NONE
null
This is an issue I got in your `sqlite-web` script, but it appears to be specific to `peewee` so posting here. Due to a bug in my code, I had some text stored in an integer column. Querying with both `sqlalchemy` and [sqliteonline](https://sqliteonline.com) worked and showed the strings that were in my integer colum...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2003/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2003/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2002
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2002/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2002/comments
https://api.github.com/repos/coleifer/peewee/issues/2002/events
https://github.com/coleifer/peewee/pull/2002
487,513,377
MDExOlB1bGxSZXF1ZXN0MzEyNzYzOTg0
2,002
Fix bug with multiple model prefetches
{ "login": "rwrigley", "id": 38895052, "node_id": "MDQ6VXNlcjM4ODk1MDUy", "avatar_url": "https://avatars.githubusercontent.com/u/38895052?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rwrigley", "html_url": "https://github.com/rwrigley", "followers_url": "https://api.github.com/users/rwr...
[]
closed
false
null
[]
null
[ "Thanks" ]
2019-08-30T14:27:53
2019-08-31T13:51:23
2019-08-31T13:51:15
CONTRIBUTOR
null
I found when calling prefetch with a model multiple times but on different rel models would result in only one of the rel models getting the instances populated and all others with empty lists. This changes seems to fix the issue.
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2002/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2002/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/2002", "html_url": "https://github.com/coleifer/peewee/pull/2002", "diff_url": "https://github.com/coleifer/peewee/pull/2002.diff", "patch_url": "https://github.com/coleifer/peewee/pull/2002.patch", "merged_at": "2019-08-31T13:51:15" }
https://api.github.com/repos/coleifer/peewee/issues/2001
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2001/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2001/comments
https://api.github.com/repos/coleifer/peewee/issues/2001/events
https://github.com/coleifer/peewee/issues/2001
487,383,201
MDU6SXNzdWU0ODczODMyMDE=
2,001
The Document's issue - "Model.first()" exists, but the method had disappeared yet
{ "login": "linusic", "id": 30204682, "node_id": "MDQ6VXNlcjMwMjA0Njgy", "avatar_url": "https://avatars.githubusercontent.com/u/30204682?v=4", "gravatar_id": "", "url": "https://api.github.com/users/linusic", "html_url": "https://github.com/linusic", "followers_url": "https://api.github.com/users/linusi...
[]
closed
false
null
[]
null
[ "The Method is still there:\r\n\r\n def first(self, database, n=1):\r\n\r\nhttps://github.com/coleifer/peewee/blob/b51b230a45e71464d90607ccfdd40ccff4d2d3f8/peewee.py#L2049", "thx for u response\r\nI see, I use it incorrect ,sry!\r\n\r\nI think it use likely the \"get()\" method. \r\nso i use it by mistake...
2019-08-30T09:26:30
2019-08-31T13:28:45
2019-08-30T14:04:02
NONE
null
thanks for "peewee". I saw a small issue when I read the document . Document version: latest and look follow pic. ![image](https://user-images.githubusercontent.com/30204682/64009446-7146e200-cb4a-11e9-8802-f173503c7117.png)
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2001/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2001/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/2000
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/2000/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/2000/comments
https://api.github.com/repos/coleifer/peewee/issues/2000/events
https://github.com/coleifer/peewee/issues/2000
486,999,046
MDU6SXNzdWU0ODY5OTkwNDY=
2,000
Column casting doesn't work in 3.10.0
{ "login": "cubez", "id": 337158, "node_id": "MDQ6VXNlcjMzNzE1OA==", "avatar_url": "https://avatars.githubusercontent.com/u/337158?v=4", "gravatar_id": "", "url": "https://api.github.com/users/cubez", "html_url": "https://github.com/cubez", "followers_url": "https://api.github.com/users/cubez/followers"...
[]
closed
false
null
[]
null
[ "I can see both sides, but I do think that I will make the logic for adapting values more permissive. What changed is that an expression now looks a little bit harder to see if the right-hand-side can be converted using the conversion implied by the left-hand field. For a cast(), however, this should be more permis...
2019-08-29T14:37:56
2019-08-30T08:19:24
2019-08-29T15:10:15
NONE
null
Up until 3.9.6 I could do this: ```python TableName.select().where(TableName.some_int_field.cast("CHAR").contains("abc")) ``` The result would just be empty. But now in 3.10.0 I get this error: ```sh ValueError: invalid literal for int() with base 10: '%abc%' ``` Looking through the changelog I can't really...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/2000/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/2000/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1999
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1999/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1999/comments
https://api.github.com/repos/coleifer/peewee/issues/1999/events
https://github.com/coleifer/peewee/pull/1999
486,990,285
MDExOlB1bGxSZXF1ZXN0MzEyMzQ0NjI4
1,999
fix typo
{ "login": "rwrigley", "id": 38895052, "node_id": "MDQ6VXNlcjM4ODk1MDUy", "avatar_url": "https://avatars.githubusercontent.com/u/38895052?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rwrigley", "html_url": "https://github.com/rwrigley", "followers_url": "https://api.github.com/users/rwr...
[]
closed
false
null
[]
null
[ "Thank you, nice catch." ]
2019-08-29T14:23:19
2019-08-29T14:33:13
2019-08-29T14:33:07
CONTRIBUTOR
null
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1999/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1999/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1999", "html_url": "https://github.com/coleifer/peewee/pull/1999", "diff_url": "https://github.com/coleifer/peewee/pull/1999.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1999.patch", "merged_at": "2019-08-29T14:33:07" }
https://api.github.com/repos/coleifer/peewee/issues/1998
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1998/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1998/comments
https://api.github.com/repos/coleifer/peewee/issues/1998/events
https://github.com/coleifer/peewee/issues/1998
485,295,682
MDU6SXNzdWU0ODUyOTU2ODI=
1,998
conda-forge version of 3.10.0
{ "login": "sterlingbaldwin", "id": 6477639, "node_id": "MDQ6VXNlcjY0Nzc2Mzk=", "avatar_url": "https://avatars.githubusercontent.com/u/6477639?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sterlingbaldwin", "html_url": "https://github.com/sterlingbaldwin", "followers_url": "https://api.g...
[]
closed
false
null
[]
null
[ "get out of here with this crap, i don't have anything to do with whatever that is.", "Ah, I just assumed you were the maintainer for the conda-forge feedstock, but it looks like its someone else. Peewee has +100k installs through conda-forge https://github.com/conda-forge/peewee-feedstock", "Holy smokes! Never...
2019-08-26T15:25:29
2019-08-26T23:49:24
2019-08-26T16:28:53
NONE
null
The latest version published to conda-forge is 3.9.2. It would be nice to have 3.10.0.
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1998/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1998/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1997
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1997/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1997/comments
https://api.github.com/repos/coleifer/peewee/issues/1997/events
https://github.com/coleifer/peewee/issues/1997
484,972,835
MDU6SXNzdWU0ODQ5NzI4MzU=
1,997
Question - Is there a way not to create a base model table in the database?
{ "login": "dsmurrell", "id": 4035854, "node_id": "MDQ6VXNlcjQwMzU4NTQ=", "avatar_url": "https://avatars.githubusercontent.com/u/4035854?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dsmurrell", "html_url": "https://github.com/dsmurrell", "followers_url": "https://api.github.com/users/ds...
[]
closed
false
null
[]
null
[ "The base model *is not* created... you have to explicitly tell peewee which tables to create. It doesn't matter the inheritance chain -- each model class is just a single table.", "Thanks! \r\n\r\nI've been using peeweedbevolve for too long which creates all by default. Just found the answer here for my use case...
2019-08-25T20:32:35
2019-08-25T20:55:47
2019-08-25T20:45:21
NONE
null
I did scan the docs briefly, but nothing obvious popped out at me. I want to have the following configuration but not have the base table be created in the database as it's never used by me. Is there a way to do this? ``` class BaseModel(Model): class Meta: database = db class User(BaseModel): ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1997/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1997/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1996
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1996/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1996/comments
https://api.github.com/repos/coleifer/peewee/issues/1996/events
https://github.com/coleifer/peewee/issues/1996
484,708,444
MDU6SXNzdWU0ODQ3MDg0NDQ=
1,996
Support for Triggers and LISTEN/Notify
{ "login": "iguanaus", "id": 5752769, "node_id": "MDQ6VXNlcjU3NTI3Njk=", "avatar_url": "https://avatars.githubusercontent.com/u/5752769?v=4", "gravatar_id": "", "url": "https://api.github.com/users/iguanaus", "html_url": "https://github.com/iguanaus", "followers_url": "https://api.github.com/users/iguan...
[]
closed
false
null
[]
null
[ "There are huge differences between sqlite/mysql/postgres for writing triggers. If you need a trigger, just create it after your call to `db.create_tables(...)`:\r\n\r\n```python\r\ndb.create_tables([MyModel, ...])\r\ndb.execute_sql('create trigger ...')\r\n```\r\n\r\nFor LISTEN/NOTIFY, again, I'm not sure how Peew...
2019-08-23T20:55:22
2019-08-24T20:42:52
2019-08-24T20:42:52
NONE
null
Great work on the library, it has been very flexible and quick to work with. We are needing to notify a service whenever a table is updated. Our backend database is Postgres. Listen/Notify seems to optimally fit out needs. Ideally we need a way to trigger or notify on creation/updates, and then subscribe with pollin...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1996/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1996/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1995
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1995/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1995/comments
https://api.github.com/repos/coleifer/peewee/issues/1995/events
https://github.com/coleifer/peewee/issues/1995
483,770,343
MDU6SXNzdWU0ODM3NzAzNDM=
1,995
Mysql gone away with peewee as second database in Django
{ "login": "srugano", "id": 4678996, "node_id": "MDQ6VXNlcjQ2Nzg5OTY=", "avatar_url": "https://avatars.githubusercontent.com/u/4678996?v=4", "gravatar_id": "", "url": "https://api.github.com/users/srugano", "html_url": "https://github.com/srugano", "followers_url": "https://api.github.com/users/srugano/...
[]
closed
false
null
[]
null
[ "> The suggested method of solving this in Django is trough the usage of a middleware but this assume that in that case peewee related db is the main one, and has resulted in errors like this one:\r\n\r\nThat has nothing to do with \"solving\" your connection timing out and being closed. That middleware is simply t...
2019-08-22T04:57:02
2019-08-22T16:30:37
2019-08-22T16:30:36
NONE
null
I'm using `peewee` to access a remote *MySql* database to retrieve data that I need to display in a *Django* app. It means that `peewee` isn't really used to access the main db but just to like, define custom models: Example in `databases.py` : from django.conf import settings from playhouse.pool import ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1995/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1995/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1994
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1994/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1994/comments
https://api.github.com/repos/coleifer/peewee/issues/1994/events
https://github.com/coleifer/peewee/issues/1994
483,010,693
MDU6SXNzdWU0ODMwMTA2OTM=
1,994
db_value and model fields
{ "login": "bronte2k7", "id": 29693866, "node_id": "MDQ6VXNlcjI5NjkzODY2", "avatar_url": "https://avatars.githubusercontent.com/u/29693866?v=4", "gravatar_id": "", "url": "https://api.github.com/users/bronte2k7", "html_url": "https://github.com/bronte2k7", "followers_url": "https://api.github.com/users/...
[]
closed
false
null
[]
null
[ "No" ]
2019-08-20T18:20:26
2019-08-20T18:43:59
2019-08-20T18:43:59
NONE
null
Hi guys ```python class CustomField(CharField): def db_value(self, value): # can I access the note field? return value class User(Model): note = TextField(null=True) extend = CustomField() ``` Is it possible to access the value in the note field, from db_value?
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1994/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1994/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1993
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1993/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1993/comments
https://api.github.com/repos/coleifer/peewee/issues/1993/events
https://github.com/coleifer/peewee/issues/1993
482,034,939
MDU6SXNzdWU0ODIwMzQ5Mzk=
1,993
Improve equality check
{ "login": "clintonb", "id": 910510, "node_id": "MDQ6VXNlcjkxMDUxMA==", "avatar_url": "https://avatars.githubusercontent.com/u/910510?v=4", "gravatar_id": "", "url": "https://api.github.com/users/clintonb", "html_url": "https://github.com/clintonb", "followers_url": "https://api.github.com/users/clinton...
[]
closed
false
null
[]
null
[ "Here is a proposed implementation:\r\n\r\n```python\r\ndef __eq__(self, other: Any) -> bool:\r\n if other.__class__ != self.__class__:\r\n return False\r\n\r\n for field in self._meta.sorted_fields:\r\n if getattr(self, field.name) != getattr(other, field.name):\r\n return False\r\n\...
2019-08-18T20:40:00
2019-08-19T00:52:14
2019-08-19T00:52:14
NONE
null
The current implementation of `__eq__` on `Model` just checks if the primary keys are equal. https://github.com/coleifer/peewee/blob/f6d693366eccb8e27b0b331246358f9c7d4e54b7/peewee.py#L6364-L6368 It would be preferable to if this method compared the value of all fields. Test case: ```python from models import ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1993/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1993/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1992
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1992/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1992/comments
https://api.github.com/repos/coleifer/peewee/issues/1992/events
https://github.com/coleifer/peewee/issues/1992
481,909,115
MDU6SXNzdWU0ODE5MDkxMTU=
1,992
Peewee does not automatically reconnect to MySQL
{ "login": "Xandaros", "id": 265886, "node_id": "MDQ6VXNlcjI2NTg4Ng==", "avatar_url": "https://avatars.githubusercontent.com/u/265886?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Xandaros", "html_url": "https://github.com/Xandaros", "followers_url": "https://api.github.com/users/Xandaro...
[]
closed
false
null
[]
null
[ "Part of this is how the PyMySQL driver is implemented.\r\n\r\nHowever, Peewee doesn't automatically reconnect to databases by default. Check out `playhouse.shortcuts.ReconnectMixin` if you want automatic database reconnects.\r\n\r\n```python\r\n\r\nclass ReconnectMySQLDatabase(ReconnectMixin, MySQLDatabase):\r\n ...
2019-08-17T17:36:13
2019-08-19T18:13:12
2019-08-18T13:27:14
NONE
null
peewee does not properly handle a dropped connection to the MySQL server. In my case, I am using peewee 3.10.0 and mariadb 10.3.12. A simple program like this: ```python import peewee db = peewee.MySQLDatabase(database="test", host="127.0.0.1", user="test"...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1992/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1992/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1991
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1991/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1991/comments
https://api.github.com/repos/coleifer/peewee/issues/1991/events
https://github.com/coleifer/peewee/issues/1991
481,715,589
MDU6SXNzdWU0ODE3MTU1ODk=
1,991
Query with double outer join returns empty object instead of `None`
{ "login": "ibushong", "id": 9298422, "node_id": "MDQ6VXNlcjkyOTg0MjI=", "avatar_url": "https://avatars.githubusercontent.com/u/9298422?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ibushong", "html_url": "https://github.com/ibushong", "followers_url": "https://api.github.com/users/ibush...
[]
closed
false
null
[]
null
[ "If you don't select anything from City, Peewee will mark the intervening model (Venue) as NULL. There was a similar issue reporting the opposite condition -- namely, not to use empty models. The current logic looks at the models as nodes in a graph. In your example, Venue is in the middle, connecting Event <- Venu...
2019-08-16T17:45:37
2019-08-16T20:25:54
2019-08-16T19:25:27
NONE
null
Models: ```python class City(BaseModel): name = CharField(null=False) class Venue(BaseModel): name = CharField(null=False) city = ForeignKeyField(City, null=False) def __str__(self): return "%s (%s)" % (self.name, self.city.name) class Event(BaseModel): name = CharField(n...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1991/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1991/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1990
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1990/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1990/comments
https://api.github.com/repos/coleifer/peewee/issues/1990/events
https://github.com/coleifer/peewee/issues/1990
481,518,774
MDU6SXNzdWU0ODE1MTg3NzQ=
1,990
Set last_insert_id(`id`) on Insert ... On Duplicate Key Update in MySQL
{ "login": "malaney", "id": 517419, "node_id": "MDQ6VXNlcjUxNzQxOQ==", "avatar_url": "https://avatars.githubusercontent.com/u/517419?v=4", "gravatar_id": "", "url": "https://api.github.com/users/malaney", "html_url": "https://github.com/malaney", "followers_url": "https://api.github.com/users/malaney/fo...
[]
closed
false
null
[]
null
[ "I just answered my own question!!\r\n\r\n> .on_conflict(\r\n preserve=[Model.first_name, Model.last_name],\r\n update={Model.id: fn.last_insert_id(Model.id)}\r\n )" ]
2019-08-16T09:14:31
2019-08-16T09:43:59
2019-08-16T09:43:59
NONE
null
I'm using peewee to generate an "INSERT ... ON DUPLICATE KEY UPDATE" query in MySQL using the .insert().on_conflict() methods for a table with an auto_increment ID. Whether the query performs an INSERT or an UPDATE I'd like the query to return the ID of the most recently created row or the ID of the most recently upda...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1990/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1990/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1989
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1989/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1989/comments
https://api.github.com/repos/coleifer/peewee/issues/1989/events
https://github.com/coleifer/peewee/issues/1989
480,290,939
MDU6SXNzdWU0ODAyOTA5Mzk=
1,989
Spellfix1 SQLite Extension?
{ "login": "FaizShah", "id": 1187484, "node_id": "MDQ6VXNlcjExODc0ODQ=", "avatar_url": "https://avatars.githubusercontent.com/u/1187484?v=4", "gravatar_id": "", "url": "https://api.github.com/users/FaizShah", "html_url": "https://github.com/FaizShah", "followers_url": "https://api.github.com/users/FaizS...
[]
closed
false
null
[]
null
[ "Here's some starter code\r\n\r\n```python\r\nfrom peewee import *\r\nfrom playhouse.sqlite_ext import *\r\n\r\ndb = CSqliteExtDatabase('/tmp/spellfix.db')\r\ndb.load_extension('/path/to/spellfix1')\r\n\r\nclass WordList(VirtualModel):\r\n # See http://www.sqlite.org/spellfix1.html\r\n word = VirtualField(Tex...
2019-08-13T18:03:15
2020-07-15T21:43:38
2019-08-13T19:47:20
NONE
null
Hi all, I'm using the FTS extension for SQLite and I would like to test out Spellfix1 for FTS spelling correction in peewee. What would be the easiest/best way to add the Spellfix1 extension for SQLite in peewee? Here is some example code using it without peewee for reference: ``` # Build the extension. ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1989/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1989/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1988
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1988/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1988/comments
https://api.github.com/repos/coleifer/peewee/issues/1988/events
https://github.com/coleifer/peewee/issues/1988
479,105,079
MDU6SXNzdWU0NzkxMDUwNzk=
1,988
pwiz creates all fields as FloatField regardless of precision
{ "login": "albireox", "id": 568775, "node_id": "MDQ6VXNlcjU2ODc3NQ==", "avatar_url": "https://avatars.githubusercontent.com/u/568775?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albireox", "html_url": "https://github.com/albireox", "followers_url": "https://api.github.com/users/albireo...
[]
closed
false
null
[]
null
[ "Pushed a fix -- oid 701 appears to be double-precision, so it's up-to-date now. If your schema already exists, however, it doesn't matter because Python uses a double internally anyways. Lastly, if it's an issue, you are free to modify the fields yourself.\r\n\r\n> Alternatively, is there a way to access the Postg...
2019-08-09T18:05:56
2019-08-09T21:08:03
2019-08-09T19:18:17
NONE
null
It seems when `pwiz` creates a schema, it assigns `FloatField` to all the floating point types, regardless of their precision. Could it be possible to have it create the appropriate type of field? Alternatively, is there a way to access the Postgresql underlying type for a field without having to connect to the DB?
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1988/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1988/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1987
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1987/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1987/comments
https://api.github.com/repos/coleifer/peewee/issues/1987/events
https://github.com/coleifer/peewee/issues/1987
479,091,068
MDU6SXNzdWU0NzkwOTEwNjg=
1,987
peewee internal error on updating class with generated columns
{ "login": "ghost", "id": 10137, "node_id": "MDQ6VXNlcjEwMTM3", "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ghost", "html_url": "https://github.com/ghost", "followers_url": "https://api.github.com/users/ghost/followers", "f...
[]
closed
false
null
[]
null
[ "> Are there ways to declare 'qid' in peewee model as generated and never update it?\r\n\r\nYou're best off using `INSERT` or `UPDATE` directly in that case, so you can be more specific about which columns are being written to.\r\n\r\nPeewee typically handles server-side defaults just fine, as typically they are pr...
2019-08-09T17:26:45
2019-08-12T10:30:01
2019-08-11T21:31:31
NONE
null
Dear colleagues, I have an issue with the updating class with generated column with MariaDB 10.4 and peewee 3.10.0 This is SQL definition: ``` CREATE TABLE IF NOT EXISTS `mw`.`project` ( `uuid` VARCHAR(36) NULL, `qid` VARCHAR(36) GENERATED ALWAYS AS (uuid), `utime` DATETIME NULL, [ ... ] ``` this is h...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1987/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1987/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1986
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1986/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1986/comments
https://api.github.com/repos/coleifer/peewee/issues/1986/events
https://github.com/coleifer/peewee/issues/1986
478,577,901
MDU6SXNzdWU0Nzg1Nzc5MDE=
1,986
Enumerating over query result
{ "login": "karambaq", "id": 14233969, "node_id": "MDQ6VXNlcjE0MjMzOTY5", "avatar_url": "https://avatars.githubusercontent.com/u/14233969?v=4", "gravatar_id": "", "url": "https://api.github.com/users/karambaq", "html_url": "https://github.com/karambaq", "followers_url": "https://api.github.com/users/kar...
[]
closed
false
null
[]
null
[ "http://docs.peewee-orm.com/en/latest/peewee/contributing.html\r\n\r\nPost this on stackoverflow or ask in IRC. This forum is for issues." ]
2019-08-08T16:38:16
2019-08-08T21:06:11
2019-08-08T21:06:11
NONE
null
I want to get next element after the predicate is true I've tried to use ``` for i in enumerate(gs): if predicate(i[1]): print(i) ``` Output: ``` (0, <Fighter: 202157127>) (0, <Fighter: 202157569>) (0, <Fighter: 202158125>) (0, <Fighter: 202159063>) (0, <Fighter: 202160131>) (0...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1986/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1986/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1985
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1985/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1985/comments
https://api.github.com/repos/coleifer/peewee/issues/1985/events
https://github.com/coleifer/peewee/issues/1985
477,501,415
MDU6SXNzdWU0Nzc1MDE0MTU=
1,985
BUG: FlaskDB incorrect implementation
{ "login": "Andrei-Pozolotin", "id": 1622151, "node_id": "MDQ6VXNlcjE2MjIxNTE=", "avatar_url": "https://avatars.githubusercontent.com/u/1622151?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Andrei-Pozolotin", "html_url": "https://github.com/Andrei-Pozolotin", "followers_url": "https://ap...
[]
closed
false
null
[]
null
[ "here is a minimum working version:\r\n```\r\nimport peewee\r\nfrom flask import current_app\r\nfrom playhouse.sqlite_ext import SqliteExtDatabase\r\n\r\nclass PeeweeDatabase:\r\n\r\n def init_app(self, app) -> None:\r\n app.before_request(self.perform_open)\r\n app.teardown_request(self.perform_cl...
2019-08-06T17:21:05
2019-08-13T19:04:00
2019-08-07T22:37:11
NONE
null
1. current implementation of `FlaskDB` https://github.com/coleifer/peewee/blob/master/playhouse/flask_utils.py#L87 is incorrect: it stores `database` in `self` instead of the flask context 2. that prevents `FlaskDB` to be used with flask factory pattern for tests with multiple flask app instances using different p...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1985/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1985/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1984
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1984/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1984/comments
https://api.github.com/repos/coleifer/peewee/issues/1984/events
https://github.com/coleifer/peewee/issues/1984
475,903,242
MDU6SXNzdWU0NzU5MDMyNDI=
1,984
Can't understand how pull data from joins
{ "login": "karambaq", "id": 14233969, "node_id": "MDQ6VXNlcjE0MjMzOTY5", "avatar_url": "https://avatars.githubusercontent.com/u/14233969?v=4", "gravatar_id": "", "url": "https://api.github.com/users/karambaq", "html_url": "https://github.com/karambaq", "followers_url": "https://api.github.com/users/kar...
[]
closed
false
null
[]
null
[ "You need to select it as well, then it will be available.\r\n\r\n```\r\nquery = (Fighter\r\n .select(Fighter, Timestamp)\r\n .join(Timestamp, on=(Fighter.id == Timestamp.id)))\r\nf = query.first()\r\n\r\nprint(f.left, f.right, f.timestamp.timestamp, f.timestamp.daytime)\r\n```", "http://docs.peew...
2019-08-01T21:45:51
2019-08-02T16:16:07
2019-08-02T11:21:15
NONE
null
So I have two tables: # fighters ``` id SERIAL PRIMARY KEY, left_fighter text, right_fighter text ``` # timestamp ``` id SERIAL PRIMARY KEY, timestamp text, daytime time ``` # Code ``` class BaseModel(Model): cla...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1984/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1984/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1983
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1983/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1983/comments
https://api.github.com/repos/coleifer/peewee/issues/1983/events
https://github.com/coleifer/peewee/issues/1983
475,758,561
MDU6SXNzdWU0NzU3NTg1NjE=
1,983
Column with name 'insert' replaces Model class method 'insert'
{ "login": "wspek", "id": 23557813, "node_id": "MDQ6VXNlcjIzNTU3ODEz", "avatar_url": "https://avatars.githubusercontent.com/u/23557813?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wspek", "html_url": "https://github.com/wspek", "followers_url": "https://api.github.com/users/wspek/follow...
[]
closed
false
null
[]
null
[ "This is why we have stuff like \"column_name\":\r\n\r\n```python\r\nclass MyModel(Model):\r\n insert_ = TextField(column_name='insert')\r\n```", "@coleifer \r\n\r\nI have made sure all my columns are explicitly named now by using your suggestion. I hope this GIF demonstrates well that even though the **insert...
2019-08-01T15:47:38
2019-08-01T16:44:39
2019-08-01T15:52:17
NONE
null
Version: 3.9.6 I have discovered that when I create a Model which has a column literally named **insert**, the peewee code will throw an exception when trying to insert data through the `Model.insert` class method in [line 6311](https://github.com/coleifer/peewee/blob/ef27f0209a7942e28ba976264ceaf85891277bb1/peewee....
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1983/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1983/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1982
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1982/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1982/comments
https://api.github.com/repos/coleifer/peewee/issues/1982/events
https://github.com/coleifer/peewee/issues/1982
475,290,612
MDU6SXNzdWU0NzUyOTA2MTI=
1,982
Bulk update of json field not producing executable SQL in Postgres
{ "login": "saileshr", "id": 757986, "node_id": "MDQ6VXNlcjc1Nzk4Ng==", "avatar_url": "https://avatars.githubusercontent.com/u/757986?v=4", "gravatar_id": "", "url": "https://api.github.com/users/saileshr", "html_url": "https://github.com/saileshr", "followers_url": "https://api.github.com/users/sailesh...
[]
closed
false
null
[]
null
[ "I'm not in love with the way I've patched, this, but I have replicated the issue and believe it is fixed:\r\n\r\nef27f0209a7942e28ba976264ceaf85891277bb1\r\n\r\nI'd like to get a better handle on exactly when and where to apply such casts, but until I dive in deeper I suppose this will work.", "thanks for the qu...
2019-07-31T18:21:48
2021-04-29T14:07:46
2019-08-01T15:01:18
NONE
null
``` class Merchant(BaseModel): name = TextField(primary_key=True) class Metrics(BaseModel): merchant = ForeignKeyField(backref='metrics', field='name', model=Merchant, primary_key=True) db_tx_count = JSONField(null=True, default={}) ``` I update a bunch of metrics records and store them in metric...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1982/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1982/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1981
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1981/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1981/comments
https://api.github.com/repos/coleifer/peewee/issues/1981/events
https://github.com/coleifer/peewee/issues/1981
474,548,204
MDU6SXNzdWU0NzQ1NDgyMDQ=
1,981
MySQL does not support the specification of where clauses...
{ "login": "stormeyes", "id": 5072174, "node_id": "MDQ6VXNlcjUwNzIxNzQ=", "avatar_url": "https://avatars.githubusercontent.com/u/5072174?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stormeyes", "html_url": "https://github.com/stormeyes", "followers_url": "https://api.github.com/users/st...
[]
closed
false
null
[]
null
[]
2019-07-30T12:11:36
2019-07-30T12:48:55
2019-07-30T12:48:55
NONE
null
Hi, I read the issue https://github.com/coleifer/peewee/issues/1307 and know I can use upsert-like method `on_conflict`, however when I try I got error: `MySQL does not support the specification of where clauses or conflict targets for conflict resolution.` , anyone knows why? ``` res = (Emp .insert(first='...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1981/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1981/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1980
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1980/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1980/comments
https://api.github.com/repos/coleifer/peewee/issues/1980/events
https://github.com/coleifer/peewee/issues/1980
474,134,172
MDU6SXNzdWU0NzQxMzQxNzI=
1,980
Trouble Splitting Up Code
{ "login": "dkryptr", "id": 13036301, "node_id": "MDQ6VXNlcjEzMDM2MzAx", "avatar_url": "https://avatars.githubusercontent.com/u/13036301?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dkryptr", "html_url": "https://github.com/dkryptr", "followers_url": "https://api.github.com/users/dkrypt...
[]
closed
false
null
[]
null
[ "> But the problem with this is that db is undefined.\r\n\r\nBecause you're not returning anything...\r\n\r\nThis is not peewee-specific but a general question about Python module organization. When you have dependencies like this, the typical solution is to introduce a third module that composes the two (db and ma...
2019-07-29T16:05:56
2019-07-29T17:01:37
2019-07-29T17:01:37
NONE
null
The issue I'm running into is pretty specific to my use case and I'm not sure how many it would affect. I'm creating AWS Lambda functions that insert/query from the database. I have my code separated into multiple files so that different lambda functions can re-use code. Here's a very simplified example. db.py ```p...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1980/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1980/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1979
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1979/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1979/comments
https://api.github.com/repos/coleifer/peewee/issues/1979/events
https://github.com/coleifer/peewee/issues/1979
474,070,965
MDU6SXNzdWU0NzQwNzA5NjU=
1,979
Bulk insert with uuid foreign key
{ "login": "deissh", "id": 21129524, "node_id": "MDQ6VXNlcjIxMTI5NTI0", "avatar_url": "https://avatars.githubusercontent.com/u/21129524?v=4", "gravatar_id": "", "url": "https://api.github.com/users/deissh", "html_url": "https://github.com/deissh", "followers_url": "https://api.github.com/users/deissh/fo...
[]
closed
false
null
[]
null
[ "Sqlite is indicating that you have a foreign-key constraint error. That is, one of the objects you are creating, is using an invalid foreign-key.\r\n\r\nPeewee attempts to convert the UUID instances in your models into their hex equivalent for storage, but it looks like one of your parameters is coming through wit...
2019-07-29T14:04:21
2019-07-30T10:48:51
2019-07-29T16:54:05
NONE
null
I'm using SQLite with PeeWee 3.9.6 ```python3 TrainingMuscleGroups.insert_many( [ *muscle_groups ], fields=[ TrainingMuscleGroups.training, TrainingMuscleGroups.muscle_group ] ).execute() ``` Models ```python3 class MuscleGroups(Model): id = UUIDField(defau...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1979/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1979/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1978
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1978/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1978/comments
https://api.github.com/repos/coleifer/peewee/issues/1978/events
https://github.com/coleifer/peewee/issues/1978
473,493,095
MDU6SXNzdWU0NzM0OTMwOTU=
1,978
Malformed column name returned from select() on modified field.
{ "login": "davidbernat", "id": 5396131, "node_id": "MDQ6VXNlcjUzOTYxMzE=", "avatar_url": "https://avatars.githubusercontent.com/u/5396131?v=4", "gravatar_id": "", "url": "https://api.github.com/users/davidbernat", "html_url": "https://github.com/davidbernat", "followers_url": "https://api.github.com/us...
[]
closed
false
null
[]
null
[ "`pw.fn.ST_AsText(PadsLocations.latlng).alias('latlng')` does return the appropriate result, as a monkey-patch.", "Peewee relies on the driver to implement the db-api 2.0 spec. Part of this spec is that a cursor, after executing a query, contains a `description` property which tells us about the names of the colu...
2019-07-26T18:58:22
2019-07-26T19:32:39
2019-07-26T19:32:39
NONE
null
``` class PointField(pw.Field): """Geometry field type Point, conforming to MySQL 8.0+, format is WKT: 'POINT(18 23)'""" # Field type in MySQL is Point with a capital P. field_type = 'Point' def python_value(self, value): return value def db_value(self, ewkt): """Conver...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1978/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1978/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1977
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1977/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1977/comments
https://api.github.com/repos/coleifer/peewee/issues/1977/events
https://github.com/coleifer/peewee/issues/1977
472,497,675
MDU6SXNzdWU0NzI0OTc2NzU=
1,977
SchemaMigrator.add_column problem
{ "login": "richey-v", "id": 6144958, "node_id": "MDQ6VXNlcjYxNDQ5NTg=", "avatar_url": "https://avatars.githubusercontent.com/u/6144958?v=4", "gravatar_id": "", "url": "https://api.github.com/users/richey-v", "html_url": "https://github.com/richey-v", "followers_url": "https://api.github.com/users/riche...
[]
closed
false
null
[]
null
[ "What difference does it make what order the column is in the underlying storage? Absolutely none, truthfully." ]
2019-07-24T20:17:14
2019-07-24T20:52:42
2019-07-24T20:52:42
NONE
null
(using peewee 3.9.6 with sqlite3) I am assuming the problem that I am reporting may be difficult to fix, so this Issue might be best resolved by adding a note to the relevant [documentation](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#SchemaMigrator.add_column). I needed a new Field in a Model and ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1977/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1977/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1976
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1976/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1976/comments
https://api.github.com/repos/coleifer/peewee/issues/1976/events
https://github.com/coleifer/peewee/pull/1976
472,239,821
MDExOlB1bGxSZXF1ZXN0MzAwNjg4ODE1
1,976
Avoid situations where connections have same ts.
{ "login": "itsmeczaharia", "id": 18571895, "node_id": "MDQ6VXNlcjE4NTcxODk1", "avatar_url": "https://avatars.githubusercontent.com/u/18571895?v=4", "gravatar_id": "", "url": "https://api.github.com/users/itsmeczaharia", "html_url": "https://github.com/itsmeczaharia", "followers_url": "https://api.githu...
[]
closed
false
null
[]
null
[ "What's odd is that `time.time()` has microsecond precision on my machine. Granted, calling `time.time()` appears to take only ~80ns, but still there's a lot of stuff going on that would seem to make identical timestamps an impossibility. I'm fine with merging, but I can't wrap my head around how this could happen ...
2019-07-24T11:52:23
2019-07-24T14:37:51
2019-07-24T14:37:50
NONE
null
Hello, I was able to reproduce the bug from this issue: https://github.com/coleifer/peewee/issues/1883 Adding a small random number to ts, avoids that race condition.
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1976/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1976/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1976", "html_url": "https://github.com/coleifer/peewee/pull/1976", "diff_url": "https://github.com/coleifer/peewee/pull/1976.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1976.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/1975
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1975/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1975/comments
https://api.github.com/repos/coleifer/peewee/issues/1975/events
https://github.com/coleifer/peewee/issues/1975
472,038,588
MDU6SXNzdWU0NzIwMzg1ODg=
1,975
Cannot work with VIEWs in SQLite
{ "login": "erakli", "id": 11831470, "node_id": "MDQ6VXNlcjExODMxNDcw", "avatar_url": "https://avatars.githubusercontent.com/u/11831470?v=4", "gravatar_id": "", "url": "https://api.github.com/users/erakli", "html_url": "https://github.com/erakli", "followers_url": "https://api.github.com/users/erakli/fo...
[]
closed
false
null
[]
null
[ "My guess is you're using an ancient version of sqlite. Try this and check the output:\r\n\r\n```python\r\n>>> import sqlite3\r\n>>> sqlite3.sqlite_version # My version is quite new.\r\n'3.29.0'\r\n```\r\n\r\nYou need to upgrade your sqlite for peewee to properly infer the column names.\r\n\r\nFor example, the fol...
2019-07-24T01:40:06
2019-07-24T15:21:20
2019-07-24T12:24:19
NONE
null
I tried to use peewee to select from view. I reflected view ```python >>> models = generate_models(db, include_views=True) >>> globals().update(models) >>> print_model(store_items_view) store_items_view item_no TEXT color_id INT new_or_used TEXT completeness TEXT quantity DEFAULT unit_price IN...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1975/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1975/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1974
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1974/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1974/comments
https://api.github.com/repos/coleifer/peewee/issues/1974/events
https://github.com/coleifer/peewee/issues/1974
471,889,847
MDU6SXNzdWU0NzE4ODk4NDc=
1,974
Unecessary index on table creation
{ "login": "lucianobarcaro", "id": 833149, "node_id": "MDQ6VXNlcjgzMzE0OQ==", "avatar_url": "https://avatars.githubusercontent.com/u/833149?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lucianobarcaro", "html_url": "https://github.com/lucianobarcaro", "followers_url": "https://api.github...
[]
closed
false
null
[]
null
[ "You're welcome to override the default foreign-key index creation, by specifying `index=False` explicitly in the `ForeignKeyField` declaration/initialization.\r\n\r\nYou might double-check your information, however, to make sure that you actually *do* have an index on `user_id` in the referring table (`UserAccess`...
2019-07-23T19:31:51
2019-07-23T20:37:42
2019-07-23T20:37:42
NONE
null
I'm new to peewee (2 weeks now) and I noted an unecessary index on table creation. Simple case: ``` class Usuario(BaseModel): nome = CharField() class UsuarioAcesso(BaseModel): usuario = ForeignKeyField(Usuario) dataAcesso = DateTimeField() fromIP = CharField() class Meta: primary_...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1974/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1974/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1973
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1973/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1973/comments
https://api.github.com/repos/coleifer/peewee/issues/1973/events
https://github.com/coleifer/peewee/issues/1973
471,652,489
MDU6SXNzdWU0NzE2NTI0ODk=
1,973
shortcuts.model_to_dict convert 0 to None in ForeignKeyField unless recurse == False
{ "login": "duvifn", "id": 17128619, "node_id": "MDQ6VXNlcjE3MTI4NjE5", "avatar_url": "https://avatars.githubusercontent.com/u/17128619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/duvifn", "html_url": "https://github.com/duvifn", "followers_url": "https://api.github.com/users/duvifn/fo...
[]
closed
false
null
[]
null
[ "Thanks!" ]
2019-07-23T11:52:29
2019-07-23T12:42:41
2019-07-23T12:31:46
NONE
null
```python import peewee from playhouse.shortcuts import model_to_dict database = peewee.PostgresqlDatabase( 'temp_db', .... ) database.connect() class Group (peewee.Model): id = peewee.BigIntegerField(null= False, index = True, unique = True, primary_key = True) class Meta(): dat...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1973/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1973/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1972
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1972/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1972/comments
https://api.github.com/repos/coleifer/peewee/issues/1972/events
https://github.com/coleifer/peewee/issues/1972
470,936,876
MDU6SXNzdWU0NzA5MzY4NzY=
1,972
Postgres transaction isolation level
{ "login": "duvifn", "id": 17128619, "node_id": "MDQ6VXNlcjE3MTI4NjE5", "avatar_url": "https://avatars.githubusercontent.com/u/17128619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/duvifn", "html_url": "https://github.com/duvifn", "followers_url": "https://api.github.com/users/duvifn/fo...
[]
closed
false
null
[]
null
[ "The underlying psycopg2 connection class is exposed as `db.connection()`, e.g.\r\n\r\n```python\r\ndb = PostgresqlDatabase('my_app')\r\nconn = db.connection() # returns current conn, opening one if necessary\r\n```\r\n\r\nThen use the psycopg2 apis to set the isolation level:\r\n\r\n```python\r\nfrom psycopg2 imp...
2019-07-22T07:28:43
2019-07-22T11:13:25
2019-07-22T09:21:37
NONE
null
Hi, Probably I'm missing something but I couldn't find a way to specify transaction isolation level for Postgres (default to [`Read committed`](https://www.postgresql.org/docs/9.5/transaction-iso.html) which is not sufficient for my use case - in which `Repeatable read` is needed). Any way to workaround it (without...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1972/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1972/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1971
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1971/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1971/comments
https://api.github.com/repos/coleifer/peewee/issues/1971/events
https://github.com/coleifer/peewee/issues/1971
468,036,299
MDU6SXNzdWU0NjgwMzYyOTk=
1,971
what's the alternative usage of ReadSlaveModel
{ "login": "kaka19ace", "id": 1320568, "node_id": "MDQ6VXNlcjEzMjA1Njg=", "avatar_url": "https://avatars.githubusercontent.com/u/1320568?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kaka19ace", "html_url": "https://github.com/kaka19ace", "followers_url": "https://api.github.com/users/ka...
[]
closed
false
null
[]
null
[ "Instead of this, Peewee 3.x instead provides some really nice APIs for switching the database around at run-time.\r\n\r\n* http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.bind_ctx\r\n* http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.bind_ctx" ]
2019-07-15T09:50:10
2019-07-15T17:26:26
2019-07-15T17:26:26
NONE
null
hi, peewee playhouse 3.x version has no longer support read_slave, and what's the alternative usage?
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1971/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1971/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1970
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1970/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1970/comments
https://api.github.com/repos/coleifer/peewee/issues/1970/events
https://github.com/coleifer/peewee/issues/1970
467,617,747
MDU6SXNzdWU0Njc2MTc3NDc=
1,970
Init db instance later
{ "login": "danieldaeschle", "id": 30751516, "node_id": "MDQ6VXNlcjMwNzUxNTE2", "avatar_url": "https://avatars.githubusercontent.com/u/30751516?v=4", "gravatar_id": "", "url": "https://api.github.com/users/danieldaeschle", "html_url": "https://github.com/danieldaeschle", "followers_url": "https://api.gi...
[]
closed
false
null
[]
null
[ "Read the docs.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/database.html#run-time-database-configuration" ]
2019-07-12T22:05:07
2019-07-13T02:30:20
2019-07-13T02:30:19
NONE
null
Is there any chance to initalize the database instance later? When i want to create a MysqlDatabase i must give the "database" parameter. But at the point of creating the instance i don't know it. But i have to create the instance to create the models. A better way for me would be to define the models without depend ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1970/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1970/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1969
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1969/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1969/comments
https://api.github.com/repos/coleifer/peewee/issues/1969/events
https://github.com/coleifer/peewee/issues/1969
466,002,450
MDU6SXNzdWU0NjYwMDI0NTA=
1,969
Hybrid methods not using table aliases
{ "login": "mikemill", "id": 1652125, "node_id": "MDQ6VXNlcjE2NTIxMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/1652125?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mikemill", "html_url": "https://github.com/mikemill", "followers_url": "https://api.github.com/users/mikem...
[]
closed
false
null
[]
null
[ "Well, the problem is either the descriptor protocol, or the implementation of `ModelAlias`.\r\n\r\nI find it simpler to look at this example, which I'm going to walk through just to get it all out in front of me to look at:\r\n\r\n```python\r\nclass Interval(Model):\r\n start = IntegerField()\r\n end = Integ...
2019-07-09T21:55:49
2019-07-23T17:14:07
2019-07-23T17:14:07
NONE
null
Peewee 3.8.2 I'm using a hybrid_method to simplify my querying. I found, however, that it ignores table aliases. In my use case the table has a foreign key to itself and I need to check the dates on the joined table and not on the parent table. Here is an example script: ```python from datetime import date f...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1969/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1969/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1968
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1968/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1968/comments
https://api.github.com/repos/coleifer/peewee/issues/1968/events
https://github.com/coleifer/peewee/issues/1968
464,456,433
MDU6SXNzdWU0NjQ0NTY0MzM=
1,968
Get the original SQL statement
{ "login": "ztj1993", "id": 13493380, "node_id": "MDQ6VXNlcjEzNDkzMzgw", "avatar_url": "https://avatars.githubusercontent.com/u/13493380?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ztj1993", "html_url": "https://github.com/ztj1993", "followers_url": "https://api.github.com/users/ztj199...
[]
closed
false
null
[]
null
[ "Peewee issues parameterized queries. All the db drivers peewee works with out-of-the-box support this, so the `.sql()` method returns the query and the params, which is exactly what is sent to the db.\r\n\r\nIf you want to try, you can use `peewee.query_to_string(q)` which will interpolate the parameters, but this...
2019-07-05T04:29:37
2019-07-05T12:20:05
2019-07-05T12:20:04
NONE
null
I execute the code: ``` sql = AdModel.select(AdModel.id).where(AdModel.status == 9,).sql() print(sql) ``` The output is: ``` ('SELECT `t1`.`id` FROM `ht_silo`.`ht_ad` AS `t1` WHERE (`t1`.`status` = %s)', [9]) ``` How to output: ``` SELECT `t1`.`id` FROM `ht_silo`.`ht_ad` AS `t1` WHERE (`t1`.`status` = ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1968/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1968/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1967
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1967/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1967/comments
https://api.github.com/repos/coleifer/peewee/issues/1967/events
https://github.com/coleifer/peewee/issues/1967
464,185,916
MDU6SXNzdWU0NjQxODU5MTY=
1,967
Matching peewee with vuex-orm
{ "login": "dsmurrell", "id": 4035854, "node_id": "MDQ6VXNlcjQwMzU4NTQ=", "avatar_url": "https://avatars.githubusercontent.com/u/4035854?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dsmurrell", "html_url": "https://github.com/dsmurrell", "followers_url": "https://api.github.com/users/ds...
[]
closed
false
null
[]
null
[ "`model_to_dict` is a convenience helper, but people definitely tend to treat it as the be-all/end-all of putting their model data in a dict.\r\n\r\nYou can try excluding the `study` field and specifying `extra_attrs=['study_id']` which will use the built-in foreign-key object ID accessor. That may work.", "Thank...
2019-07-04T10:16:32
2019-07-04T18:05:04
2019-07-04T16:50:58
NONE
null
I realise that it's not your problem to match peewee with random frontend tools... however, I'm wondering whether there is a simple solution that already exists but which I don't know about that can adequately match what peewee returns with what this specific frontend tool wants. For models Studies and Surveys, wher...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1967/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1967/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1966
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1966/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1966/comments
https://api.github.com/repos/coleifer/peewee/issues/1966/events
https://github.com/coleifer/peewee/issues/1966
464,110,754
MDU6SXNzdWU0NjQxMTA3NTQ=
1,966
Can peewee create relations but without foreign key constraint?
{ "login": "ethanlinys", "id": 18170680, "node_id": "MDQ6VXNlcjE4MTcwNjgw", "avatar_url": "https://avatars.githubusercontent.com/u/18170680?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ethanlinys", "html_url": "https://github.com/ethanlinys", "followers_url": "https://api.github.com/use...
[]
closed
false
null
[]
null
[ "I don't really understand, nor am I familiar w/SQLAlchemy, so the code example makes no sense to me.\r\n\r\nIn short, if you want a foreign-key, use the foreign key field.\r\n\r\nIf not, use an `IntegerField` and add a property to your model class.\r\n\r\n```python\r\nclass Tweet(Model):\r\n user_id = IntegerFi...
2019-07-04T07:33:37
2021-12-24T07:02:13
2019-07-04T16:38:03
NONE
null
In sqlalchemy I can do like below. [https://stackoverflow.com/questions/37806625/sqlalchemy-create-relations-but-without-foreign-key-constraint-in-db](url) ``` In [2]: class A(Base): ...: a_id = Column(Integer, primary_key=True) ...: __tablename__ = 'a' ...: In [3]: class C(Base): .....
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1966/reactions", "total_count": 3, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 1 }
https://api.github.com/repos/coleifer/peewee/issues/1966/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1965
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1965/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1965/comments
https://api.github.com/repos/coleifer/peewee/issues/1965/events
https://github.com/coleifer/peewee/issues/1965
463,844,555
MDU6SXNzdWU0NjM4NDQ1NTU=
1,965
Postgres field extension - inet data type
{ "login": "danielguardicore", "id": 15857396, "node_id": "MDQ6VXNlcjE1ODU3Mzk2", "avatar_url": "https://avatars.githubusercontent.com/u/15857396?v=4", "gravatar_id": "", "url": "https://api.github.com/users/danielguardicore", "html_url": "https://github.com/danielguardicore", "followers_url": "https://...
[]
closed
false
null
[]
null
[ "```python\r\nclass SomeField(Field):\r\n field_type = 'inet'\r\n```\r\n\r\nIf you require conversion from python data-types to db-friendly data-types, you would implement `python_value()` and `db_value()` as needed.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html#custom-fields" ]
2019-07-03T16:23:50
2019-07-03T18:53:46
2019-07-03T18:53:46
NONE
null
First off, Peewee is great :) Postgres supports network data types. https://www.postgresql.org/docs/9.1/datatype-net-types.html What would be the best way to implement support for these fields instead of peewees IPAddr field? A simple Field extension with the right type would suffice? If so, I will prototype...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1965/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1965/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1964
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1964/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1964/comments
https://api.github.com/repos/coleifer/peewee/issues/1964/events
https://github.com/coleifer/peewee/pull/1964
463,526,203
MDExOlB1bGxSZXF1ZXN0MjkzOTg4MTIz
1,964
infer foreign key from the name of the model
{ "login": "nad2000", "id": 177266, "node_id": "MDQ6VXNlcjE3NzI2Ng==", "avatar_url": "https://avatars.githubusercontent.com/u/177266?v=4", "gravatar_id": "", "url": "https://api.github.com/users/nad2000", "html_url": "https://github.com/nad2000", "followers_url": "https://api.github.com/users/nad2000/fo...
[]
closed
false
null
[]
null
[ "Going to pass on this and require the condition when multiple FKs are present." ]
2019-07-03T03:30:02
2019-07-03T15:56:04
2019-07-03T15:56:04
NONE
null
fix for #1963
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1964/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1964/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1964", "html_url": "https://github.com/coleifer/peewee/pull/1964", "diff_url": "https://github.com/coleifer/peewee/pull/1964.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1964.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/1963
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1963/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1963/comments
https://api.github.com/repos/coleifer/peewee/issues/1963/events
https://github.com/coleifer/peewee/issues/1963
463,518,724
MDU6SXNzdWU0NjM1MTg3MjQ=
1,963
Missing on= inference for joins (ValueError: More than one foreign key between.... Please specify which you are joining on.)
{ "login": "nad2000", "id": 177266, "node_id": "MDQ6VXNlcjE3NzI2Ng==", "avatar_url": "https://avatars.githubusercontent.com/u/177266?v=4", "gravatar_id": "", "url": "https://api.github.com/users/nad2000", "html_url": "https://github.com/nad2000", "followers_url": "https://api.github.com/users/nad2000/fo...
[]
closed
false
null
[]
null
[ "My sense is to keep this explicit when multiple FKs are present, regardless of what the previous (2.x?) behavior may have been.", "that's a bummer. I have heaps of queries that used to work with 2.x but now are broken (all tables have these created_by and modified_by)", "Well let me reconsider.", "Merged equ...
2019-07-03T02:54:27
2019-07-04T16:47:28
2019-07-04T16:47:13
NONE
null
The inference of **on=...** has changed in the case with multiple foreign keys to the same table, for example, ```python class User(Model): ... class Record(Model): user = ForeignKeyField(User) created_by = ForeignKeyField(User) updated_by = ForeignKeyField(User) ``` an attempt to join `Rec...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1963/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1963/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1962
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1962/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1962/comments
https://api.github.com/repos/coleifer/peewee/issues/1962/events
https://github.com/coleifer/peewee/issues/1962
463,445,226
MDU6SXNzdWU0NjM0NDUyMjY=
1,962
Can't access to joined model data
{ "login": "kyotops", "id": 38300198, "node_id": "MDQ6VXNlcjM4MzAwMTk4", "avatar_url": "https://avatars.githubusercontent.com/u/38300198?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kyotops", "html_url": "https://github.com/kyotops", "followers_url": "https://api.github.com/users/kyotop...
[]
closed
false
null
[]
null
[ "In a many-to-many things are complicated. Depending on how you join, you're going to get duplicated data on one side or the other. Remember that the output of any query is always going to be a flat table-like data-structure. There is no nesting. So no rolling up of multiple Books for a single User. You'll get one ...
2019-07-02T21:31:58
2019-07-03T15:59:20
2019-07-03T15:59:20
NONE
null
I'm trying to implement Many to Many select (http://docs.peewee-orm.com/en/latest/peewee/relationships.html#implementing-many-to-many), but I can't access to Book model data: ``` query = User.select( User, Book, BookRelationship, ).join( BookRelationship, on=BookRelationship.from_user, ).jo...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1962/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1962/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1961
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1961/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1961/comments
https://api.github.com/repos/coleifer/peewee/issues/1961/events
https://github.com/coleifer/peewee/issues/1961
463,004,118
MDU6SXNzdWU0NjMwMDQxMTg=
1,961
.exists() fails for a query with SQL literals/expresions
{ "login": "nad2000", "id": 177266, "node_id": "MDQ6VXNlcjE3NzI2Ng==", "avatar_url": "https://avatars.githubusercontent.com/u/177266?v=4", "gravatar_id": "", "url": "https://api.github.com/users/nad2000", "html_url": "https://github.com/nad2000", "followers_url": "https://api.github.com/users/nad2000/fo...
[]
closed
false
null
[]
null
[]
2019-07-02T03:38:52
2019-07-02T13:44:59
2019-07-02T13:44:59
NONE
null
With **2.x** something like this was working. ```python # This is a simplified query (check in one round-trip): (User.select(SQL('1')) | Organisation.select(SQL('1'))).exists() ``` With **3.x (3.9.6)** the query gets build but **.exists()** fails with: ``` *** AttributeError: 'ModelCompoundSelectQuery' object...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1961/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1961/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1960
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1960/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1960/comments
https://api.github.com/repos/coleifer/peewee/issues/1960/events
https://github.com/coleifer/peewee/pull/1960
458,904,907
MDExOlB1bGxSZXF1ZXN0MjkwMzk1MTU2
1,960
Implement LCONCAT
{ "login": "GrmpPnda", "id": 12795082, "node_id": "MDQ6VXNlcjEyNzk1MDgy", "avatar_url": "https://avatars.githubusercontent.com/u/12795082?v=4", "gravatar_id": "", "url": "https://api.github.com/users/GrmpPnda", "html_url": "https://github.com/GrmpPnda", "followers_url": "https://api.github.com/users/Grm...
[]
closed
false
null
[]
null
[]
2019-06-20T22:02:04
2019-06-21T17:44:04
2019-06-21T17:44:04
NONE
null
Implement a left-concat for string expressions.
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1960/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1960/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1960", "html_url": "https://github.com/coleifer/peewee/pull/1960", "diff_url": "https://github.com/coleifer/peewee/pull/1960.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1960.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/1959
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1959/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1959/comments
https://api.github.com/repos/coleifer/peewee/issues/1959/events
https://github.com/coleifer/peewee/issues/1959
458,630,398
MDU6SXNzdWU0NTg2MzAzOTg=
1,959
AttributeError: 'bool' object has no attribute 'name' while getting self._pk value.
{ "login": "lalit-lintel", "id": 26576603, "node_id": "MDQ6VXNlcjI2NTc2NjAz", "avatar_url": "https://avatars.githubusercontent.com/u/26576603?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lalit-lintel", "html_url": "https://github.com/lalit-lintel", "followers_url": "https://api.github.c...
[]
closed
false
null
[]
null
[ "I also have a similar issue when doing a `bulk_update`. Though I do have `pmid = pw.IntegerField(unique=True)` in my model.\r\n\r\n```python\r\n with self.dbase.atomic():\r\n for idx in range(0, num_papers_update, n_batch):\r\n db.PaperDB.bulk_update(self.update_l[idx:i...
2019-06-20T12:32:41
2021-09-03T12:12:16
2019-06-20T12:58:28
NONE
null
I am using a model without a primary. and also used peewee signals To have a model without a primary key, I declare it like below. ```python class MyModel(base.BaseModel): field1 = pw.IntegerField(index=True) field2 = pw.IntegerField() class Meta: primary_key = False ``` But on cre...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1959/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1959/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1958
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1958/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1958/comments
https://api.github.com/repos/coleifer/peewee/issues/1958/events
https://github.com/coleifer/peewee/pull/1958
457,970,173
MDExOlB1bGxSZXF1ZXN0Mjg5NjcwMTc5
1,958
Add support for MySQL STRAIGHT_JOIN
{ "login": "d0d0", "id": 553292, "node_id": "MDQ6VXNlcjU1MzI5Mg==", "avatar_url": "https://avatars.githubusercontent.com/u/553292?v=4", "gravatar_id": "", "url": "https://api.github.com/users/d0d0", "html_url": "https://github.com/d0d0", "followers_url": "https://api.github.com/users/d0d0/followers", ...
[]
closed
false
null
[]
null
[ "Going to pass.", "Is the feature available in the peewee now ?", "I see latest peewee version was added in Apr 23, 2020, so this one not yet released ???", "I did not merge this change.", "Any alternative way to include straight_join in peewee ?", "or is there a way to replace **select** with **select st...
2019-06-19T11:57:08
2020-09-11T04:06:41
2019-06-19T14:43:50
NONE
null
Add support for mysql STRAIGHT_JOIN. Resolves https://github.com/coleifer/peewee/issues/842
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1958/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1958/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1958", "html_url": "https://github.com/coleifer/peewee/pull/1958", "diff_url": "https://github.com/coleifer/peewee/pull/1958.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1958.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/1957
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1957/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1957/comments
https://api.github.com/repos/coleifer/peewee/issues/1957/events
https://github.com/coleifer/peewee/issues/1957
457,865,703
MDU6SXNzdWU0NTc4NjU3MDM=
1,957
How to add fields to existing tables
{ "login": "qa1057", "id": 35075555, "node_id": "MDQ6VXNlcjM1MDc1NTU1", "avatar_url": "https://avatars.githubusercontent.com/u/35075555?v=4", "gravatar_id": "", "url": "https://api.github.com/users/qa1057", "html_url": "https://github.com/qa1057", "followers_url": "https://api.github.com/users/qa1057/fo...
[]
closed
false
null
[]
null
[ "* https://www.postgresql.org/docs/current/sql-altertable.html\r\n* https://www.sqlite.org/lang_altertable.html\r\n* https://dev.mysql.com/doc/refman/8.0/en/alter-table.html\r\n\r\nPeewee can help you. If you had looked at the docs, you'd probably have found it:\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/pl...
2019-06-19T08:05:52
2019-06-19T14:39:51
2019-06-19T14:39:33
NONE
null
For example, now I have created a model and executed to create a table. Then I want to add fields to this table. What should I do?
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1957/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1957/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1956
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1956/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1956/comments
https://api.github.com/repos/coleifer/peewee/issues/1956/events
https://github.com/coleifer/peewee/issues/1956
457,795,947
MDU6SXNzdWU0NTc3OTU5NDc=
1,956
`ignore_unknown` unexpectedly doesn't ignore `id` field.
{ "login": "blakewest", "id": 2524396, "node_id": "MDQ6VXNlcjI1MjQzOTY=", "avatar_url": "https://avatars.githubusercontent.com/u/2524396?v=4", "gravatar_id": "", "url": "https://api.github.com/users/blakewest", "html_url": "https://github.com/blakewest", "followers_url": "https://api.github.com/users/bl...
[]
closed
false
null
[]
null
[ "This makes sense -- so the issue is that your `BaseModel` class has an `id` primary key field (since no primary key is declared). When you subclass it, just because of how Python works, you get an `id` attribute on your subclass (`Website`).\r\n\r\nTo work around this, just declare your base model with the primary...
2019-06-19T04:06:30
2019-06-23T16:36:24
2019-06-19T14:36:06
NONE
null
Hi, I just started working with PeeWee, and came across some issues while working with the `ignore_unknown` option. Specifically, when trying to use `dict_to_model` with the `ignore_unknown` option, it doesn't seem to actually ignore all unknown traits. It ignores everything except for `id`. Here's a short example belo...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1956/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1956/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1955
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1955/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1955/comments
https://api.github.com/repos/coleifer/peewee/issues/1955/events
https://github.com/coleifer/peewee/issues/1955
457,615,055
MDU6SXNzdWU0NTc2MTUwNTU=
1,955
Implement full-text search in mysql?
{ "login": "dzpt", "id": 5781080, "node_id": "MDQ6VXNlcjU3ODEwODA=", "avatar_url": "https://avatars.githubusercontent.com/u/5781080?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dzpt", "html_url": "https://github.com/dzpt", "followers_url": "https://api.github.com/users/dzpt/followers", ...
[]
closed
false
null
[]
null
[ "Here is the doc: http://docs.peewee-orm.com/en/latest/peewee/query_operators.html#adding-user-defined-operators\r\n\r\nJust write a wrapper.\r\n\r\n```python\r\ndef Match(columns, expr, modifier=None):\r\n match = fn.MATCH(*columns) # MATCH(col0, col1, ...)\r\n args = expr if modifier is None else NodeList(...
2019-06-18T17:49:52
2019-06-18T20:08:08
2019-06-18T20:08:07
NONE
null
It wasn't mentioned on the doc. Only issue #532 You link to user-defined function but i have no idea how to use it to implement full-text search. There's no doc on `Expression` I've tried with this, but how am i supposed to set MATCH around `lhs`? ``` def fulltext(lhs, rhs): return Expression(lhs, 'AGAINST',...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1955/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1955/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1954
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1954/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1954/comments
https://api.github.com/repos/coleifer/peewee/issues/1954/events
https://github.com/coleifer/peewee/issues/1954
456,647,075
MDU6SXNzdWU0NTY2NDcwNzU=
1,954
After importing database, IntegrityError raised for every new record
{ "login": "joshuaia", "id": 51882760, "node_id": "MDQ6VXNlcjUxODgyNzYw", "avatar_url": "https://avatars.githubusercontent.com/u/51882760?v=4", "gravatar_id": "", "url": "https://api.github.com/users/joshuaia", "html_url": "https://github.com/joshuaia", "followers_url": "https://api.github.com/users/jos...
[]
closed
false
null
[]
null
[ "You need to update the sequence that controls the next value of the primary key.\r\n\r\n```sql\r\nSELECT setval('users_id_seq', (SELECT MAX(id) FROM users)+1);\r\n```\r\n\r\nFor whatever reason, the way you're doing your inserts isn't setting this properly." ]
2019-06-16T14:27:30
2019-06-18T19:49:06
2019-06-18T19:49:05
NONE
null
I'm importing database like this: `psql -h localhost -d db_name -U user -f db.sql` Example of sql query: ``` INSERT INTO public.users(id, email, password) VALUES (1, 'user1@mail.com', 'PASSWORD_HASH'); INSERT INTO public.users(id, email, password) VALUES (2, 'user2@mail.com', 'PASSWORD_HASH'); INSERT INTO publi...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1954/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1954/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1953
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1953/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1953/comments
https://api.github.com/repos/coleifer/peewee/issues/1953/events
https://github.com/coleifer/peewee/issues/1953
456,592,320
MDU6SXNzdWU0NTY1OTIzMjA=
1,953
peewee.ProgrammingError: syntax error at or near "RETURNING"
{ "login": "ernest-andela", "id": 46436012, "node_id": "MDQ6VXNlcjQ2NDM2MDEy", "avatar_url": "https://avatars.githubusercontent.com/u/46436012?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ernest-andela", "html_url": "https://github.com/ernest-andela", "followers_url": "https://api.githu...
[]
closed
false
null
[]
null
[ "Fixed: I set primary_key = False", "It appears to me that Redshift should support the Postgresql `RETURNING` clause, as it is not listed among the \"unsupported postgresql features\":\r\n\r\nhttps://docs.aws.amazon.com/redshift/latest/dg/c_unsupported-postgresql-features.html" ]
2019-06-16T01:50:51
2019-06-18T19:50:51
2019-06-18T19:50:51
NONE
null
I am getting the error below and l don't know what is causing this error I am saving this into a model using Redshift Postgres Database: ``` etl_dic = { "email": "email" } File "/Users/ernestappiah/Desktop/FlaskApplications/AirflowETL/terravion/service/subscriptions/operations/subscription.py", lin...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1953/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1953/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1952
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1952/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1952/comments
https://api.github.com/repos/coleifer/peewee/issues/1952/events
https://github.com/coleifer/peewee/issues/1952
455,501,379
MDU6SXNzdWU0NTU1MDEzNzk=
1,952
NOT NULL constraint failed
{ "login": "BOBONA", "id": 25057945, "node_id": "MDQ6VXNlcjI1MDU3OTQ1", "avatar_url": "https://avatars.githubusercontent.com/u/25057945?v=4", "gravatar_id": "", "url": "https://api.github.com/users/BOBONA", "html_url": "https://github.com/BOBONA", "followers_url": "https://api.github.com/users/BOBONA/fo...
[]
closed
false
null
[]
null
[ "What in the fuck is this. Please don't post walls-of-meaningless-code." ]
2019-06-13T02:07:58
2020-09-28T12:14:55
2019-06-13T03:23:03
NONE
null
models/prcl.py: ``` from peewee import * DATABASE = SqliteDatabase('databases/prcl.db') class Prcl(Model): CityBlock = FloatField() Parcel = IntegerField() OwnerCode = IntegerField() ParcelId = BigIntegerField() PrimAddrRecNum = IntegerField() AddrType = TextField(default="") ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1952/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1952/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1951
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1951/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1951/comments
https://api.github.com/repos/coleifer/peewee/issues/1951/events
https://github.com/coleifer/peewee/issues/1951
455,343,810
MDU6SXNzdWU0NTUzNDM4MTA=
1,951
Strange Operational Error
{ "login": "BOBONA", "id": 25057945, "node_id": "MDQ6VXNlcjI1MDU3OTQ1", "avatar_url": "https://avatars.githubusercontent.com/u/25057945?v=4", "gravatar_id": "", "url": "https://api.github.com/users/BOBONA", "html_url": "https://github.com/BOBONA", "followers_url": "https://api.github.com/users/BOBONA/fo...
[]
closed
false
null
[]
null
[ "Nevermind, I just realized that uppercase table names are generally an issue.", "You have complete control over the model class name and/or the table name (same w/fields and columns).\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html#table-names" ]
2019-06-12T17:46:57
2019-06-12T18:15:16
2019-06-12T17:51:43
NONE
null
``` model_class = MyModel model_class.create( **stuff ) ``` Try this code^ This doesn't work and I get an error that says that 'mymodel' is not a table. Is this a glitch or is it intended? I can't figure out how to fix it by myself. Is the solution to only use lowercase names? :)
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1951/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1951/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1950
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1950/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1950/comments
https://api.github.com/repos/coleifer/peewee/issues/1950/events
https://github.com/coleifer/peewee/issues/1950
455,015,398
MDU6SXNzdWU0NTUwMTUzOTg=
1,950
Could I get more exactly error of IntegrityError?
{ "login": "fy0", "id": 1579850, "node_id": "MDQ6VXNlcjE1Nzk4NTA=", "avatar_url": "https://avatars.githubusercontent.com/u/1579850?v=4", "gravatar_id": "", "url": "https://api.github.com/users/fy0", "html_url": "https://github.com/fy0", "followers_url": "https://api.github.com/users/fy0/followers", "f...
[]
closed
false
null
[]
null
[]
2019-06-12T05:15:24
2019-06-12T18:22:36
2019-06-12T18:22:36
NONE
null
Hello, I wrote some code to pick out `duplicate key` and `NOT NULL` exception from IntegrityError, by text match. ```python class PeeweeContext: def __init__(self, db): self.db = db def __enter__(self): pass def __exit__(self, exc_type, exc_val, exc_tb): db = self.db ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1950/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1950/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1949
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1949/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1949/comments
https://api.github.com/repos/coleifer/peewee/issues/1949/events
https://github.com/coleifer/peewee/issues/1949
454,200,667
MDU6SXNzdWU0NTQyMDA2Njc=
1,949
delete signal hooks with delete_instance in recurse mode
{ "login": "Kruptein", "id": 1814713, "node_id": "MDQ6VXNlcjE4MTQ3MTM=", "avatar_url": "https://avatars.githubusercontent.com/u/1814713?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Kruptein", "html_url": "https://github.com/Kruptein", "followers_url": "https://api.github.com/users/Krupt...
[]
closed
false
null
[]
null
[ "That's correct, using the `recurse` functionality issues efficient bulk deletes for any dependent objects. As such, the `delete_instance()` methods of the deps are not called.\r\n\r\nIt is done this way for efficiency in terms of the database.\r\n\r\n(Better yet is to just specify the `on_delete='CASCADE'` option ...
2019-06-10T14:31:27
2019-06-10T15:54:05
2019-06-10T15:48:28
NONE
null
Hi, I have a couple of signal hooks that act on pre_delete. As mentioned in the docs these signals only work with delete_instance. I'm however under the impression that this does not work in combination with the recurse=True field of delete_instance. (i.e. the signals do not trigger for dependencies). take for e...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1949/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1949/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1948
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1948/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1948/comments
https://api.github.com/repos/coleifer/peewee/issues/1948/events
https://github.com/coleifer/peewee/issues/1948
454,170,812
MDU6SXNzdWU0NTQxNzA4MTI=
1,948
Join with multiple subqueries does not work
{ "login": "willianantunes", "id": 4432783, "node_id": "MDQ6VXNlcjQ0MzI3ODM=", "avatar_url": "https://avatars.githubusercontent.com/u/4432783?v=4", "gravatar_id": "", "url": "https://api.github.com/users/willianantunes", "html_url": "https://github.com/willianantunes", "followers_url": "https://api.gith...
[]
closed
false
null
[]
null
[ "As a fantastic workaround, I could make it work by doing the following steps:\r\n\r\n- Copy the Peewee generated RAW SQL\r\n- Paste it inside `raw` function (look the details [here](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.raw))\r\n\r\nResult:\r\n\r\n![Screenshot 2019-06-10 11 00 27](https://user...
2019-06-10T13:27:43
2019-06-11T23:09:37
2019-06-10T15:43:41
NONE
null
I have the following sample module configuration to setup Peewee: ```python from peewee import JOIN from peewee import Model from peewee import SqliteDatabase from peewee import TextField db = SqliteDatabase(f"tmp-sample.db") class BaseModel(Model): class Meta: database = db class Employ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1948/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1948/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1947
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1947/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1947/comments
https://api.github.com/repos/coleifer/peewee/issues/1947/events
https://github.com/coleifer/peewee/pull/1947
454,166,526
MDExOlB1bGxSZXF1ZXN0Mjg2NjczNjI3
1,947
Support raising custom DoesNotExist exceptions in models
{ "login": "onyb", "id": 3684187, "node_id": "MDQ6VXNlcjM2ODQxODc=", "avatar_url": "https://avatars.githubusercontent.com/u/3684187?v=4", "gravatar_id": "", "url": "https://api.github.com/users/onyb", "html_url": "https://github.com/onyb", "followers_url": "https://api.github.com/users/onyb/followers", ...
[]
closed
false
null
[]
null
[ "@coleifer Could you please explain the reason why you closed this PR? Is raising custom `DoesNotExist` exceptions already possible with PeeWee, or perhaps there is something you'd like me to improve?" ]
2019-06-10T13:18:18
2019-06-20T12:43:06
2019-06-10T15:41:33
NONE
null
### Why do we need this? - The current way of raising a custom `DoesNotExist` exception is to override model methods like `.get_by_id()`, catch `DoesNotExist` and re-raise with a custom exception class. This is too much boilerplate for something that should be doable with something like: ```py class Base...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1947/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1947/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1947", "html_url": "https://github.com/coleifer/peewee/pull/1947", "diff_url": "https://github.com/coleifer/peewee/pull/1947.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1947.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/1946
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1946/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1946/comments
https://api.github.com/repos/coleifer/peewee/issues/1946/events
https://github.com/coleifer/peewee/issues/1946
453,941,121
MDU6SXNzdWU0NTM5NDExMjE=
1,946
Mysql 1093 error
{ "login": "dzpt", "id": 5781080, "node_id": "MDQ6VXNlcjU3ODEwODA=", "avatar_url": "https://avatars.githubusercontent.com/u/5781080?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dzpt", "html_url": "https://github.com/dzpt", "followers_url": "https://api.github.com/users/dzpt/followers", ...
[]
closed
false
null
[]
null
[ "Found it there #1609 ", "`on_delete='CASCADE'`.", "Doesn't work on mysql 5.7.\r\ni have to upgrade to mariadb 10.3.15 to have `UPDATE Statements With the Same Source and Target`\r\nhttps://mariadb.com/kb/en/library/update/#update-statements-with-the-same-source-and-target", "MySQL has supported ON DELETE CAS...
2019-06-09T21:23:20
2019-06-10T17:27:07
2019-06-09T21:26:55
NONE
null
I got this error after trying to delete a record which has dependency like this with mysql 5.7: ``` class Topic(BaseModel): class Meta: table_name = 'forum_topic' id = AutoField() class Post(BaseModel): class Meta: table_name = 'forum_post' id = AutoField() reply_to: Po...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1946/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1946/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1945
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1945/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1945/comments
https://api.github.com/repos/coleifer/peewee/issues/1945/events
https://github.com/coleifer/peewee/issues/1945
453,702,688
MDU6SXNzdWU0NTM3MDI2ODg=
1,945
Add support (or docs) for how to create jsonb indexes for Postgres
{ "login": "jboothatgranular", "id": 19270303, "node_id": "MDQ6VXNlcjE5MjcwMzAz", "avatar_url": "https://avatars.githubusercontent.com/u/19270303?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jboothatgranular", "html_url": "https://github.com/jboothatgranular", "followers_url": "https://...
[]
closed
false
null
[]
null
[ "Don't be a hero:\r\n\r\n```python\r\ndb.execute_sql(\"create index idx_data_foo ON layer USING gin (data->'foo');\")\r\n```" ]
2019-06-07T21:34:58
2019-06-07T21:53:37
2019-06-07T21:53:37
NONE
null
I'm trying to create a gin index on a postgres jsonb column. ``` => \d layer Table "public.layer" Column | Type | Collation | Nullable | Default -------------------------+------------------------+-----------+----------+--------- data ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1945/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1945/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1944
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1944/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1944/comments
https://api.github.com/repos/coleifer/peewee/issues/1944/events
https://github.com/coleifer/peewee/issues/1944
453,063,911
MDU6SXNzdWU0NTMwNjM5MTE=
1,944
delete_instance with recursive=True only works with one level
{ "login": "dzpt", "id": 5781080, "node_id": "MDQ6VXNlcjU3ODEwODA=", "avatar_url": "https://avatars.githubusercontent.com/u/5781080?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dzpt", "html_url": "https://github.com/dzpt", "followers_url": "https://api.github.com/users/dzpt/followers", ...
[]
closed
false
null
[]
null
[ "Oh, yeah - I don't think it correctly handles foreign-keys to self. The best way is to lean on your database to handle this with an `on_delete=...` in your `ForeignKeyField()` declaration.", "@coleifer Oh, so what's the purpose of recursive flag, it only works for 1 level?\r\n\r\nhttps://github.com/coleifer/flas...
2019-06-06T14:29:44
2019-06-09T14:27:49
2019-06-09T14:27:49
NONE
null
I have a table with foreign key to itself ``` class Post(BaseModel): reply_to: Post = ForeignKeyField( 'self', null=True, default=None, backref='child_posts', on_delete='CASCADE') ``` Then in db if i have ``` id reply_to_id 1 nulll 2 1 3 2 4 3 5 4 ``` If i `delete_instance(True, True)` re...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1944/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1944/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1943
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1943/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1943/comments
https://api.github.com/repos/coleifer/peewee/issues/1943/events
https://github.com/coleifer/peewee/issues/1943
452,483,430
MDU6SXNzdWU0NTI0ODM0MzA=
1,943
Pandas DataFrame as peewee backend
{ "login": "isthisthat", "id": 1259045, "node_id": "MDQ6VXNlcjEyNTkwNDU=", "avatar_url": "https://avatars.githubusercontent.com/u/1259045?v=4", "gravatar_id": "", "url": "https://api.github.com/users/isthisthat", "html_url": "https://github.com/isthisthat", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "> sqlite writes and reads are painfully slow (10x slower) on my system through the python interface\r\n\r\nWhat driver are you using?\r\n\r\nHow are you executing these queries?\r\n\r\nCompared to what? C? The sqlite3 shell?\r\n\r\n> Is a pandas DataFrame something you might consider supporting as a back-end nativ...
2019-06-05T12:50:59
2019-06-05T14:57:31
2019-06-05T14:45:42
NONE
null
Hi @coleifer, for some reason sqlite writes and reads are painfully slow (10x slower) on my system through the python interface. System commands to sqlite are fast as expected. I've been experimenting replacing the sqlite back-end with a pandas DataFrame. I had some success using peewee Model select `.sql()` and then `...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1943/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1943/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1942
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1942/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1942/comments
https://api.github.com/repos/coleifer/peewee/issues/1942/events
https://github.com/coleifer/peewee/pull/1942
451,939,740
MDExOlB1bGxSZXF1ZXN0Mjg0OTI3NjQz
1,942
replace instance delete method with model delete method
{ "login": "fenngwd", "id": 8489549, "node_id": "MDQ6VXNlcjg0ODk1NDk=", "avatar_url": "https://avatars.githubusercontent.com/u/8489549?v=4", "gravatar_id": "", "url": "https://api.github.com/users/fenngwd", "html_url": "https://github.com/fenngwd", "followers_url": "https://api.github.com/users/fenngwd/...
[]
closed
false
null
[]
null
[ "Thanks! This makes sense to me.", "Another option would be for me to move those methods (delete, insert, select, update) to the metaclass instead. That would expose them as class-methods on model classes, but prevent you from accidentally calling them on a model instance. Might be worth doing in the near future....
2019-06-04T11:21:16
2019-06-04T11:50:21
2019-06-04T11:43:57
CONTRIBUTOR
null
The pitfalls of delete method in instance are numerous. It may cause unintended consequences, such as truncating table. I want to disable delete method call and raise warning in instance. After reading the code, I found that delete_instance use delete to do the actual dirty work in instance. Because of this, disabli...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1942/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1942/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1942", "html_url": "https://github.com/coleifer/peewee/pull/1942", "diff_url": "https://github.com/coleifer/peewee/pull/1942.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1942.patch", "merged_at": "2019-06-04T11:43:57" }
https://api.github.com/repos/coleifer/peewee/issues/1941
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1941/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1941/comments
https://api.github.com/repos/coleifer/peewee/issues/1941/events
https://github.com/coleifer/peewee/issues/1941
451,509,179
MDU6SXNzdWU0NTE1MDkxNzk=
1,941
alias function partly broken in peewee 3.9.4 and 3.9.5
{ "login": "anne17", "id": 1526661, "node_id": "MDQ6VXNlcjE1MjY2NjE=", "avatar_url": "https://avatars.githubusercontent.com/u/1526661?v=4", "gravatar_id": "", "url": "https://api.github.com/users/anne17", "html_url": "https://github.com/anne17", "followers_url": "https://api.github.com/users/anne17/foll...
[]
closed
false
null
[]
null
[ "Thanks, I've been able to replicate this and am working on a fix.", "Fixed, pushing a new release 3.9.6", "See also #1914", "Sorry to be bugging you again, but will you be pushing the new release to pypi?", "I thought I had, 3.9.6? https://github.com/coleifer/peewee/releases/tag/3.9.6", "Oh, guess not, d...
2019-06-03T14:16:33
2019-06-07T08:19:33
2019-06-03T14:56:47
NONE
null
I just upgraded from peewee 3.9.3 to 3.9.5 and suddenly I am getting the following error: ``` File "/home/anne/projects/recapi/recapi/views/recipe_data.py", line 39, in get_recipe_data User, pw.JOIN.LEFT_OUTER, on=(User.id == recipemodel.Recipe.created_by).alias("a") File "/home/anne/projects/recapi/venv/li...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1941/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1941/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1940
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1940/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1940/comments
https://api.github.com/repos/coleifer/peewee/issues/1940/events
https://github.com/coleifer/peewee/pull/1940
451,335,608
MDExOlB1bGxSZXF1ZXN0Mjg0NDQ2Mzg3
1,940
replace instance delete method with model delete method
{ "login": "fenngwd", "id": 8489549, "node_id": "MDQ6VXNlcjg0ODk1NDk=", "avatar_url": "https://avatars.githubusercontent.com/u/8489549?v=4", "gravatar_id": "", "url": "https://api.github.com/users/fenngwd", "html_url": "https://github.com/fenngwd", "followers_url": "https://api.github.com/users/fenngwd/...
[]
closed
false
null
[]
null
[]
2019-06-03T07:39:05
2019-06-03T16:09:32
2019-06-03T16:09:32
CONTRIBUTOR
null
The pitfalls of `delete` method in instance are numerous. It may cause unintended consequences, such as truncating table. I want to disable `delete` method call and raise warning in instance. After reading the code, I found that `delete_instance` use `delete` to do the actual dirty work in instance. Because of this,...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1940/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1940/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1940", "html_url": "https://github.com/coleifer/peewee/pull/1940", "diff_url": "https://github.com/coleifer/peewee/pull/1940.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1940.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/1939
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1939/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1939/comments
https://api.github.com/repos/coleifer/peewee/issues/1939/events
https://github.com/coleifer/peewee/issues/1939
449,696,029
MDU6SXNzdWU0NDk2OTYwMjk=
1,939
Peewee 3.9.5 throws TypeError on Windows running Python 3.7
{ "login": "sn0opy", "id": 49074, "node_id": "MDQ6VXNlcjQ5MDc0", "avatar_url": "https://avatars.githubusercontent.com/u/49074?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sn0opy", "html_url": "https://github.com/sn0opy", "followers_url": "https://api.github.com/users/sn0opy/followers", ...
[]
closed
false
null
[]
null
[ "What-the-what? Can you share how you're setting up and tearing down your connections? This seems like it should only happen if two conns are created at the *exact same timestamp*.", "The code is open source. I'm linking the diff to the python2 to 3 migration. Unfortunately, I', not really that much into peewee a...
2019-05-29T09:26:30
2019-05-30T20:11:17
2019-05-30T20:11:16
NONE
null
I'm getting the following stack trace running on Windows with Python 3.7. The exact same code runs fine on Linux with Python 3.5 up to 3.7. Is there anything, that has to be tweaked in my own code to run on Windows properly or is there an actual issue in Peewee's code? The Flask version being used on Linux and Windo...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1939/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1939/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1938
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1938/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1938/comments
https://api.github.com/repos/coleifer/peewee/issues/1938/events
https://github.com/coleifer/peewee/issues/1938
448,426,697
MDU6SXNzdWU0NDg0MjY2OTc=
1,938
Handle missing record for ForeignKeyField
{ "login": "dzpt", "id": 5781080, "node_id": "MDQ6VXNlcjU3ODEwODA=", "avatar_url": "https://avatars.githubusercontent.com/u/5781080?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dzpt", "html_url": "https://github.com/dzpt", "followers_url": "https://api.github.com/users/dzpt/followers", ...
[]
closed
false
null
[]
null
[ "> After the record has been deleted but still has reference from other table, i'll get *DoesNotExist: instance matching query does not exist error if i access to record.edited_by_user\r\n\r\nWhat do you mean, you have orphaned `User` instances? e.g., the `edited_by_user` column contains a user id for which no corr...
2019-05-25T06:24:35
2019-05-26T03:02:38
2019-05-26T03:02:38
NONE
null
`edited_by_user = ForeignKeyField(User, null=True)` After the record has been deleted but still has reference from other table, i'll get `*DoesNotExist: instance matching query does not exist error if i access to record.edited_by_user` How do i get rid of it like the record is null then return None like `get_or_n...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1938/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1938/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1937
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1937/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1937/comments
https://api.github.com/repos/coleifer/peewee/issues/1937/events
https://github.com/coleifer/peewee/issues/1937
448,353,953
MDU6SXNzdWU0NDgzNTM5NTM=
1,937
Syntax for using json_each in subquery
{ "login": "brandond", "id": 370103, "node_id": "MDQ6VXNlcjM3MDEwMw==", "avatar_url": "https://avatars.githubusercontent.com/u/370103?v=4", "gravatar_id": "", "url": "https://api.github.com/users/brandond", "html_url": "https://github.com/brandond", "followers_url": "https://api.github.com/users/brandon...
[]
closed
false
null
[]
null
[ "Hmm, I think I found something that works, although I'm not sure if it's the best way to do it:\r\n\r\n```python\r\ntve = peewee.fn.json_each('[1,2,3]').alias('tve')\r\ninactive_users = peewee.Select(from_list=[tve], columns=[tve.c.value]).cte('inactive_users')\r\ndq = (Tweet\r\n .delete()\r\n .where(Twe...
2019-05-24T21:08:17
2019-05-28T20:26:28
2019-05-28T17:03:53
NONE
null
I'm trying to do something like this: ```sql DELETE FROM tweet WHERE tweet.user_id IN (SELECT value FROM json_each('[1,2,3]')) ``` I have tried something like this, but it ends up selecting the literal string 'value' instead of the value column: ```python inactive_users = peewee.Select(from_list=[peewee.fn....
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1937/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1937/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1936
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1936/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1936/comments
https://api.github.com/repos/coleifer/peewee/issues/1936/events
https://github.com/coleifer/peewee/issues/1936
447,466,285
MDU6SXNzdWU0NDc0NjYyODU=
1,936
python 3.6.8 DateTimeField formats 无效
{ "login": "itmeryn", "id": 18156931, "node_id": "MDQ6VXNlcjE4MTU2OTMx", "avatar_url": "https://avatars.githubusercontent.com/u/18156931?v=4", "gravatar_id": "", "url": "https://api.github.com/users/itmeryn", "html_url": "https://github.com/itmeryn", "followers_url": "https://api.github.com/users/itmery...
[]
closed
false
null
[]
null
[ "Is there a question? Under certain conditions and depending on your database driver, the date/time may be returned from the database cursor as a string. Similarly if you're loading csv or json into your date/time-field, it may be a string.", "按照截图的逻辑 就会直接返回value 字段中配置的format 并没有生效", "English. Still not a clue...
2019-05-23T06:09:26
2019-05-26T14:04:41
2019-05-23T10:29:57
NONE
null
![image](https://user-images.githubusercontent.com/18156931/58228949-d8424700-7d62-11e9-9da3-52b2f3186a78.png) ![image](https://user-images.githubusercontent.com/18156931/58229447-594e0e00-7d64-11e9-8333-1846d7f37ea0.png) ![image](https://user-images.githubusercontent.com/18156931/58229453-5d7a2b80-7d64-11e9-83db-...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1936/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1936/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1935
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1935/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1935/comments
https://api.github.com/repos/coleifer/peewee/issues/1935/events
https://github.com/coleifer/peewee/issues/1935
447,323,241
MDU6SXNzdWU0NDczMjMyNDE=
1,935
Auto change IntegerField to ForeignKeyField?
{ "login": "dzpt", "id": 5781080, "node_id": "MDQ6VXNlcjU3ODEwODA=", "avatar_url": "https://avatars.githubusercontent.com/u/5781080?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dzpt", "html_url": "https://github.com/dzpt", "followers_url": "https://api.github.com/users/dzpt/followers", ...
[]
closed
false
null
[]
null
[ "When you write:\r\n\r\n```python\r\ngroup = ForeignKeyField(AdminGroup)\r\n```\r\n\r\nPeewee will add a column `group_id` which stores the related `AdminGroup.id` value. So you're stepping on your own toes.\r\n\r\nAdditionally, every `ForeignKeyField` by default will add a \"<field_name>_id\" descriptor to the mod...
2019-05-22T20:16:04
2019-05-22T20:58:17
2019-05-22T20:43:40
NONE
null
I have a model like this ``` class AdminUser(BaseModel): class Meta: table_name = '_admin_user' id = AutoField() group_id = IntegerField() group: AdminGroup = ForeignKeyField(AdminGroup) ``` After checking type of `group_id` field by using `type(getattr(model, 'group_id')`, it beco...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1935/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1935/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1934
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1934/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1934/comments
https://api.github.com/repos/coleifer/peewee/issues/1934/events
https://github.com/coleifer/peewee/issues/1934
446,007,532
MDU6SXNzdWU0NDYwMDc1MzI=
1,934
Rawquery with table name doesn't work?!
{ "login": "dzpt", "id": 5781080, "node_id": "MDQ6VXNlcjU3ODEwODA=", "avatar_url": "https://avatars.githubusercontent.com/u/5781080?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dzpt", "html_url": "https://github.com/dzpt", "followers_url": "https://api.github.com/users/dzpt/followers", ...
[]
closed
false
null
[]
null
[ "You can't put the table-name in as a parameterized query with your MySQL driver. Simple as that. For instance, with SQLite, this comes up in other places, too -- like if you're creating an INDEX on an expression, you can't use parameter placeholders for the expression values." ]
2019-05-20T09:16:48
2019-05-20T11:42:03
2019-05-20T11:42:03
NONE
null
Mysql 5.7 Peewee 3.9.5 - I use this code `db.execute_sql("select count(*) from %s", ('_admin_group',))` and got this `peewee.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''_admin_group'' at line ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1934/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1934/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1933
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1933/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1933/comments
https://api.github.com/repos/coleifer/peewee/issues/1933/events
https://github.com/coleifer/peewee/issues/1933
444,358,757
MDU6SXNzdWU0NDQzNTg3NTc=
1,933
How to generate sql to carry database name?
{ "login": "ztj1993", "id": 13493380, "node_id": "MDQ6VXNlcjEzNDkzMzgw", "avatar_url": "https://avatars.githubusercontent.com/u/13493380?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ztj1993", "html_url": "https://github.com/ztj1993", "followers_url": "https://api.github.com/users/ztj199...
[]
closed
false
null
[]
null
[ "Yes, you can use the `schema` parameter:\r\n\r\n```python\r\nclass AttrModel(Model):\r\n id = AutoField() # NOTE: use AutoField, not PrimaryKeyField, which is deprecated.\r\n\r\n class Meta:\r\n table_name = 'attrs'\r\n schema = 'silo'\r\n\r\n# AttrModel will now be queried like \"select * fro...
2019-05-15T10:26:05
2019-05-16T01:23:22
2019-05-15T11:52:26
NONE
null
model: ``` class AttrModel(Model): id = PrimaryKeyField(help_text='id') class Meta: table_name = 'attrs' database = MySQLDatabase(database='silo') ``` generate sql: ``` sql = AttrModel.select().sql() print(sql) ``` result: ``` ('SELECT `t1`.`id` FROM `attrs` AS `t1`', []) ``` ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1933/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1933/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1932
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1932/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1932/comments
https://api.github.com/repos/coleifer/peewee/issues/1932/events
https://github.com/coleifer/peewee/issues/1932
444,306,592
MDU6SXNzdWU0NDQzMDY1OTI=
1,932
Get initial value of dirty fields.
{ "login": "lalit-lintel", "id": 26576603, "node_id": "MDQ6VXNlcjI2NTc2NjAz", "avatar_url": "https://avatars.githubusercontent.com/u/26576603?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lalit-lintel", "html_url": "https://github.com/lalit-lintel", "followers_url": "https://api.github.c...
[]
closed
false
null
[]
null
[ "> It is great if peewee also manages the old/initial value of fields when it gets changed.\r\n>\r\n> There anything is available which can help to get the inital value of fields?\r\n\r\nYou need to manage this yourself, unfortunately.\r\n\r\nPeewee has very simplistic tracking for when fields are assigned, but thi...
2019-05-15T08:35:37
2019-05-17T05:07:44
2019-05-15T11:56:14
NONE
null
Peewee has a feature that manages dirty fields. It managing the list of fields name, which is changed, but not the old/initial value of those fields. It is great if peewee also manages the old/initial value of fields when it gets changed. There anything is available which can help to get the inital value of fie...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1932/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1932/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1931
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1931/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1931/comments
https://api.github.com/repos/coleifer/peewee/issues/1931/events
https://github.com/coleifer/peewee/issues/1931
443,944,983
MDU6SXNzdWU0NDM5NDQ5ODM=
1,931
bulk_create throws NotNullViolation when DEFAULT constraint is present
{ "login": "ymrzkrrs", "id": 43073619, "node_id": "MDQ6VXNlcjQzMDczNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/43073619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ymrzkrrs", "html_url": "https://github.com/ymrzkrrs", "followers_url": "https://api.github.com/users/ymr...
[]
closed
false
null
[]
null
[ "I switched to using `default=datetime.today` with bulk_create for this use case, as it fills the field value before inserting.", "Peewee is not exactly aware of defaults implemented on the server. It can work with them, but it's not the same as using the `default=` python-side implementation.\r\n\r\nTo get bulk ...
2019-05-14T14:22:39
2019-05-14T15:02:46
2019-05-14T15:02:46
NONE
null
I have the following model: ``` class Summary(Model): start_date = DateField(formats=['%Y-%m-%d']) end_date = DateField(formats=['%Y-%m-%d'], constraints=[SQL('DEFAULT CURRENT_DATE')]) class Meta: database = db db_table = 'test_table' ``` If I insert using: ``` summa...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1931/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1931/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1930
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1930/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1930/comments
https://api.github.com/repos/coleifer/peewee/issues/1930/events
https://github.com/coleifer/peewee/pull/1930
443,497,188
MDExOlB1bGxSZXF1ZXN0Mjc4MzUyMDMy
1,930
Fix empty bulk_create error
{ "login": "vicrac", "id": 26183214, "node_id": "MDQ6VXNlcjI2MTgzMjE0", "avatar_url": "https://avatars.githubusercontent.com/u/26183214?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vicrac", "html_url": "https://github.com/vicrac", "followers_url": "https://api.github.com/users/vicrac/fo...
[]
closed
false
null
[]
null
[]
2019-05-13T16:40:40
2019-05-13T17:00:27
2019-05-13T17:00:27
NONE
null
I noticed that attempt to insert an empty bulk to database (sqlite in my case) is causing following error: ``` Traceback (most recent call last): File "/home/vicrac/peewee/peewee.py", line 2946, in execute_sql cursor.execute(sql, params or ()) sqlite3.OperationalError: incomplete input During handling of ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1930/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1930/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1930", "html_url": "https://github.com/coleifer/peewee/pull/1930", "diff_url": "https://github.com/coleifer/peewee/pull/1930.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1930.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/1929
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1929/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1929/comments
https://api.github.com/repos/coleifer/peewee/issues/1929/events
https://github.com/coleifer/peewee/issues/1929
442,928,783
MDU6SXNzdWU0NDI5Mjg3ODM=
1,929
jsonb_to_recordset usage
{ "login": "alejandrohenriquez", "id": 1672932, "node_id": "MDQ6VXNlcjE2NzI5MzI=", "avatar_url": "https://avatars.githubusercontent.com/u/1672932?v=4", "gravatar_id": "", "url": "https://api.github.com/users/alejandrohenriquez", "html_url": "https://github.com/alejandrohenriquez", "followers_url": "http...
[]
closed
false
null
[]
null
[]
2019-05-10T23:42:44
2019-05-10T23:45:01
2019-05-10T23:45:01
NONE
null
I need use the postgresql function jsonb_to_recordset (https://www.postgresql.org/docs/current/functions-json.html) in an Insert/Select context. How could I implement this? Best Regards
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1929/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1929/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1928
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1928/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1928/comments
https://api.github.com/repos/coleifer/peewee/issues/1928/events
https://github.com/coleifer/peewee/issues/1928
442,864,307
MDU6SXNzdWU0NDI4NjQzMDc=
1,928
SQLite: Check constraint to check if value is in list causes infinite loop
{ "login": "HashFail", "id": 4693508, "node_id": "MDQ6VXNlcjQ2OTM1MDg=", "avatar_url": "https://avatars.githubusercontent.com/u/4693508?v=4", "gravatar_id": "", "url": "https://api.github.com/users/HashFail", "html_url": "https://github.com/HashFail", "followers_url": "https://api.github.com/users/HashF...
[]
closed
false
null
[]
null
[ "Try\r\n\r\n`constraints=[Check(\"test in ('http', 'smb')\")]`", "Oh, derp. Thanks!" ]
2019-05-10T19:30:58
2019-05-10T20:16:45
2019-05-10T20:16:45
NONE
null
Maybe this isn't supported, but it seems like a parse error to me. Minimal example: ```python from peewee import SqliteDatabase, CharField, Check from playhouse.signals import Model class Test(Model): database = SqliteDatabase('test.db') database.connect() test = CharField(constraints=Check("...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1928/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1928/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1927
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1927/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1927/comments
https://api.github.com/repos/coleifer/peewee/issues/1927/events
https://github.com/coleifer/peewee/pull/1927
441,438,881
MDExOlB1bGxSZXF1ZXN0Mjc2NzY1OTU5
1,927
Makes minor spelling or grammar changes
{ "login": "fpcorso", "id": 9730040, "node_id": "MDQ6VXNlcjk3MzAwNDA=", "avatar_url": "https://avatars.githubusercontent.com/u/9730040?v=4", "gravatar_id": "", "url": "https://api.github.com/users/fpcorso", "html_url": "https://github.com/fpcorso", "followers_url": "https://api.github.com/users/fpcorso/...
[]
closed
false
null
[]
null
[]
2019-05-07T20:46:39
2019-05-07T21:01:01
2019-05-07T21:01:01
NONE
null
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1927/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1927/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1927", "html_url": "https://github.com/coleifer/peewee/pull/1927", "diff_url": "https://github.com/coleifer/peewee/pull/1927.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1927.patch", "merged_at": null }
https://api.github.com/repos/coleifer/peewee/issues/1926
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1926/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1926/comments
https://api.github.com/repos/coleifer/peewee/issues/1926/events
https://github.com/coleifer/peewee/issues/1926
441,169,215
MDU6SXNzdWU0NDExNjkyMTU=
1,926
user-defined function from int to string gives ValueError when printed
{ "login": "isthisthat", "id": 1259045, "node_id": "MDQ6VXNlcjEyNTkwNDU=", "avatar_url": "https://avatars.githubusercontent.com/u/1259045?v=4", "gravatar_id": "", "url": "https://api.github.com/users/isthisthat", "html_url": "https://github.com/isthisthat", "followers_url": "https://api.github.com/users...
[]
closed
false
null
[]
null
[ "Peewee looks at the field type when converting values coming back from the DB. What version of Peewee are you using, by chance? In more recent versions, the conversion logic was made a little bit more forgiving, allowing fallback to the original value.\r\n\r\nThis works, for ex:\r\n\r\n```python\r\ndb = SqliteData...
2019-05-07T10:58:40
2019-05-07T16:15:46
2019-05-07T15:40:05
NONE
null
Setup: from enum import Enum from peewee import * from playhouse.sqlite_ext import SqliteExtDatabase DNA = Enum('DNA', {"N":-1, "A":1, "T":2, "C":3, "G":4}) db = Proxy() def toDNA(n): return DNA(n).name.upper() class Base(Model): abase = IntegerField(default=-1...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1926/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1926/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1925
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1925/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1925/comments
https://api.github.com/repos/coleifer/peewee/issues/1925/events
https://github.com/coleifer/peewee/issues/1925
440,896,729
MDU6SXNzdWU0NDA4OTY3Mjk=
1,925
Unable to join to model on backreference select()
{ "login": "brandond", "id": 370103, "node_id": "MDQ6VXNlcjM3MDEwMw==", "avatar_url": "https://avatars.githubusercontent.com/u/370103?v=4", "gravatar_id": "", "url": "https://api.github.com/users/brandond", "html_url": "https://github.com/brandond", "followers_url": "https://api.github.com/users/brandon...
[]
closed
false
null
[]
null
[ "~~What is `Plugin` in this context? Is it a model class? Model alias?~~\r\n\r\nOh, actually nevermind! When re-selecting from an existing query, it seems like there's a bug when you pass a model class directly in.\r\n\r\nFor now, just explicitly specify the fields or list them, e.g.:\r\n\r\n```python\r\n re...
2019-05-06T21:13:10
2019-05-06T23:58:52
2019-05-06T21:31:19
NONE
null
I have the following canned query that I expose as a property on a subclass of one of my models. `plugin_incidendents` is a backreference from the PluginIncident model to this model. ```python class RemediationGroupBase(peewee.Model) # model definition here class RemediationGroup(RemediationGroupBase) ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1925/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1925/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1924
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1924/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1924/comments
https://api.github.com/repos/coleifer/peewee/issues/1924/events
https://github.com/coleifer/peewee/issues/1924
440,609,016
MDU6SXNzdWU0NDA2MDkwMTY=
1,924
IndexError: tuple index out of range when using db.execute_sql
{ "login": "ymrzkrrs", "id": 43073619, "node_id": "MDQ6VXNlcjQzMDczNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/43073619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ymrzkrrs", "html_url": "https://github.com/ymrzkrrs", "followers_url": "https://api.github.com/users/ymr...
[]
closed
false
null
[]
null
[ "I think your example is not correct or you're not providing all the information. Something doesn't make sense.\r\n\r\nFor example, this works fine:\r\n\r\n```python\r\nfrom peewee import *\r\ndb = PostgresqlDatabase('some_db')\r\nprint(db.execute_sql('SELECT current_timestamp').fetchone())\r\n```\r\n\r\nThe `execu...
2019-05-06T09:15:18
2019-08-14T17:09:09
2019-05-06T14:11:13
NONE
null
I have function to create on PostgreSQL: ``` jsonb_flatten_function = """ create or replace function create_jsonb_flat_view (view_name text, table_name text, regular_columns text, json_column text) returns text language plpgsql as $$ declare cols text; begin execute format ($ex$ select...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1924/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1924/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1923
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1923/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1923/comments
https://api.github.com/repos/coleifer/peewee/issues/1923/events
https://github.com/coleifer/peewee/issues/1923
440,579,626
MDU6SXNzdWU0NDA1Nzk2MjY=
1,923
SQL Syntax Error in Model.save() when row is empty
{ "login": "0az", "id": 30874884, "node_id": "MDQ6VXNlcjMwODc0ODg0", "avatar_url": "https://avatars.githubusercontent.com/u/30874884?v=4", "gravatar_id": "", "url": "https://api.github.com/users/0az", "html_url": "https://github.com/0az", "followers_url": "https://api.github.com/users/0az/followers", ...
[]
closed
false
null
[]
null
[ "This seems contrived and I'm wondering how it even would come about in practice. Your model definition does not match the UPDATE statement you've shared, either.\r\n\r\nWhen you instantiate a model, it has an empty data dict. If you call `.create()` without any kwargs, this is effectively the same as instantiating...
2019-05-06T07:47:21
2019-05-06T16:41:05
2019-05-06T14:00:45
CONTRIBUTOR
null
When `save()` is called on a row with nothing to save, there is a SQL syntax error caused by a lack of fields to update: `('UPDATE "foo" SET WHERE ("foo"."foo" = ?)', [0])`. <details><summary>MCVE</summary> from peewee import IntegerField, Model, SqliteDatabase db = SqliteDatabase(':memory:') ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1923/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1923/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1922
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1922/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1922/comments
https://api.github.com/repos/coleifer/peewee/issues/1922/events
https://github.com/coleifer/peewee/pull/1922
440,570,259
MDExOlB1bGxSZXF1ZXN0Mjc2MDg1Nzk3
1,922
Replace deprecated PrimaryKeyField with AutoField in docs
{ "login": "0az", "id": 30874884, "node_id": "MDQ6VXNlcjMwODc0ODg0", "avatar_url": "https://avatars.githubusercontent.com/u/30874884?v=4", "gravatar_id": "", "url": "https://api.github.com/users/0az", "html_url": "https://github.com/0az", "followers_url": "https://api.github.com/users/0az/followers", ...
[]
closed
false
null
[]
null
[ "Danke." ]
2019-05-06T07:20:59
2019-05-06T13:53:09
2019-05-06T13:53:06
CONTRIBUTOR
null
<details> <summary>Grep after change</summary> > rg -i 'PrimaryKeyField' CHANGELOG.md 885:Re-add a shim for `PrimaryKeyField` (renamed to `AutoField`) and log a tests/fields.py 450:class TestCompositePrimaryKeyField(ModelTestCase): peewee.py 124: 'PrimaryKeyField', ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1922/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1922/timeline
null
null
false
{ "url": "https://api.github.com/repos/coleifer/peewee/pulls/1922", "html_url": "https://github.com/coleifer/peewee/pull/1922", "diff_url": "https://github.com/coleifer/peewee/pull/1922.diff", "patch_url": "https://github.com/coleifer/peewee/pull/1922.patch", "merged_at": "2019-05-06T13:53:06" }
https://api.github.com/repos/coleifer/peewee/issues/1921
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1921/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1921/comments
https://api.github.com/repos/coleifer/peewee/issues/1921/events
https://github.com/coleifer/peewee/issues/1921
440,199,552
MDU6SXNzdWU0NDAxOTk1NTI=
1,921
SQLError: row value misused after upgrade
{ "login": "brandond", "id": 370103, "node_id": "MDQ6VXNlcjM3MDEwMw==", "avatar_url": "https://avatars.githubusercontent.com/u/370103?v=4", "gravatar_id": "", "url": "https://api.github.com/users/brandond", "html_url": "https://github.com/brandond", "followers_url": "https://api.github.com/users/brandon...
[]
closed
false
null
[]
null
[ "Try rather than using distinct as a function, to append a call to .distinct() at the end of the query.", "If I go back to 3.6.4 and rerun the exact same sequence, it looks like 3.9.5 is putting parentheses around the column list that weren't there before:\r\n\r\n```\r\n3.9.5: ('SELECT COUNT(1) FROM (SELECT DISTI...
2019-05-03T20:00:44
2019-05-05T12:35:51
2019-05-05T07:45:47
NONE
null
I recently updated to 3.9.5 and I'm now experiencing the following errors with a query that was previously working: ``` [DEBUG] 2019-05-03T19:05:14.901Z 1eeeb36c-0a1e-44ec-91b8-ddd09d60ed4e ('SELECT COUNT(1) FROM (SELECT DISTINCT ("t1"."ip_address", "t1"."port", "t1"."protocol", "t1"."plugin_id", "t1"."fi...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1921/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1921/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1920
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1920/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1920/comments
https://api.github.com/repos/coleifer/peewee/issues/1920/events
https://github.com/coleifer/peewee/issues/1920
440,076,331
MDU6SXNzdWU0NDAwNzYzMzE=
1,920
Foreign Key creation during create_table does not use reference field length
{ "login": "geonyoro", "id": 10379310, "node_id": "MDQ6VXNlcjEwMzc5MzEw", "avatar_url": "https://avatars.githubusercontent.com/u/10379310?v=4", "gravatar_id": "", "url": "https://api.github.com/users/geonyoro", "html_url": "https://github.com/geonyoro", "followers_url": "https://api.github.com/users/geo...
[]
closed
false
null
[]
null
[ "What exactly is the error you are encountering? The linked ticket does not strike me as being relevant.\r\n\r\nHow is this varchar foreign-key field being declared? How is the field it is pointing to declared?", "```python\r\nclass ReleaseASINMap(BaseModel):\r\n release_id = peewee.CharField(max_length=51, un...
2019-05-03T14:38:06
2019-05-06T08:12:58
2019-05-04T13:21:06
NONE
null
I have a table using InnoDB engine in MySQL. The field I want to reference is a varchar of 51. Using the create_table or create_tables([Table]) syntax to create it, the created foreign key field is varchar of 255, leading an error #150.
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1920/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1920/timeline
null
completed
null
null
https://api.github.com/repos/coleifer/peewee/issues/1919
https://api.github.com/repos/coleifer/peewee
https://api.github.com/repos/coleifer/peewee/issues/1919/labels{/name}
https://api.github.com/repos/coleifer/peewee/issues/1919/comments
https://api.github.com/repos/coleifer/peewee/issues/1919/events
https://github.com/coleifer/peewee/issues/1919
439,776,015
MDU6SXNzdWU0Mzk3NzYwMTU=
1,919
Bug in mapping to class?
{ "login": "ruby99", "id": 18327723, "node_id": "MDQ6VXNlcjE4MzI3NzIz", "avatar_url": "https://avatars.githubusercontent.com/u/18327723?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ruby99", "html_url": "https://github.com/ruby99", "followers_url": "https://api.github.com/users/ruby99/fo...
[]
closed
false
null
[]
null
[ "Can you use readable names here? Wtf is r, ou, backr.", "Oh, also: is this a regression? If so, What is the last version in which this worked?", "regarding 2nd comment, IDK. I'm evaluating if peewee can replace django's orm for one of my projects.", "regarding 1st comment:\r\n\r\n```\r\nclass OU(peewee.Model...
2019-05-02T20:33:19
2019-05-03T12:06:02
2019-05-03T03:30:48
NONE
null
Hello, ``` >>> peewee.__version__ '3.9.5' ``` ``` Back = R.alias() BackOU = OU.alias() R.select(BackOU).join(OU).switch(R).join(Back, on=R.back).join(BackOU).where(OU.name=="G-CK-p1").group_by(BackOU) ``` while SQL seems about right: ```sql SELECT "t1"."id", "t1"."name" FROM "r" AS "t2" INNER ...
{ "url": "https://api.github.com/repos/coleifer/peewee/issues/1919/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/coleifer/peewee/issues/1919/timeline
null
completed
null
null