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/514 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/514/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/514/comments | https://api.github.com/repos/coleifer/peewee/issues/514/events | https://github.com/coleifer/peewee/issues/514 | 55,682,558 | MDU6SXNzdWU1NTY4MjU1OA== | 514 | UUID foreign keys are not cast properly | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"Awesome thanks charles!\n"
] | 2015-01-27T22:16:08 | 2015-01-29T06:12:46 | 2015-01-29T02:17:14 | CONTRIBUTOR | null | Found this out by trying to use prefetch and it failing for no reason. I thought it was a problem with the id_map not find the appropriate relation to match on because the data is coming back but simply it's a type mismatch, one is a string and the other is a UUID thus no match :(
https://github.com/coleifer/peewee/bl... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/514/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/514/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/513 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/513/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/513/comments | https://api.github.com/repos/coleifer/peewee/issues/513/events | https://github.com/coleifer/peewee/pull/513 | 55,511,597 | MDExOlB1bGxSZXF1ZXN0MjgwNDQyNTU= | 513 | query results length | {
"login": "dpep",
"id": 918804,
"node_id": "MDQ6VXNlcjkxODgwNA==",
"avatar_url": "https://avatars.githubusercontent.com/u/918804?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dpep",
"html_url": "https://github.com/dpep",
"followers_url": "https://api.github.com/users/dpep/followers",
... | [] | closed | false | null | [] | null | [
"Can you define \"exploded\"?\n",
"There is already the `SelectQuery.count()` method, which handles some edge-cases, so I'm loth to add another method that does the same thing.\n",
"exploded = throws an exception\n\n> TypeError: object of type 'SelectQuery' has no len()\n\nit just felt like the query results ob... | 2015-01-26T17:29:22 | 2015-10-31T05:40:21 | 2015-10-31T03:55:05 | CONTRIBUTOR | null | a couple times i tried to call len() on the results of a query and it exploded...figured this would be good functionality to add. if you only want a count, i realize that a SELECT COUNT(*) should be used, but there are also times when it would be nice to see how many results i got and use them
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/513/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/513/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/513",
"html_url": "https://github.com/coleifer/peewee/pull/513",
"diff_url": "https://github.com/coleifer/peewee/pull/513.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/513.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/512 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/512/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/512/comments | https://api.github.com/repos/coleifer/peewee/issues/512/events | https://github.com/coleifer/peewee/issues/512 | 55,342,782 | MDU6SXNzdWU1NTM0Mjc4Mg== | 512 | Support UNION ALL | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [] | 2015-01-23T22:44:11 | 2015-01-24T23:59:19 | 2015-01-24T23:59:19 | OWNER | null | Add support for UNION ALL queries.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/512/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/512/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/511 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/511/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/511/comments | https://api.github.com/repos/coleifer/peewee/issues/511/events | https://github.com/coleifer/peewee/pull/511 | 55,226,767 | MDExOlB1bGxSZXF1ZXN0Mjc4ODk5MDg= | 511 | default values | {
"login": "dpep",
"id": 918804,
"node_id": "MDQ6VXNlcjkxODgwNA==",
"avatar_url": "https://avatars.githubusercontent.com/u/918804?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dpep",
"html_url": "https://github.com/dpep",
"followers_url": "https://api.github.com/users/dpep/followers",
... | [] | closed | false | null | [] | null | [
"Peewee makes a point of not setting default DB values, so the current behavior is correct.\n",
"was it too complicated to get right across platforms?\n",
"My feeling was that it could lead to confusing behavior on the python side. If you really want it, you can always use SQL to accomplish default DB values, b... | 2015-01-22T23:53:34 | 2015-01-23T00:46:26 | 2015-01-23T00:03:13 | CONTRIBUTOR | null | field default values were being ignored for column creations and modifications. this change ensures that a field marked with a default value creates a default value in the db. tested this change through the standard Model table creation and schema migrator add_column() function, in mysql and sqlite
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/511/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/511/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/511",
"html_url": "https://github.com/coleifer/peewee/pull/511",
"diff_url": "https://github.com/coleifer/peewee/pull/511.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/511.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/510 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/510/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/510/comments | https://api.github.com/repos/coleifer/peewee/issues/510/events | https://github.com/coleifer/peewee/issues/510 | 55,202,261 | MDU6SXNzdWU1NTIwMjI2MQ== | 510 | Duplicate field names after stripping '_id' suffix | {
"login": "teeberg",
"id": 199071,
"node_id": "MDQ6VXNlcjE5OTA3MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/199071?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/teeberg",
"html_url": "https://github.com/teeberg",
"followers_url": "https://api.github.com/users/teeberg/fo... | [] | closed | false | null | [] | null | [
"That was an awesome response time! :-) Thanks so much!\n",
"NP! I really appreciate the bug report.\n"
] | 2015-01-22T20:09:41 | 2015-01-23T07:10:54 | 2015-01-23T01:24:58 | NONE | null | For reasons that are beyond me, I'm working on a database that often has fields which have the same name except for the `_id` part at the end, that is one called e.g. `language` and one `language_id`. Generating models for this table using pwiz gives me model definitions like:
```
language = CharField()
language = Int... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/510/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/510/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/509 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/509/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/509/comments | https://api.github.com/repos/coleifer/peewee/issues/509/events | https://github.com/coleifer/peewee/pull/509 | 55,142,358 | MDExOlB1bGxSZXF1ZXN0Mjc4MzUzMTQ= | 509 | Revert "Fix Model.create_table(fail_silently=True) if schema is used." | {
"login": "stas",
"id": 112147,
"node_id": "MDQ6VXNlcjExMjE0Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/112147?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stas",
"html_url": "https://github.com/stas",
"followers_url": "https://api.github.com/users/stas/followers",
... | [] | closed | false | null | [] | null | [
"I took a different approach that should work the same.\n",
"Thanks for taking care of it!\n"
] | 2015-01-22T11:27:23 | 2015-01-22T18:20:46 | 2015-01-22T17:42:00 | NONE | null | This commit introduces a regression by overwriting the `PostgresqlDatabase.get_tables()` default value for `schema`.
``` python
(Pdb) db
<playhouse.pool.PooledPostgresqlExtDatabase object at 0xb620964c>
(Pdb) db.get_tables(schema=None)
[]
(Pdb) db.get_tables()
[u'migration', u'users']
```
One of the affected projects... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/509/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/509/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/509",
"html_url": "https://github.com/coleifer/peewee/pull/509",
"diff_url": "https://github.com/coleifer/peewee/pull/509.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/509.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/508 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/508/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/508/comments | https://api.github.com/repos/coleifer/peewee/issues/508/events | https://github.com/coleifer/peewee/pull/508 | 55,132,243 | MDExOlB1bGxSZXF1ZXN0Mjc4Mjg4MjI= | 508 | primary null values | {
"login": "dpep",
"id": 918804,
"node_id": "MDQ6VXNlcjkxODgwNA==",
"avatar_url": "https://avatars.githubusercontent.com/u/918804?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dpep",
"html_url": "https://github.com/dpep",
"followers_url": "https://api.github.com/users/dpep/followers",
... | [] | closed | false | null | [] | null | [
"Cool, thnx!\n"
] | 2015-01-22T09:37:07 | 2015-01-22T21:32:03 | 2015-01-22T17:43:49 | CONTRIBUTOR | null | MySQL does not allow primary key fields to be null. while it silently swallows any request to allow null values, this library ought to point out the failure to users
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/508/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/508/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/508",
"html_url": "https://github.com/coleifer/peewee/pull/508",
"diff_url": "https://github.com/coleifer/peewee/pull/508.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/508.patch",
"merged_at": "2015-01-22T17:43:49"
} |
https://api.github.com/repos/coleifer/peewee/issues/507 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/507/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/507/comments | https://api.github.com/repos/coleifer/peewee/issues/507/events | https://github.com/coleifer/peewee/pull/507 | 55,132,068 | MDExOlB1bGxSZXF1ZXN0Mjc4Mjg3MTQ= | 507 | key renames | {
"login": "dpep",
"id": 918804,
"node_id": "MDQ6VXNlcjkxODgwNA==",
"avatar_url": "https://avatars.githubusercontent.com/u/918804?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dpep",
"html_url": "https://github.com/dpep",
"followers_url": "https://api.github.com/users/dpep/followers",
... | [] | closed | false | null | [] | null | [] | 2015-01-22T09:35:20 | 2018-01-31T12:42:24 | 2018-01-31T12:42:24 | CONTRIBUTOR | null | MySQL does wierd things when altering the columns of unique or primary keys. It acts as though the user is tring to duplicate the field, rather than simply changing / renaming it (see error messages below). Dropping these keywords from the query gives us the descired outcome anyway (keys remain keys without need to r... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/507/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/507/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/507",
"html_url": "https://github.com/coleifer/peewee/pull/507",
"diff_url": "https://github.com/coleifer/peewee/pull/507.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/507.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/506 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/506/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/506/comments | https://api.github.com/repos/coleifer/peewee/issues/506/events | https://github.com/coleifer/peewee/issues/506 | 55,120,106 | MDU6SXNzdWU1NTEyMDEwNg== | 506 | Not support self aggregate alias join any more? | {
"login": "BusyJay",
"id": 1701473,
"node_id": "MDQ6VXNlcjE3MDE0NzM=",
"avatar_url": "https://avatars.githubusercontent.com/u/1701473?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/BusyJay",
"html_url": "https://github.com/BusyJay",
"followers_url": "https://api.github.com/users/BusyJay/... | [] | closed | false | null | [] | null | [
"Ouch, thanks! Will look into this after I get off work today.\n",
"Should be fixed in f4481d14d8fc08b5c4c9964d7838af2866f021fd\n",
"I'll re-push 2.4.6\n",
"verified, thx!\n"
] | 2015-01-22T06:43:27 | 2015-01-25T04:43:11 | 2015-01-22T18:36:12 | NONE | null | Hi, before release 2.4.6, I was able to find out the most recent 5 articles and its comments via:
```
article = Article.select(Article).order_by(
Article.publish_time.desc()).paginate(1, 5).alias("ar")
for a in Article.select(Article, Comment).join(Comment).join(
article, on=(Article.id... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/506/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/506/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/505 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/505/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/505/comments | https://api.github.com/repos/coleifer/peewee/issues/505/events | https://github.com/coleifer/peewee/pull/505 | 55,100,784 | MDExOlB1bGxSZXF1ZXN0Mjc4MTAwNzI= | 505 | playhouse.migration bug fix | {
"login": "dpep",
"id": 918804,
"node_id": "MDQ6VXNlcjkxODgwNA==",
"avatar_url": "https://avatars.githubusercontent.com/u/918804?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dpep",
"html_url": "https://github.com/dpep",
"followers_url": "https://api.github.com/users/dpep/followers",
... | [] | closed | false | null | [] | null | [
"Thanks!\n"
] | 2015-01-22T01:02:32 | 2015-01-22T03:26:24 | 2015-01-22T02:07:16 | CONTRIBUTOR | null | this variable was mis-labeled such that migrations crashed if any column contained extra attributes, like 'auto_increment'. this fixes it
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/505/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/505/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/505",
"html_url": "https://github.com/coleifer/peewee/pull/505",
"diff_url": "https://github.com/coleifer/peewee/pull/505.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/505.patch",
"merged_at": "2015-01-22T02:07:16"
} |
https://api.github.com/repos/coleifer/peewee/issues/504 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/504/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/504/comments | https://api.github.com/repos/coleifer/peewee/issues/504/events | https://github.com/coleifer/peewee/issues/504 | 54,889,340 | MDU6SXNzdWU1NDg4OTM0MA== | 504 | Constraints not created by db.create_table(Class1), yes by db.create_tables([Class1]) | {
"login": "chrisinmtown",
"id": 10234212,
"node_id": "MDQ6VXNlcjEwMjM0MjEy",
"avatar_url": "https://avatars.githubusercontent.com/u/10234212?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/chrisinmtown",
"html_url": "https://github.com/chrisinmtown",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"The `db.create_table()` method will only create the table, not any of the indexes or constraints. To create a table for a model along with constraints, use `ModelClass.create_table()` or if creating multiple tables, `db.create_tables()`. I understand this is confusing and will update the docs to clarify the differ... | 2015-01-20T14:31:42 | 2015-01-24T22:52:43 | 2015-01-22T18:37:30 | NONE | null | In peewee 2.4.5 my tests show that methods create_table() and create_tables() differ in creation of uniqueness constraints. If I use db.create_table(Class1) then my request for uniqueness constraints is silently ignored. If I use db.create_tables([Class1]) then the constraints are created as expected.
I'm using MySQ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/504/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/504/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/503 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/503/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/503/comments | https://api.github.com/repos/coleifer/peewee/issues/503/events | https://github.com/coleifer/peewee/issues/503 | 54,589,189 | MDU6SXNzdWU1NDU4OTE4OQ== | 503 | 2.4.5 increased our query count in places we were using aggregate_rows() | {
"login": "jturmel",
"id": 37833,
"node_id": "MDQ6VXNlcjM3ODMz",
"avatar_url": "https://avatars.githubusercontent.com/u/37833?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jturmel",
"html_url": "https://github.com/jturmel",
"followers_url": "https://api.github.com/users/jturmel/follower... | [] | closed | false | null | [] | null | [
"And by \"in our code\", I meant \"in our tests\"\n",
"Interesting -- can you share any of the code or a representative example?\n",
"I think perhaps 4c38abd5ea and #482 might be related.\n",
"```\nclass Item(DateTimeModel, LocalizedModel, BaseModel):\n name_en = CharField()\n name_es = CharField(null=T... | 2015-01-16T15:43:40 | 2015-01-18T03:54:08 | 2015-01-18T03:47:09 | NONE | null | In our code we have asserts for query counts to make sure they don't get out of hand by us doing something stupid or Peewee changing in an unexpected way. Once we upgraded from 2.4.4 to 2.4.5 several of our queries with JOINS that were doing one query regressed back to N+1 queries.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/503/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/503/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/502 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/502/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/502/comments | https://api.github.com/repos/coleifer/peewee/issues/502/events | https://github.com/coleifer/peewee/issues/502 | 54,575,364 | MDU6SXNzdWU1NDU3NTM2NA== | 502 | ManyToManyField in Shortcuts | {
"login": "karelv",
"id": 787006,
"node_id": "MDQ6VXNlcjc4NzAwNg==",
"avatar_url": "https://avatars.githubusercontent.com/u/787006?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/karelv",
"html_url": "https://github.com/karelv",
"followers_url": "https://api.github.com/users/karelv/follow... | [] | closed | false | null | [] | null | [
"Yeah, it's currently only in master. I will be pushing a new version soon which will contain the field.\n"
] | 2015-01-16T13:30:21 | 2015-01-16T15:16:59 | 2015-01-16T15:16:59 | NONE | null | ManyToManyField in Shortcuts module is not working in 2.4.5
``` py
from playhouse.shortcuts import ManyToManyField
```
yields in:
```
from playhouse.shortcuts import ManyToManyField
ImportError: cannot import name 'ManyToManyField'
```
So it finds the module, but not the class ManyToManyField...
Note: I refer to t... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/502/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/502/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/501 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/501/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/501/comments | https://api.github.com/repos/coleifer/peewee/issues/501/events | https://github.com/coleifer/peewee/issues/501 | 54,542,120 | MDU6SXNzdWU1NDU0MjEyMA== | 501 | Why is so much of the logic in a single file? | {
"login": "ianks",
"id": 3303032,
"node_id": "MDQ6VXNlcjMzMDMwMzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/3303032?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ianks",
"html_url": "https://github.com/ianks",
"followers_url": "https://api.github.com/users/ianks/follower... | [] | closed | false | null | [] | null | [
"A single file, that's all you need!\n\nIf it were to get to 10K lines I would consider splitting it up, but I don't imagine it will get that big. The code is also already broken up into the core and the `playhouse` extensions collection.\n\nLook around at sqlalchemy, you'll see a number of 3K line files. Django ha... | 2015-01-16T05:51:33 | 2016-01-29T08:39:21 | 2015-01-16T18:50:46 | NONE | null | Is there a reason that peewee.py contains so much of the logic? Surely this can be broken up into different files. Is there an advantage to doing it this way?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/501/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/501/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/500 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/500/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/500/comments | https://api.github.com/repos/coleifer/peewee/issues/500/events | https://github.com/coleifer/peewee/issues/500 | 54,508,298 | MDU6SXNzdWU1NDUwODI5OA== | 500 | error with DateTimeField | {
"login": "daufinsyd",
"id": 1218113,
"node_id": "MDQ6VXNlcjEyMTgxMTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/1218113?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/daufinsyd",
"html_url": "https://github.com/daufinsyd",
"followers_url": "https://api.github.com/users/da... | [] | closed | false | null | [] | null | [
"What do the dates in your table look like? Can you show me some examples?\n",
"it's\n15/01/2015 22:15\n",
"OK, that's the problem. You'll need to subclass `DateTimeField` and specify the `formats` parameter, e.g.\n\n``` python\nclass CustomDateTimeField(DateTimeField):\n formats = ['%d/%m/%Y %H:%M'] + DateT... | 2015-01-15T21:42:28 | 2015-01-15T23:00:53 | 2015-01-15T23:00:53 | NONE | null | Hello,
I can't filter objects from with DateTimeField (with Sqlite), it always return
> File "/usr/local/lib/python3.4/dist-packages/peewee.py", line 2825, in execute_sql
> cursor.execute(sql, params or ())
> peewee.OperationalError: user-defined function raised exception
I have something like this:
> class A(Mo... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/500/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/500/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/499 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/499/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/499/comments | https://api.github.com/repos/coleifer/peewee/issues/499/events | https://github.com/coleifer/peewee/issues/499 | 54,395,037 | MDU6SXNzdWU1NDM5NTAzNw== | 499 | pylint doesn't see some peewee Model fields | {
"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 | [
"Can you please format your issue? You can edit it and apply markdown style.\n",
"If a model has an auto-increment integer primary key named `id`, the convention is to omit defining it explicitly. This convention comes from Django and I like it. If you want to fix it, just add this field definition to your models... | 2015-01-14T23:58:41 | 2015-01-15T23:35:11 | 2015-01-15T23:35:11 | NONE | null | I'm using peewee with Flask.
I have an existing MySQL database and used pwiz to generate a decent model of it. Functionally, everything is working fine, but pylint still complains about a Model field being not detected.
Here is the SQL:
``` SQL
CREATE TABLE name_instance (
id INT NOT NULL A... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/499/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/499/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/498 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/498/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/498/comments | https://api.github.com/repos/coleifer/peewee/issues/498/events | https://github.com/coleifer/peewee/issues/498 | 53,788,891 | MDU6SXNzdWU1Mzc4ODg5MQ== | 498 | Custom field not getting parsed using alias | {
"login": "BusyJay",
"id": 1701473,
"node_id": "MDQ6VXNlcjE3MDE0NzM=",
"avatar_url": "https://avatars.githubusercontent.com/u/1701473?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/BusyJay",
"html_url": "https://github.com/BusyJay",
"followers_url": "https://api.github.com/users/BusyJay/... | [] | closed | false | null | [] | null | [
"When will be next release?\n",
"I'll create one soon.\n"
] | 2015-01-08T19:17:42 | 2015-01-21T16:03:41 | 2015-01-08T20:22:10 | NONE | null | Hi, I have a custom field definition like:
```
class CustomField(peewee.Field):
def coerce(self, value):
return "parsed"
class A(peewee.Model):
f = CustomField()
```
When I parse custom value to Models directly, it works fine.
```
>>> A.select().where(A.f == 20)
<class '__main__.A'> SELECT "t1"."id"... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/498/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/498/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/497 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/497/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/497/comments | https://api.github.com/repos/coleifer/peewee/issues/497/events | https://github.com/coleifer/peewee/issues/497 | 53,671,314 | MDU6SXNzdWU1MzY3MTMxNA== | 497 | How to use the read and write with multithreading? | {
"login": "ismkv",
"id": 6520418,
"node_id": "MDQ6VXNlcjY1MjA0MTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/6520418?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ismkv",
"html_url": "https://github.com/ismkv",
"followers_url": "https://api.github.com/users/ismkv/follower... | [] | closed | false | null | [] | null | [
"I'm not exactly sure I understand what problem, specifically, you are encountering.\n",
"@coleifer, I made an example for you to understand:\n\n``` python\nfrom peewee import *\nfrom threading import Thread\nfrom random import random, randint\n\nimport os\n\nDB_FILE = 'db.sqlite'\n\nif os.path.isfile(DB_FILE):\n... | 2015-01-07T19:29:06 | 2015-01-08T03:54:01 | 2015-01-08T00:31:58 | NONE | null | Good day. Please help me with a problem.
I'm having trouble updating / reading data in a thread when using ORM.
I've been using peewee for Python. After reading the documentation starting to initialize the object to work with the database.
``` python
db = SqliteDatabase('db.sqlite', threadlocals=True)
# Next comes ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/497/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/497/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/496 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/496/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/496/comments | https://api.github.com/repos/coleifer/peewee/issues/496/events | https://github.com/coleifer/peewee/issues/496 | 53,652,235 | MDU6SXNzdWU1MzY1MjIzNQ== | 496 | Add jsonb field support for postgres | {
"login": "extesy",
"id": 65872,
"node_id": "MDQ6VXNlcjY1ODcy",
"avatar_url": "https://avatars.githubusercontent.com/u/65872?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/extesy",
"html_url": "https://github.com/extesy",
"followers_url": "https://api.github.com/users/extesy/followers",
... | [] | closed | false | null | [] | null | [
"Yes! I'm very interested in adding this. I currently have 9.3.5 installed so I'll need to get 9.4 running in order to start working on this.\n",
"0f48020cf2604966aa77dcd57044b738cc7f44de\n",
"I've made a start at implementing this. I'll put together some docs shortly.\n",
":thumbsup:\n",
"Any update on thi... | 2015-01-07T16:39:18 | 2015-04-01T14:32:54 | 2015-01-24T23:41:10 | NONE | null | PostgreSQL 9.4 now supports binary json field (jsonb), the documentation is here: http://www.postgresql.org/docs/9.4/static/datatype-json.html
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/496/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/496/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/495 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/495/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/495/comments | https://api.github.com/repos/coleifer/peewee/issues/495/events | https://github.com/coleifer/peewee/issues/495 | 53,458,868 | MDU6SXNzdWU1MzQ1ODg2OA== | 495 | Union with Meta "order_by" clause produces incorrect SQL query | {
"login": "albatros69",
"id": 5740149,
"node_id": "MDQ6VXNlcjU3NDAxNDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/5740149?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/albatros69",
"html_url": "https://github.com/albatros69",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"This is one of many reasons why default ordering is a bad idea. I regret adding this functionality, but it's too late to remove it now.\n\nAt any rate, you can clear the existing order by clauses on your sub-queries. That should fix the problem:\n\n``` python\nq_orders = cls.select(Type, Order.quantity).join(Wine)... | 2015-01-05T22:55:36 | 2015-01-06T00:16:06 | 2015-01-06T00:15:41 | NONE | null | Hello,
I've tried the following (rather complex I admit) but ended up to an incorrect SQL statement (at least with SQLite). Commenting the "order_by" in the Meta class is a workaround.
```
class Type(Model):
[...] ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/495/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/495/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/494 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/494/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/494/comments | https://api.github.com/repos/coleifer/peewee/issues/494/events | https://github.com/coleifer/peewee/pull/494 | 53,387,448 | MDExOlB1bGxSZXF1ZXN0MjY4MTg1NjA= | 494 | [fix] TypeError: host is an invalid keyword argument for this function | {
"login": "ekatsah",
"id": 1141204,
"node_id": "MDQ6VXNlcjExNDEyMDQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/1141204?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ekatsah",
"html_url": "https://github.com/ekatsah",
"followers_url": "https://api.github.com/users/ekatsah/... | [] | closed | false | null | [] | null | [
"I'm confused -- why is `host` getting used?\n",
"Hum i read the doc too rapidly and confused relatif/absolute path. please discard this PR. sorry for the noise.\n\nWas trying to fix this kind of error\n\n```\nself = <peewee.SqliteDatabase object at 0x7fc15db82c90>\ndatabase = 'tmp/file.db', kwargs = {}\n\ndef _c... | 2015-01-05T11:33:13 | 2015-01-05T16:10:06 | 2015-01-05T16:10:06 | NONE | null | Try to fix this:
```
self = <peewee.SqliteDatabase object at 0x7f79bbfcf950>, database = ':memory:'
kwargs = {'host': file.db'}
def _connect(self, database, **kwargs):
> conn = sqlite3.connect(database, **kwargs)
E TypeError: 'host' is an invalid keyword argument for this function
```
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/494/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/494/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/494",
"html_url": "https://github.com/coleifer/peewee/pull/494",
"diff_url": "https://github.com/coleifer/peewee/pull/494.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/494.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/493 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/493/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/493/comments | https://api.github.com/repos/coleifer/peewee/issues/493/events | https://github.com/coleifer/peewee/issues/493 | 53,263,386 | MDU6SXNzdWU1MzI2MzM4Ng== | 493 | Foreign Key Issue | {
"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 | [
"What database engine are you using? That's definitely a bit odd.\n",
"If you're using SQLite, you will need to execute `PRAGMA foreign_keys=on;` when you open a connection in order for this to work correctly.\n",
"Thank you. I am using SQLite, and this seems to be the solution. :+1:\n",
"The problem persists... | 2015-01-02T16:59:35 | 2015-01-05T01:28:35 | 2015-01-02T19:39:53 | NONE | null | I just encountered this issue. Not sure if it had already been reported.
I have my models defined as follows
```
class BaseModel(Model):
class Meta:
database = db
class Login(BaseModel):
username = TextField(unique=True)
password = TextField()
class Profile(BaseModel):
dname = TextField()
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/493/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/493/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/492 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/492/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/492/comments | https://api.github.com/repos/coleifer/peewee/issues/492/events | https://github.com/coleifer/peewee/issues/492 | 53,178,986 | MDU6SXNzdWU1MzE3ODk4Ng== | 492 | pwiz issue with composite primary keys | {
"login": "dkorduban",
"id": 340771,
"node_id": "MDQ6VXNlcjM0MDc3MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/340771?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dkorduban",
"html_url": "https://github.com/dkorduban",
"followers_url": "https://api.github.com/users/dkor... | [] | closed | false | null | [] | null | [
"You should not specify `primary_key=True` if you are specifying a `CompositeKey`. Instead write:\n\n``` python\nclass A(BaseModel):\n id1 = IntegerField()\n id2 = IntegerField()\n\n class Meta:\n db_table = 'a'\n primary_key = CompositeKey('id1', 'id2')\n```\n",
"Oh shit, should have read ... | 2014-12-31T11:06:45 | 2014-12-31T17:16:50 | 2014-12-31T17:16:50 | CONTRIBUTOR | null | It generates something like
```
class A(BaseModel):
id1 = IntegerField(primary_key=True)
id2 = IntegerField(primary_key=True)
class Meta:
db_table = 'a'
primary_key = CompositeKey('id1', 'id2')
```
which in turn leads to
```
ValueError: primary key is overdetermined.
```
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/492/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/492/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/491 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/491/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/491/comments | https://api.github.com/repos/coleifer/peewee/issues/491/events | https://github.com/coleifer/peewee/pull/491 | 53,178,577 | MDExOlB1bGxSZXF1ZXN0MjY3MjEyMTI= | 491 | Fix Model.create_table(fail_silently=True) if schema is used. | {
"login": "dkorduban",
"id": 340771,
"node_id": "MDQ6VXNlcjM0MDc3MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/340771?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dkorduban",
"html_url": "https://github.com/dkorduban",
"followers_url": "https://api.github.com/users/dkor... | [] | closed | false | null | [] | null | [
"Thank you!\n"
] | 2014-12-31T10:55:37 | 2014-12-31T16:10:05 | 2014-12-31T16:09:46 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/491/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/491/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/491",
"html_url": "https://github.com/coleifer/peewee/pull/491",
"diff_url": "https://github.com/coleifer/peewee/pull/491.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/491.patch",
"merged_at": "2014-12-31T16:09:46"
} | |
https://api.github.com/repos/coleifer/peewee/issues/490 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/490/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/490/comments | https://api.github.com/repos/coleifer/peewee/issues/490/events | https://github.com/coleifer/peewee/issues/490 | 53,039,883 | MDU6SXNzdWU1MzAzOTg4Mw== | 490 | PyPy count issue | {
"login": "stas",
"id": 112147,
"node_id": "MDQ6VXNlcjExMjE0Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/112147?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stas",
"html_url": "https://github.com/stas",
"followers_url": "https://api.github.com/users/stas/followers",
... | [] | closed | false | null | [] | null | [
"Closing this, looks like a https://github.com/spulec/freezegun issue with PyPy.\n"
] | 2014-12-29T13:04:25 | 2014-12-29T14:04:35 | 2014-12-29T14:04:35 | NONE | null | I was upgrading a package and some of our tests on PyPy failed.
The backtrace goes down to:
```
peewee-2.4.5-py2.7.egg/peewee.py", line 2433, in _aggregate
aggregation = fn.Count(SQL('*'))
AttributeError: 'builtin_function' object has no attribute 'Count'
```
Interesting fact, that running the same tests separat... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/490/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/490/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/489 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/489/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/489/comments | https://api.github.com/repos/coleifer/peewee/issues/489/events | https://github.com/coleifer/peewee/issues/489 | 53,006,273 | MDU6SXNzdWU1MzAwNjI3Mw== | 489 | Database connection not refreshed after wait_timeout | {
"login": "arunisaac",
"id": 6452653,
"node_id": "MDQ6VXNlcjY0NTI2NTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/6452653?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arunisaac",
"html_url": "https://github.com/arunisaac",
"followers_url": "https://api.github.com/users/ar... | [] | closed | false | null | [] | null | [
"You need to close connections when you're done with them. Neither pymysql nor peewee will detect the 2013/2006 error and re-connect automatically.\n",
"If you're using the connection pool, then when you close a connection it will be returned to the pool and recycled until it reaches it's stale timeout (specified... | 2014-12-28T18:19:11 | 2015-01-06T00:10:50 | 2015-01-06T00:10:50 | NONE | null | I'm using peewee with a MySQL database with pymysql being the database driver. The wait_timeout of my mysql database is set to the default value of 8 hours.
When my application remains idle for 8 hours, the database connection times out, and any further requests throw MySQL errors 2013 (Lost connection to MySQL server... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/489/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/489/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/488 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/488/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/488/comments | https://api.github.com/repos/coleifer/peewee/issues/488/events | https://github.com/coleifer/peewee/issues/488 | 53,004,974 | MDU6SXNzdWU1MzAwNDk3NA== | 488 | indexes not working: ValueError: too many values to unpack (expected 2) | {
"login": "kshade",
"id": 749398,
"node_id": "MDQ6VXNlcjc0OTM5OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/749398?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kshade",
"html_url": "https://github.com/kshade",
"followers_url": "https://api.github.com/users/kshade/follow... | [] | closed | false | null | [] | null | [
"``` python\n class Meta:\n indexes = (\n (('vorname', 'nachname', 'gesamtbrutto'), True), # Add trailing comma.\n )\n```\n"
] | 2014-12-28T17:15:33 | 2014-12-28T17:25:29 | 2014-12-28T17:25:29 | NONE | null | I'm writing a small SQLite-based application with peewee 2.4.5 for which I need to import data from another souce that, sadly, doesn't supply unique IDs. Therefore I want to have my own, internal primary keys and a constraint that makes sure I don't import the same row multiple times. I'm trying to use an unique index ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/488/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/488/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/487 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/487/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/487/comments | https://api.github.com/repos/coleifer/peewee/issues/487/events | https://github.com/coleifer/peewee/pull/487 | 52,983,407 | MDExOlB1bGxSZXF1ZXN0MjY2MjQ5NjI= | 487 | Fix Introspector schema handling. | {
"login": "dkorduban",
"id": 340771,
"node_id": "MDQ6VXNlcjM0MDc3MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/340771?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dkorduban",
"html_url": "https://github.com/dkorduban",
"followers_url": "https://api.github.com/users/dkor... | [] | closed | false | null | [] | null | [] | 2014-12-28T15:20:41 | 2014-12-29T03:21:17 | 2014-12-29T03:21:17 | CONTRIBUTOR | null | Partially fixes #486.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/487/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/487/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/487",
"html_url": "https://github.com/coleifer/peewee/pull/487",
"diff_url": "https://github.com/coleifer/peewee/pull/487.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/487.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/486 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/486/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/486/comments | https://api.github.com/repos/coleifer/peewee/issues/486/events | https://github.com/coleifer/peewee/issues/486 | 52,983,378 | MDU6SXNzdWU1Mjk4MzM3OA== | 486 | pwiz doesn't work well with schemas. | {
"login": "dkorduban",
"id": 340771,
"node_id": "MDQ6VXNlcjM0MDc3MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/340771?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dkorduban",
"html_url": "https://github.com/dkorduban",
"followers_url": "https://api.github.com/users/dkor... | [] | closed | false | null | [] | null | [] | 2014-12-28T15:19:32 | 2014-12-28T17:24:00 | 2014-12-28T17:24:00 | CONTRIBUTOR | null | When you run
`python -m pwiz -e postgresql -u postgres -s schemaname dbname`
it creates an empty model stub.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/486/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/486/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/485 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/485/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/485/comments | https://api.github.com/repos/coleifer/peewee/issues/485/events | https://github.com/coleifer/peewee/issues/485 | 52,825,165 | MDU6SXNzdWU1MjgyNTE2NQ== | 485 | Docs are generated from master instead of latest stable | {
"login": "timovwb",
"id": 893402,
"node_id": "MDQ6VXNlcjg5MzQwMg==",
"avatar_url": "https://avatars.githubusercontent.com/u/893402?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/timovwb",
"html_url": "https://github.com/timovwb",
"followers_url": "https://api.github.com/users/timovwb/fo... | [] | closed | false | null | [] | null | [
"There's now a `stable` branch with corresponding docs. I will keep the `stable` branch pinned to the latest tag:\n\nhttp://docs.peewee-orm.com/en/stable/\n"
] | 2014-12-24T15:46:46 | 2014-12-24T20:49:41 | 2014-12-24T20:49:41 | NONE | null | It looks like the documentation is generated against master instead of the latest stable release. I was looking at implementing ManyToMany and noticed I couldn't import the `ManyToManyField` which is mentioned in the docs. A quick look at the latest commits show that this is added after the 2.4.5 release. It's a bit co... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/485/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/485/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/484 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/484/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/484/comments | https://api.github.com/repos/coleifer/peewee/issues/484/events | https://github.com/coleifer/peewee/pull/484 | 52,577,033 | MDExOlB1bGxSZXF1ZXN0MjY0MjEwMTc= | 484 | Support for Expression-based joins when using aggregate_rows() | {
"login": "arrowgamer",
"id": 779694,
"node_id": "MDQ6VXNlcjc3OTY5NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/779694?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arrowgamer",
"html_url": "https://github.com/arrowgamer",
"followers_url": "https://api.github.com/users/a... | [] | closed | false | null | [] | null | [
"Thanks a lot. I'm sorry for all the pull requests and stuff. These are just the issues I've found thus far in using your ORM in a personal project of mine, and I thought it'd be nice to share them so others don't run into the same =)\n",
"No, I appreciate it! Thanks for your help!\n",
"Sure! =)\n"
] | 2014-12-20T21:21:35 | 2014-12-20T23:52:46 | 2014-12-20T23:24:32 | CONTRIBUTOR | null | Joining on an Expression when using aggregate_rows() would cause an error because rel_for_model only handles Fields.
Consider the following data models:
``` python
class Organization(BaseModel):
name = CharField()
class Review(BaseModel):
rating = IntegerField()
organization = ForeignKeyField(Organizati... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/484/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/484/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/484",
"html_url": "https://github.com/coleifer/peewee/pull/484",
"diff_url": "https://github.com/coleifer/peewee/pull/484.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/484.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/483 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/483/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/483/comments | https://api.github.com/repos/coleifer/peewee/issues/483/events | https://github.com/coleifer/peewee/issues/483 | 52,576,702 | MDU6SXNzdWU1MjU3NjcwMg== | 483 | Using .get() with .aggregate_rows() | {
"login": "arrowgamer",
"id": 779694,
"node_id": "MDQ6VXNlcjc3OTY5NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/779694?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arrowgamer",
"html_url": "https://github.com/arrowgamer",
"followers_url": "https://api.github.com/users/a... | [] | closed | false | null | [] | null | [
"Refs #480\n",
"Your options proposed there do make sense! Performing a separate query isn't that big of an issue given that the usage of get() implies there will only be one parent object. However, in the case that you're joining on many different tables, I suppose you'd need a separate query for each of them, o... | 2014-12-20T21:08:30 | 2014-12-20T23:29:52 | 2014-12-20T23:29:52 | CONTRIBUTOR | null | Consider the following data models:
``` python
class Organization(BaseModel):
name = CharField()
class Review(BaseModel):
rating = IntegerField()
organization = ForeignKeyField(Organization, related_name='reviews')
```
If I wanted to get an organization by its ID and eagerly load its reviews, the LIMIT ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/483/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/483/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/482 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/482/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/482/comments | https://api.github.com/repos/coleifer/peewee/issues/482/events | https://github.com/coleifer/peewee/pull/482 | 52,558,616 | MDExOlB1bGxSZXF1ZXN0MjY0MTQ1MTA= | 482 | Support for filtering by joined table outside of select | {
"login": "arrowgamer",
"id": 779694,
"node_id": "MDQ6VXNlcjc3OTY5NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/779694?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arrowgamer",
"html_url": "https://github.com/arrowgamer",
"followers_url": "https://api.github.com/users/a... | [] | closed | false | null | [] | null | [
"I fixed this with a slightly smaller change: 4c38abd5ea1c0d05226e181fced3895ada8ee73d\n",
"I took a look. Awesome!\n"
] | 2014-12-20T09:35:34 | 2014-12-20T19:56:30 | 2014-12-20T18:49:47 | CONTRIBUTOR | null | Filtering by a joined table that is not part of the select would cause a KeyError when using aggregate_rows.
Consider the following example models:
``` python
class Organization(Model):
name = CharField()
class Job(Model):
name = CharField()
organization = ForeignKeyField(Organization)
class Employee(... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/482/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/482/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/482",
"html_url": "https://github.com/coleifer/peewee/pull/482",
"diff_url": "https://github.com/coleifer/peewee/pull/482.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/482.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/481 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/481/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/481/comments | https://api.github.com/repos/coleifer/peewee/issues/481/events | https://github.com/coleifer/peewee/issues/481 | 52,533,780 | MDU6SXNzdWU1MjUzMzc4MA== | 481 | ForeignKey related_name problem | {
"login": "tigrus",
"id": 804424,
"node_id": "MDQ6VXNlcjgwNDQyNA==",
"avatar_url": "https://avatars.githubusercontent.com/u/804424?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tigrus",
"html_url": "https://github.com/tigrus",
"followers_url": "https://api.github.com/users/tigrus/follow... | [] | closed | false | null | [] | null | [
"Related names are \"back references\", a handy way of accessing a collection of objects relating _to_ the given instance. For example say you have user and tweet models. You would say a tweet has one user, while a user has many tweets. That gives you a foreign key named user and a related name of tweets:\n\n``` py... | 2014-12-19T22:02:54 | 2014-12-19T22:36:26 | 2014-12-19T22:14:18 | NONE | null | We have following models:
```
class ResUsers(BaseModel):
#gave up here... it reference to self, but have same error
create_uid = peewee.IntegerField()
class ProductPriceType(BaseModel):
class Meta:
managed = False
db_table = 'product_price_type'
create_uid = peewee.ForeignKeyField(Re... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/481/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/481/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/480 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/480/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/480/comments | https://api.github.com/repos/coleifer/peewee/issues/480/events | https://github.com/coleifer/peewee/issues/480 | 52,261,553 | MDU6SXNzdWU1MjI2MTU1Mw== | 480 | Using .aggregate_rows() with .get() doesn't work correctly | {
"login": "jturmel",
"id": 37833,
"node_id": "MDQ6VXNlcjM3ODMz",
"avatar_url": "https://avatars.githubusercontent.com/u/37833?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jturmel",
"html_url": "https://github.com/jturmel",
"followers_url": "https://api.github.com/users/jturmel/follower... | [] | closed | false | null | [] | null | [
"`aggregate_rows()` was not really intended, when I wrote it, for fetching single instances via `.get()`. Can you explain your specific use case? I might be able to suggest some equally viable alternatives.\n",
"We have an alternative, we just don't use .get(), we just run the normal \"list\" query, check to see ... | 2014-12-17T16:38:01 | 2014-12-17T19:25:39 | 2014-12-17T19:25:39 | NONE | null | It only returns one item on the back reference lists even if the item had more in the tables that were joined in.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/480/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/480/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/479 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/479/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/479/comments | https://api.github.com/repos/coleifer/peewee/issues/479/events | https://github.com/coleifer/peewee/issues/479 | 51,988,552 | MDU6SXNzdWU1MTk4ODU1Mg== | 479 | Issue with aggregate functions and mathematical operations | {
"login": "goir",
"id": 586209,
"node_id": "MDQ6VXNlcjU4NjIwOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/586209?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/goir",
"html_url": "https://github.com/goir",
"followers_url": "https://api.github.com/users/goir/followers",
... | [] | closed | false | null | [] | null | [
"> Is this an issue or are we just using it wrong ? :)\n\nYes, it appears to be! Thanks for bringing this to my attention. I'll look into fixing this tonight after work.\n"
] | 2014-12-15T13:58:50 | 2014-12-16T01:44:14 | 2014-12-16T01:44:14 | NONE | null | Hi,
We're having an issue with aggregate functions and mathematical calculations, this simple Test shows the issue:
```
from peewee import fn, Model
query = Model.select(
fn.MAX(
fn.IFNULL(1, 10) * 151,
fn.IFNULL(None, 10)
)
)
print query
```
This gives us:
<class 'peewee.Model'> SELECT MAX(... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/479/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/479/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/478 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/478/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/478/comments | https://api.github.com/repos/coleifer/peewee/issues/478/events | https://github.com/coleifer/peewee/issues/478 | 51,969,824 | MDU6SXNzdWU1MTk2OTgyNA== | 478 | Would thread pool be useful for single thread application? | {
"login": "kamelzcs",
"id": 3021531,
"node_id": "MDQ6VXNlcjMwMjE1MzE=",
"avatar_url": "https://avatars.githubusercontent.com/u/3021531?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kamelzcs",
"html_url": "https://github.com/kamelzcs",
"followers_url": "https://api.github.com/users/kamel... | [] | closed | false | null | [] | null | [
"I didn't think about Tornado when writing that, to be honest. The connections are stored in a heap on the pooled database instance, so there's no reason why a single-threaded app could not check out multiple connections. There's a catch, though...\n\nThe database stores the connection on a threadlocal. So if you h... | 2014-12-15T10:25:02 | 2014-12-16T08:38:49 | 2014-12-16T06:36:36 | NONE | null | The docs said, `If your application is single-threaded, only one connection will be opened.`
In frameworks like `Tornado`, there is only one thread.
Does it mean, no matter how many requests from the client, there would be ONLY ONE connection to deal with the requests?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/478/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/478/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/477 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/477/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/477/comments | https://api.github.com/repos/coleifer/peewee/issues/477/events | https://github.com/coleifer/peewee/pull/477 | 51,654,368 | MDExOlB1bGxSZXF1ZXN0MjU4ODA4OTE= | 477 | Fix error when aggregating results that JOIN many-to-many tables | {
"login": "jturmel",
"id": 37833,
"node_id": "MDQ6VXNlcjM3ODMz",
"avatar_url": "https://avatars.githubusercontent.com/u/37833?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jturmel",
"html_url": "https://github.com/jturmel",
"followers_url": "https://api.github.com/users/jturmel/follower... | [] | closed | false | null | [] | null | [] | 2014-12-11T07:14:54 | 2014-12-11T18:21:34 | 2014-12-11T18:21:34 | NONE | null | Composite key is a list of primary keys in how the pk_value was being generated causing a crash when trying to be used as a dictionary key since a list isn't hashable.
Now it looks to see if it's a list, if it is, it casts the values to strings and concatenates them together with a dash.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/477/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/477/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/477",
"html_url": "https://github.com/coleifer/peewee/pull/477",
"diff_url": "https://github.com/coleifer/peewee/pull/477.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/477.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/476 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/476/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/476/comments | https://api.github.com/repos/coleifer/peewee/issues/476/events | https://github.com/coleifer/peewee/issues/476 | 51,535,532 | MDU6SXNzdWU1MTUzNTUzMg== | 476 | select rows not in many-to-many relation | {
"login": "exherb",
"id": 65154,
"node_id": "MDQ6VXNlcjY1MTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/65154?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/exherb",
"html_url": "https://github.com/exherb",
"followers_url": "https://api.github.com/users/exherb/followers",
... | [] | closed | false | null | [] | null | [
"It sounds like this is more of a SQL question than an issue with peewee, so I'm going to close.\n",
"@coleifer sorry, I was looking for something simple API without subquery to do this with peewee.\n"
] | 2014-12-10T09:23:37 | 2014-12-10T15:30:29 | 2014-12-10T15:18:46 | NONE | null | is this even possible?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/476/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/476/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/475 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/475/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/475/comments | https://api.github.com/repos/coleifer/peewee/issues/475/events | https://github.com/coleifer/peewee/issues/475 | 51,447,702 | MDU6SXNzdWU1MTQ0NzcwMg== | 475 | Regression on migrator.drop_column | {
"login": "stenci",
"id": 5955495,
"node_id": "MDQ6VXNlcjU5NTU0OTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/5955495?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stenci",
"html_url": "https://github.com/stenci",
"followers_url": "https://api.github.com/users/stenci/foll... | [] | closed | false | null | [] | null | [
"That's odd, I copy/pasted the code into a module locally and it ran without issue, although I did modify the code slightly so the call to `drop_column()` referred to `mytable` and not `mytable2`. I also explicitly checked out the 2.4.4 tag.\n\nCan you do some debugging to find out what values are being passed to `... | 2014-12-09T16:23:32 | 2014-12-10T04:32:19 | 2014-12-10T04:20:48 | CONTRIBUTOR | null | The following code works with 2.3.3, fails with 2.4.4.
```
import peewee
import playhouse.migrate
db = peewee.SqliteDatabase('test.db', threadlocals=True)
class MyTable(peewee.Model):
mycolumn = peewee.CharField()
class Meta:
database = db
MyTable.drop_table(True)
MyTable.create_table()
migrator = p... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/475/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/475/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/474 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/474/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/474/comments | https://api.github.com/repos/coleifer/peewee/issues/474/events | https://github.com/coleifer/peewee/issues/474 | 51,331,475 | MDU6SXNzdWU1MTMzMTQ3NQ== | 474 | sqlite ForeignKeyField column migration errors | {
"login": "shamrin",
"id": 510678,
"node_id": "MDQ6VXNlcjUxMDY3OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/510678?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/shamrin",
"html_url": "https://github.com/shamrin",
"followers_url": "https://api.github.com/users/shamrin/fo... | [] | closed | false | null | [] | null | [
"@coleifer Wow, thank you for super quick fix! :smiley: \n\nI've noticed adding `ForeignKeyField` produces `REFERENCES` that is inline with column definition:\n\n```\n\"network_id\" INTEGER REFERENCES \"network\" (\"id\")\n```\n\nvs what happens when you call `.create_table()`:\n\n```\n\"network_id\" INTEGER, FOREI... | 2014-12-08T17:56:08 | 2014-12-09T18:18:42 | 2014-12-09T07:07:44 | CONTRIBUTOR | null | - [x] ForeignKeyField add_column is incomplete - column is added, but without foreign key constraint
- [x] ForeignKeyField drop_column fails: `peewee.OperationalError: unknown column "owner_id" in foreign key definition`
- [x] trying to drop non-existent column doesn't give any errors: e.g. `migrate(migrator.drop_colu... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/474/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/474/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/473 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/473/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/473/comments | https://api.github.com/repos/coleifer/peewee/issues/473/events | https://github.com/coleifer/peewee/pull/473 | 51,307,946 | MDExOlB1bGxSZXF1ZXN0MjU2Njk0ODY= | 473 | fix playhouse.migrate docstring about drop_index | {
"login": "shamrin",
"id": 510678,
"node_id": "MDQ6VXNlcjUxMDY3OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/510678?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/shamrin",
"html_url": "https://github.com/shamrin",
"followers_url": "https://api.github.com/users/shamrin/fo... | [] | closed | false | null | [] | null | [
"Thank you!\n"
] | 2014-12-08T14:33:45 | 2014-12-08T19:02:17 | 2014-12-08T19:02:12 | CONTRIBUTOR | null | `migrator.drop_index` seems to require table name as the first argument. But module docstring showed just `.drop_index(index_name)`.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/473/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/473/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/473",
"html_url": "https://github.com/coleifer/peewee/pull/473",
"diff_url": "https://github.com/coleifer/peewee/pull/473.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/473.patch",
"merged_at": "2014-12-08T19:02:12"
} |
https://api.github.com/repos/coleifer/peewee/issues/472 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/472/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/472/comments | https://api.github.com/repos/coleifer/peewee/issues/472/events | https://github.com/coleifer/peewee/pull/472 | 50,553,948 | MDExOlB1bGxSZXF1ZXN0MjUyODY0MDg= | 472 | Avoiding changing how Model.save() works with a composite PK | {
"login": "ricoboni",
"id": 1664502,
"node_id": "MDQ6VXNlcjE2NjQ1MDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1664502?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ricoboni",
"html_url": "https://github.com/ricoboni",
"followers_url": "https://api.github.com/users/ricob... | [] | closed | false | null | [] | null | [
"Thank you!\n"
] | 2014-12-01T17:57:19 | 2014-12-02T01:56:36 | 2014-12-02T01:56:33 | NONE | null | This won't fix #469, but I think it's a better way to remove the PK fields from the updating fields.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/472/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/472/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/472",
"html_url": "https://github.com/coleifer/peewee/pull/472",
"diff_url": "https://github.com/coleifer/peewee/pull/472.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/472.patch",
"merged_at": "2014-12-02T01:56:33"
} |
https://api.github.com/repos/coleifer/peewee/issues/471 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/471/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/471/comments | https://api.github.com/repos/coleifer/peewee/issues/471/events | https://github.com/coleifer/peewee/pull/471 | 50,511,804 | MDExOlB1bGxSZXF1ZXN0MjUyNjA3NTA= | 471 | Fixed issue with aggregate_rows | {
"login": "arrowgamer",
"id": 779694,
"node_id": "MDQ6VXNlcjc3OTY5NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/779694?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arrowgamer",
"html_url": "https://github.com/arrowgamer",
"followers_url": "https://api.github.com/users/a... | [] | closed | false | null | [] | null | [
"Oh wow, nice catch!\n",
"Thanks a lot! ^_^ When do you think this will see the light of pip? =O\n"
] | 2014-12-01T11:04:37 | 2014-12-02T03:19:27 | 2014-12-02T01:49:54 | CONTRIBUTOR | null | Hi there.
Awesome job on this ORM!
I ran into an issue while using it last night, however, and here is my proposed solution. As not the most seasoned Python developer, your code is quite difficult for me to understand, so I don't know if this implemented correctly or if the change is even warranted. Perhaps I was usi... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/471/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/471/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/471",
"html_url": "https://github.com/coleifer/peewee/pull/471",
"diff_url": "https://github.com/coleifer/peewee/pull/471.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/471.patch",
"merged_at": "2014-12-02T01:49:54"
} |
https://api.github.com/repos/coleifer/peewee/issues/470 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/470/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/470/comments | https://api.github.com/repos/coleifer/peewee/issues/470/events | https://github.com/coleifer/peewee/issues/470 | 50,475,422 | MDU6SXNzdWU1MDQ3NTQyMg== | 470 | @db.commit_on_success does not work with deferred db | {
"login": "akaRem",
"id": 1472728,
"node_id": "MDQ6VXNlcjE0NzI3Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1472728?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/akaRem",
"html_url": "https://github.com/akaRem",
"followers_url": "https://api.github.com/users/akaRem/foll... | [] | closed | false | null | [] | null | [
"> Also for unknown reasons id(self) in connect differs from id(db) in app.py.\n> Not sure why..\n\nI think this is the problem, and I'm not sure how it could be a peewee issue.\n\n``` python\nfrom peewee import *\n\ndb = SqliteDatabase(None)\n\nclass User(Model):\n username = CharField()\n\n class Meta:\n ... | 2014-11-30T23:31:37 | 2014-12-04T02:54:12 | 2014-12-04T02:54:12 | NONE | null | The problem (simplified code):
```
# file: app.py
...
db = PostgresqlExtDatabase(None)
...
def create_app(config_name):
app = Flask(__name__)
db.init('demo')
from api import api
app.register_blueprint(api, url_prefix='/api')
return app
...
if __name__ == '__main__':
create_app(config).run()
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/470/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/470/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/469 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/469/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/469/comments | https://api.github.com/repos/coleifer/peewee/issues/469/events | https://github.com/coleifer/peewee/issues/469 | 50,372,516 | MDU6SXNzdWU1MDM3MjUxNg== | 469 | Save only dirty fields | {
"login": "ricoboni",
"id": 1664502,
"node_id": "MDQ6VXNlcjE2NjQ1MDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1664502?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ricoboni",
"html_url": "https://github.com/ricoboni",
"followers_url": "https://api.github.com/users/ricob... | [] | closed | false | null | [] | null | [
"I can see how that code appears confusing. The `only` parameter accepts a list of fields, and `model_instance.dirty_fields` returns a list of fields that have been modified. Using the two together, you can accomplish \"save only the fields that changed\":\n\n``` python\nproject.save(only=project.dirty_fields)\n```... | 2014-11-28T13:05:39 | 2014-11-30T03:15:49 | 2014-11-28T23:48:16 | NONE | null | I don't use the `Model.save()` method in some of my models to avoid race conditions.
Actually I overwrite it for these specific models to have a default value to the `only` argument that makes sense.
Example:
```
In [1]: p1 = Project.get(id=21)
In [2]: Project.get(id=21).used_credit_count
Out[2]: 4669
In [3]: # No... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/469/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/469/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/468 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/468/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/468/comments | https://api.github.com/repos/coleifer/peewee/issues/468/events | https://github.com/coleifer/peewee/issues/468 | 50,340,655 | MDU6SXNzdWU1MDM0MDY1NQ== | 468 | Why not validate the keyword before insertion? | {
"login": "kamelzcs",
"id": 3021531,
"node_id": "MDQ6VXNlcjMwMjE1MzE=",
"avatar_url": "https://avatars.githubusercontent.com/u/3021531?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kamelzcs",
"html_url": "https://github.com/kamelzcs",
"followers_url": "https://api.github.com/users/kamel... | [] | closed | false | null | [] | null | [
"> It would make a big trouble if the keyword is the typo.\n\nYes, that's a valid point.\n\n> Charfield would accept all kinds of types other than basestring\n> BooleanField would accept all kinds of types other than Boolean\n\nThe `python_value` and `db_value` functions on field ensure that the correct types are p... | 2014-11-28T04:46:09 | 2014-11-29T02:57:42 | 2014-11-29T02:30:18 | NONE | null | ```
class Person(BaseModel):
name = CharField()
birthday = DateField()
is_relative = BooleanField()
uncle_bob = Person(name={1:2}, birthday="1910/10/11", is_relative="a", stupid="bas")
uncle_bob.save()
```
It would just work. Eventhough there is no `foo` field in the Model.
The insert way is to ignore any... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/468/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/468/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/467 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/467/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/467/comments | https://api.github.com/repos/coleifer/peewee/issues/467/events | https://github.com/coleifer/peewee/issues/467 | 49,845,907 | MDU6SXNzdWU0OTg0NTkwNw== | 467 | .save() doesn't work when primary key is manually assigned | {
"login": "scribu",
"id": 225715,
"node_id": "MDQ6VXNlcjIyNTcxNQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/225715?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/scribu",
"html_url": "https://github.com/scribu",
"followers_url": "https://api.github.com/users/scribu/follow... | [] | closed | false | null | [] | null | [
"After looking at how the `save()` method is implemented, it looks like it can't tell the difference between this:\n\n```\npage = Page.get(Page.url == 'http://example.com')\n```\n\nand this:\n\n```\npage = Page(url='http://example.com')\n```\n\ni.e. between a persisted object and one that exists only in Python.\n\n... | 2014-11-24T00:07:25 | 2014-11-24T02:38:21 | 2014-11-24T02:38:21 | NONE | null | Hello,
I have a model that looks something like this:
``` python
class Page(Model):
class Meta:
database = PostgresqlDatabase('example')
url = CharField(primary_key=True)
content = TextField()
```
If I manually create a Page instance, call `.save()` and then immediately query for that instance, I... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/467/reactions",
"total_count": 3,
"+1": 3,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/467/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/466 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/466/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/466/comments | https://api.github.com/repos/coleifer/peewee/issues/466/events | https://github.com/coleifer/peewee/issues/466 | 49,474,206 | MDU6SXNzdWU0OTQ3NDIwNg== | 466 | The table name on playhouse.migrate.migrate is partially case sensitive | {
"login": "stenci",
"id": 5955495,
"node_id": "MDQ6VXNlcjU5NTU0OTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/5955495?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stenci",
"html_url": "https://github.com/stenci",
"followers_url": "https://api.github.com/users/stenci/foll... | [] | closed | false | null | [] | null | [] | 2014-11-20T00:36:41 | 2014-11-20T07:13:39 | 2014-11-20T07:13:39 | CONTRIBUTOR | null | After executing the code below mytable2 misses one index.
The difference between the two migrate() lines is that one uses the case of the class and the other uses the case of the table name.
The function should be either case sensitive and fail when the case does not match (the class name or the column name?) or (bet... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/466/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/466/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/465 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/465/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/465/comments | https://api.github.com/repos/coleifer/peewee/issues/465/events | https://github.com/coleifer/peewee/issues/465 | 49,308,229 | MDU6SXNzdWU0OTMwODIyOQ== | 465 | Disable backref validation | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [
"I noticed an indentation error in the minimal example above: `return DynamicTable` is indented one level to deep.\n\nI must confess that I have not read the peewee source in detail. But could it be, that even after the deletion of `dyntable`, the class `StaticTable` still has some sort of reference to it?\n",
"I... | 2014-11-18T23:26:46 | 2014-11-19T18:02:09 | 2014-11-19T07:27:47 | OWNER | null | Via [stackoverflow](http://stackoverflow.com/questions/27000279/peewee-reusing-dynamically-created-models):
> In my application I have a model for which I know the number of columns only at runtime. Using a function like Factory below to create the model solves this issue nicely. However, if I use it multiple times (w... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/465/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/465/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/464 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/464/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/464/comments | https://api.github.com/repos/coleifer/peewee/issues/464/events | https://github.com/coleifer/peewee/issues/464 | 49,271,899 | MDU6SXNzdWU0OTI3MTg5OQ== | 464 | Losing MySQL connections even though using Pool etc. | {
"login": "cpury",
"id": 1777905,
"node_id": "MDQ6VXNlcjE3Nzc5MDU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1777905?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cpury",
"html_url": "https://github.com/cpury",
"followers_url": "https://api.github.com/users/cpury/follower... | [] | closed | false | null | [] | null | [
"Thanks for sharing this. I'm sorry that you've still been experiencing errors.\n\nQuick question -- are you calling `my_db.connect()` and `my_db.close()` between requests? I ask because these calls are necessary for opening the conn and for returning it to the pool.\n\nI think some improvements could definitely be... | 2014-11-18T18:11:42 | 2019-01-15T18:48:16 | 2014-11-24T05:26:04 | NONE | null | Hi,
so I'm writing a Python Thrift service and use Peewee as my ORM. Our DB is on a MySQL server. I've had many different problems with the "MySQL server going away" and googling it I found these two tips: a) Use the playhouse connection pool
b) After connecting, call database.get_conn().ping(True) (though I feel like ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/464/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/464/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/463 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/463/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/463/comments | https://api.github.com/repos/coleifer/peewee/issues/463/events | https://github.com/coleifer/peewee/issues/463 | 48,992,893 | MDU6SXNzdWU0ODk5Mjg5Mw== | 463 | lastrowid not found | {
"login": "hitman249",
"id": 1325326,
"node_id": "MDQ6VXNlcjEzMjUzMjY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1325326?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hitman249",
"html_url": "https://github.com/hitman249",
"followers_url": "https://api.github.com/users/hi... | [] | closed | false | null | [] | null | [
"The insert ID is returned on a `Model.save`. `Database.last_insert_id` takes a cursor _which was used to insert a row_ and returns the ID of the inserted row. By calling `Database.get_cursor`, your asking Peewee to open a _new_ database cursor, which will have no previously executed queries attached to it, and thu... | 2014-11-16T15:33:49 | 2014-11-17T02:59:24 | 2014-11-17T02:59:24 | NONE | null | How to know the last added row id?
```
meta = self.table.database
cur = meta.get_cursor()
last_insert_id = meta.last_insert_id(cursor=cur, model=Mt_files)
print(last_insert_id)
```
AttributeError: 'Cursor' object has no attribute 'lastrowid'
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/463/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/463/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/462 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/462/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/462/comments | https://api.github.com/repos/coleifer/peewee/issues/462/events | https://github.com/coleifer/peewee/issues/462 | 48,606,642 | MDU6SXNzdWU0ODYwNjY0Mg== | 462 | introspection fails in postgres when database contains table with same name in two different schemas | {
"login": "Jokipii",
"id": 1269218,
"node_id": "MDQ6VXNlcjEyNjkyMTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1269218?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Jokipii",
"html_url": "https://github.com/Jokipii",
"followers_url": "https://api.github.com/users/Jokipii/... | [] | closed | false | null | [] | null | [
"Thank you for this issue, looking into it now.\n"
] | 2014-11-13T07:42:22 | 2014-11-13T16:13:36 | 2014-11-13T16:13:36 | NONE | null | I tried to introspector.metadata.get_columns('isrc') and got following error:
```
C:\Python27\lib\site-packages\playhouse\reflection.pyc in get_columns(self, table)
230 columns[name] = Column(
231 name,
--> 232 field_class=column_info['field_class'],
233 ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/462/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/462/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/461 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/461/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/461/comments | https://api.github.com/repos/coleifer/peewee/issues/461/events | https://github.com/coleifer/peewee/issues/461 | 48,420,836 | MDU6SXNzdWU0ODQyMDgzNg== | 461 | Join doesn't work when a composite key is used | {
"login": "bastula",
"id": 61406,
"node_id": "MDQ6VXNlcjYxNDA2",
"avatar_url": "https://avatars.githubusercontent.com/u/61406?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bastula",
"html_url": "https://github.com/bastula",
"followers_url": "https://api.github.com/users/bastula/follower... | [] | closed | false | null | [] | null | [
"I tried a raw SQL query and it works fine:\n\n``` SQL\nSELECT * FROM image JOIN treatment WHERE image.date == treatment.date\n```\n\nThe database backend is SQLite.\n",
"Have you tried explicitly setting the join condition?\n\n``` python\npredicate = (Image.date == Treatment.date) & (Image.time == Treatment.time... | 2014-11-11T19:07:52 | 2014-11-19T17:48:15 | 2014-11-13T15:49:38 | NONE | null | Hello,
I have a table that has a primary key set as a Composite Key and I am unable to complete a join.
Here is the traceback:
``` Python
Traceback (most recent call last):
File "localsync.py", line 79, in get_dates
query = Image.select().join(Treatment).where(Image.date == Treatment.date)
File "C:\Python27\... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/461/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/461/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/460 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/460/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/460/comments | https://api.github.com/repos/coleifer/peewee/issues/460/events | https://github.com/coleifer/peewee/pull/460 | 47,815,151 | MDExOlB1bGxSZXF1ZXN0MjM4OTI5NzA= | 460 | Added terminal colors and changed string formmating following the PEP 3101 | {
"login": "manipuladordedados",
"id": 1189862,
"node_id": "MDQ6VXNlcjExODk4NjI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1189862?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/manipuladordedados",
"html_url": "https://github.com/manipuladordedados",
"followers_url": "http... | [] | closed | false | null | [] | null | [
"Thank you, but I will pass on this in order to keep the example simple.\n"
] | 2014-11-05T09:22:17 | 2014-11-05T14:17:19 | 2014-11-05T14:17:19 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/460/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/460/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/460",
"html_url": "https://github.com/coleifer/peewee/pull/460",
"diff_url": "https://github.com/coleifer/peewee/pull/460.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/460.patch",
"merged_at": null
} | |
https://api.github.com/repos/coleifer/peewee/issues/459 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/459/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/459/comments | https://api.github.com/repos/coleifer/peewee/issues/459/events | https://github.com/coleifer/peewee/issues/459 | 47,814,477 | MDU6SXNzdWU0NzgxNDQ3Nw== | 459 | Feature request: Automatically generate table and column comments from Model and Field docstrings | {
"login": "conqp",
"id": 3766192,
"node_id": "MDQ6VXNlcjM3NjYxOTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/3766192?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/conqp",
"html_url": "https://github.com/conqp",
"followers_url": "https://api.github.com/users/conqp/follower... | [] | closed | false | null | [] | null | [
"Thanks for the suggestion. I think I'm going to pass on this, but if you would like to submit a pull-request with an implementation, I'd help review it.\n"
] | 2014-11-05T09:13:03 | 2014-11-05T14:08:45 | 2014-11-05T14:08:45 | CONTRIBUTOR | null | I wondered, whether it would be possible to implement the feature of generating table and column comments from the respective models' and fields' docstrings on table creation.
Thanks for considering it.
OT: The "schema" option for the cross-DB FK worked. Thanks for the hint.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/459/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/459/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/458 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/458/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/458/comments | https://api.github.com/repos/coleifer/peewee/issues/458/events | https://github.com/coleifer/peewee/issues/458 | 47,589,169 | MDU6SXNzdWU0NzU4OTE2OQ== | 458 | Docs issue: Example with bad practices | {
"login": "akaRem",
"id": 1472728,
"node_id": "MDQ6VXNlcjE0NzI3Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1472728?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/akaRem",
"html_url": "https://github.com/akaRem",
"followers_url": "https://api.github.com/users/akaRem/foll... | [] | closed | false | null | [] | null | [] | 2014-11-03T12:36:01 | 2014-11-03T15:32:50 | 2014-11-03T15:32:50 | NONE | null | http://peewee.readthedocs.org/en/unstable-2.0/peewee/models.html#Model.delete_instance
there is an example
```
>>> user = User.get(User.username == username, User.password == password)
```
One could think that it's ok to store plain password in db.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/458/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/458/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/457 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/457/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/457/comments | https://api.github.com/repos/coleifer/peewee/issues/457/events | https://github.com/coleifer/peewee/issues/457 | 47,588,627 | MDU6SXNzdWU0NzU4ODYyNw== | 457 | improvement : Peewee Cookbook | {
"login": "akaRem",
"id": 1472728,
"node_id": "MDQ6VXNlcjE0NzI3Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1472728?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/akaRem",
"html_url": "https://github.com/akaRem",
"followers_url": "https://api.github.com/users/akaRem/foll... | [] | closed | false | null | [] | null | [] | 2014-11-03T12:28:35 | 2014-11-03T15:15:52 | 2014-11-03T15:15:52 | NONE | null | http://peewee.readthedocs.org/en/unstable-2.0/peewee/cookbook.html
there is example on use pwiz.py
```
python pwiz.py my_postgresql_database
```
I suggest to replace such things with
```
python -m pwiz my_postgresql_database
```
It's better to explicitly search for python module in python libs than "some script" ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/457/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/457/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/456 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/456/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/456/comments | https://api.github.com/repos/coleifer/peewee/issues/456/events | https://github.com/coleifer/peewee/issues/456 | 47,517,203 | MDU6SXNzdWU0NzUxNzIwMw== | 456 | Filtering by Count() in SQlite raises an error | {
"login": "arski",
"id": 904818,
"node_id": "MDQ6VXNlcjkwNDgxOA==",
"avatar_url": "https://avatars.githubusercontent.com/u/904818?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arski",
"html_url": "https://github.com/arski",
"followers_url": "https://api.github.com/users/arski/followers"... | [] | closed | false | null | [] | null | [
"Your query is incorrect.\n\n``` python\n(User\n .select(User, fn.COUNT(Tweet.id).alias('count'))\n .join(Tweet)\n .group_by(User)\n .having(fn.COUNT(Tweet.id) > 0))\n```\n",
"When aggregating, you can only filter on aggregates in the `HAVING` clause. Additionally, you need to tell the database how to group the r... | 2014-11-01T21:11:10 | 2014-11-02T13:44:30 | 2014-11-01T21:22:56 | NONE | null | What I'm trying to do is something like:
```
User.select(User, fn.Count(Tweet)).join(Tweet).where(fn.Count(Tweet) > 0)
```
Sadly, in SQlite, this throws an `OperationalError: misuse of aggregate: Count()` - which upon further investigation on SO turns out to be a specific SQlite issue where filtering by aggregates ha... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/456/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/456/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/455 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/455/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/455/comments | https://api.github.com/repos/coleifer/peewee/issues/455/events | https://github.com/coleifer/peewee/issues/455 | 47,516,731 | MDU6SXNzdWU0NzUxNjczMQ== | 455 | How to use functions like POSTGRES EXTRACT(YEAR FROM table.field) | {
"login": "demongoo",
"id": 941459,
"node_id": "MDQ6VXNlcjk0MTQ1OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/941459?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/demongoo",
"html_url": "https://github.com/demongoo",
"followers_url": "https://api.github.com/users/demongo... | [] | closed | false | null | [] | null | [
"You might try:\n\n``` python\nfn.EXTRACT(Clause(SQL('EPOCH FROM'), SomeModel.field))\n\n# or\n(fn.EXTRACT(Clause(SQL('EPOCH FROM'), SomeModel.field)) * 1000).alias('session_id)\n```\n",
"For future reference it looks like you want to use `NodeList` now instead of Clause",
"This is built-in to the database obje... | 2014-11-01T20:52:48 | 2019-11-11T18:25:21 | 2014-11-01T21:20:17 | NONE | null | This thing still doesn't let me sleep tight.
Can I somehow write the select field like:
```
EXTRACT(EPOCH FROM field)
```
Now I'm using `(fn.EXTRACT(SQL("EPOCH FROM \"t5\".\"ts\"")) * 1000).alias('session_id')` and the worst part is "t5". Is there any other solution? Or maybe some ideas how to let such constructions ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/455/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/455/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/454 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/454/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/454/comments | https://api.github.com/repos/coleifer/peewee/issues/454/events | https://github.com/coleifer/peewee/issues/454 | 47,510,108 | MDU6SXNzdWU0NzUxMDEwOA== | 454 | Parenthesis for CompoundQueries in FROM clause | {
"login": "demongoo",
"id": 941459,
"node_id": "MDQ6VXNlcjk0MTQ1OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/941459?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/demongoo",
"html_url": "https://github.com/demongoo",
"followers_url": "https://api.github.com/users/demongo... | [] | closed | false | null | [] | null | [
"What version of peewee are you using? In my testing locally it appears the parentheses are correct:\n\n``` python\nuq = User.select(User.username).where(User.username << ['a', 'b', 'd'])\n oq = (OrderedModel\n .select(OrderedModel.title)\n .where(OrderedModel.title << ['a', 'b'])\n... | 2014-11-01T16:36:35 | 2014-11-01T21:02:31 | 2014-11-01T20:42:25 | NONE | null | I made union query using `|` and was hoping to put it into `from_` of another query, but compiled query contains no parenthesis and results in error: `ProgrammingError at or near "SELECT`. Because inner query is not surrounded by parenthesis. Compiled output something like that:
```
inner = q1 | q2 | q3
q = Model.sele... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/454/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/454/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/453 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/453/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/453/comments | https://api.github.com/repos/coleifer/peewee/issues/453/events | https://github.com/coleifer/peewee/issues/453 | 47,327,576 | MDU6SXNzdWU0NzMyNzU3Ng== | 453 | Just and idea / discussion. Extensions support? | {
"login": "rudyryk",
"id": 4500,
"node_id": "MDQ6VXNlcjQ1MDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/4500?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rudyryk",
"html_url": "https://github.com/rudyryk",
"followers_url": "https://api.github.com/users/rudyryk/followers"... | [] | closed | false | null | [] | null | [
"Technically all is necessary is to add some reference to docs and add \"peewee_ext\" package from that sample to distribution.\n",
"> Just an idea, what do you think of \"standard\" extensions support for peewee like in Flask?\n\nI thought that Flask had moved away from that type of packaging.\n\nPython packagin... | 2014-10-30T21:05:50 | 2014-10-31T14:41:29 | 2014-10-31T05:47:09 | NONE | null | Hello Charles!
Just an idea, what do you think of "standard" extensions support for peewee like in Flask? So everyone who wants to write extension for peewee creates package like "peewee_foobar" and peewee has special hook for importing these package with:
```
import peewee_ext.foobar
```
So we can put "stable" exte... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/453/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/453/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/452 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/452/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/452/comments | https://api.github.com/repos/coleifer/peewee/issues/452/events | https://github.com/coleifer/peewee/pull/452 | 47,192,445 | MDExOlB1bGxSZXF1ZXN0MjM1NTc1NTM= | 452 | PyPy support | {
"login": "stas",
"id": 112147,
"node_id": "MDQ6VXNlcjExMjE0Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/112147?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stas",
"html_url": "https://github.com/stas",
"followers_url": "https://api.github.com/users/stas/followers",
... | [] | closed | false | null | [] | null | [
"Interesting! Fwiw peewee had fallback code in place to use pymysql, the pure python lib.\n",
"@coleifer please take a look at the latest changes. Thanks.\n",
"Looks good -- can you explain a little bit the changes in c92510a? I see 2 instances of manually closing a cursor and was just wondering about it.\n",
... | 2014-10-29T19:26:08 | 2014-11-19T14:41:25 | 2014-11-19T06:03:25 | NONE | null | This is a tentative to make peewee work on PyPy.
So far most of the issues I could find are related to the database packages that are compatible on PyPy/CPython.
This is still a WIP, I didn't make time to look at the MySQL support yet. I will try to have an update on that asap.
Please let me know if there are any que... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/452/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/452/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/452",
"html_url": "https://github.com/coleifer/peewee/pull/452",
"diff_url": "https://github.com/coleifer/peewee/pull/452.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/452.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/451 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/451/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/451/comments | https://api.github.com/repos/coleifer/peewee/issues/451/events | https://github.com/coleifer/peewee/issues/451 | 47,103,819 | MDU6SXNzdWU0NzEwMzgxOQ== | 451 | python_value not being called on create() | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"I don't think this is a bug, since you are creating the objects from Python, but I appreciate you opening the issue.\n",
"Yeah figured that might the response, I'll fix it on my end then. Cheers :)\n"
] | 2014-10-29T02:09:11 | 2014-10-29T22:21:37 | 2014-10-29T22:21:37 | CONTRIBUTOR | null | Hi Charles,
Just found another minor issue, this set of tests should demonstrate the problem.
```
import unittest
from datetime import datetime
from peewee import SqliteDatabase, Model, PrimaryKeyField, DateTimeField
db = SqliteDatabase(':memory:')
class MyModel(Model):
id = PrimaryKeyField()
my_field = D... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/451/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/451/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/450 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/450/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/450/comments | https://api.github.com/repos/coleifer/peewee/issues/450/events | https://github.com/coleifer/peewee/issues/450 | 47,050,456 | MDU6SXNzdWU0NzA1MDQ1Ng== | 450 | Why does saving a model in a loop over a query go twice over the first two items? | {
"login": "kramer65",
"id": 596581,
"node_id": "MDQ6VXNlcjU5NjU4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/596581?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kramer65",
"html_url": "https://github.com/kramer65",
"followers_url": "https://api.github.com/users/kramer6... | [] | closed | false | null | [] | null | [
"Just to add to the confusion. If I run the loop one time before I run it while saving, it doesn't loop 3 times:\n\n```\nusers = User.select()\nfor user in users: pass\n\nfor user in users:\n print 'We\\'re now storing a pm for user: ', user.name\n pm = PM()\n pm.user = user\n pm.text = ''.join([random.... | 2014-10-28T16:46:54 | 2014-10-28T17:18:32 | 2014-10-28T17:18:32 | NONE | null | I'm trying to save something for every user in a db, but to my surprise the loop goes double over the first two items.
```
#!/usr/bin/env python
import os, random, string
from peewee import *
DB_NAME = 'people.db'
db = SqliteDatabase(DB_NAME)
class User(Model):
name = CharField()
class Meta:
databas... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/450/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/450/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/449 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/449/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/449/comments | https://api.github.com/repos/coleifer/peewee/issues/449/events | https://github.com/coleifer/peewee/pull/449 | 46,863,011 | MDExOlB1bGxSZXF1ZXN0MjMzNTk4NjM= | 449 | Fix typo in db_url.py | {
"login": "malea",
"id": 4734824,
"node_id": "MDQ6VXNlcjQ3MzQ4MjQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/4734824?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/malea",
"html_url": "https://github.com/malea",
"followers_url": "https://api.github.com/users/malea/follower... | [] | closed | false | null | [] | null | [
"Wow, that's embarrassing! Thanks for the fix!\n"
] | 2014-10-27T01:48:14 | 2014-10-27T01:49:32 | 2014-10-27T01:49:32 | CONTRIBUTOR | null | This was breaking on Heroku with the following error:
```
peewee.OperationalError: invalid connection option "post"
```
I checked the source code to see where this `"post"` was coming from, and here it was!
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/449/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/449/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/449",
"html_url": "https://github.com/coleifer/peewee/pull/449",
"diff_url": "https://github.com/coleifer/peewee/pull/449.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/449.patch",
"merged_at": "2014-10-27T01:49:32"
} |
https://api.github.com/repos/coleifer/peewee/issues/448 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/448/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/448/comments | https://api.github.com/repos/coleifer/peewee/issues/448/events | https://github.com/coleifer/peewee/pull/448 | 46,692,791 | MDExOlB1bGxSZXF1ZXN0MjMyNjk0NTI= | 448 | Add in support for detecting server closed connections in postgres | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"Thank you for your help with this issue!\n"
] | 2014-10-24T00:22:17 | 2014-10-24T03:00:21 | 2014-10-24T03:00:15 | CONTRIBUTOR | null | How about this implementation? Making use of your approach but still including it in the main repo, as much as I'd like to I'd like to contribute back to the main repo for things like this :)
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/448/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/448/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/448",
"html_url": "https://github.com/coleifer/peewee/pull/448",
"diff_url": "https://github.com/coleifer/peewee/pull/448.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/448.patch",
"merged_at": "2014-10-24T03:00:15"
} |
https://api.github.com/repos/coleifer/peewee/issues/447 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/447/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/447/comments | https://api.github.com/repos/coleifer/peewee/issues/447/events | https://github.com/coleifer/peewee/pull/447 | 46,478,137 | MDExOlB1bGxSZXF1ZXN0MjMxMzgwNTk= | 447 | Fix typo. | {
"login": "soasme",
"id": 369081,
"node_id": "MDQ6VXNlcjM2OTA4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/369081?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/soasme",
"html_url": "https://github.com/soasme",
"followers_url": "https://api.github.com/users/soasme/follow... | [] | closed | false | null | [] | null | [
"Thanks!\n"
] | 2014-10-22T06:53:15 | 2014-10-22T16:39:40 | 2014-10-22T16:39:38 | CONTRIBUTOR | null | ```
> query.update()
E AttributeError: 'UpdateQuery' object has no attribute 'update'
1 failed, 27 passed in 3.69 seconds
```
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/447/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/447/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/447",
"html_url": "https://github.com/coleifer/peewee/pull/447",
"diff_url": "https://github.com/coleifer/peewee/pull/447.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/447.patch",
"merged_at": "2014-10-22T16:39:38"
} |
https://api.github.com/repos/coleifer/peewee/issues/446 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/446/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/446/comments | https://api.github.com/repos/coleifer/peewee/issues/446/events | https://github.com/coleifer/peewee/issues/446 | 46,418,499 | MDU6SXNzdWU0NjQxODQ5OQ== | 446 | How to enter the admin interface? | {
"login": "kramer65",
"id": 596581,
"node_id": "MDQ6VXNlcjU5NjU4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/596581?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kramer65",
"html_url": "https://github.com/kramer65",
"followers_url": "https://api.github.com/users/kramer6... | [] | closed | false | null | [] | null | [
"```\n File \"/Library/Python/2.7/site-packages/flask_peewee/auth.py\", line 142, in authenticate\n user = active.where(self.User.username==username).get()\n```\n\nYou may need to implement your own `Auth` class providing an `authenticate()` method which will ensure that the requesting user is authenticated. Th... | 2014-10-21T17:05:05 | 2014-10-21T18:08:35 | 2014-10-21T18:08:35 | NONE | null | I'm trying to get the peewee admin up and running. For this I followed the simple four step getting started guide here: http://flask-peewee.readthedocs.org/en/latest/admin.html
And after implementing the four steps and having my flask app up and running I'm kinda lost. I managed to figure out that I had to go to mydom... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/446/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/446/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/445 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/445/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/445/comments | https://api.github.com/repos/coleifer/peewee/issues/445/events | https://github.com/coleifer/peewee/issues/445 | 46,268,272 | MDU6SXNzdWU0NjI2ODI3Mg== | 445 | Cross-database foreign keys do not work | {
"login": "conqp",
"id": 3766192,
"node_id": "MDQ6VXNlcjM3NjYxOTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/3766192?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/conqp",
"html_url": "https://github.com/conqp",
"followers_url": "https://api.github.com/users/conqp/follower... | [] | closed | false | null | [] | null | [
"What is the correct syntax for using cross-database relationships? I'm not familiar with them. Can you share some example SQL queries that work, so I can compare against the ones that don't?\n",
"On MySQL-level it works like that:\n\n``` MySQL\ncreate database db1;\n\nuse db1;\n\nCREATE TABLE `historial` (\n`cod... | 2014-10-20T12:55:23 | 2014-10-30T18:20:01 | 2014-10-30T18:20:01 | CONTRIBUTOR | null | Using the _ForeignKeyField_ inside a model with a _rel_model_ that's located inside another database than the aforementioned model peewee won't resolve the related model to its correct database.
As a result, tables containing foreign keys with related models of other databases cannot be created:
```
Traceback (most re... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/445/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/445/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/444 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/444/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/444/comments | https://api.github.com/repos/coleifer/peewee/issues/444/events | https://github.com/coleifer/peewee/pull/444 | 45,199,411 | MDExOlB1bGxSZXF1ZXN0MjIzOTg3Nzg= | 444 | Add in detection of closed connections in the pool | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"Since this is not implemented for MySQL I will pass on merging it as-is, but I'll think about how this might work as it seems like a valid issue.\n",
"Awesome, cheers Charles. I'll take another look into MySQL tomorrow to see what I can do from my end. Would be great to close this bug from my perspective :)\n",
... | 2014-10-08T03:27:15 | 2014-10-22T16:39:23 | 2014-10-22T03:38:33 | CONTRIBUTOR | null | Hi Charles,
I've got a little problem with connection pooling, it works great up until the point I have to kill a hanging postgres query or stop the database service. Any requests on that same connection get an `InterfaceError: connection already closed` from the psycopg2 library because it successfully retrieves a co... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/444/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/444/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/444",
"html_url": "https://github.com/coleifer/peewee/pull/444",
"diff_url": "https://github.com/coleifer/peewee/pull/444.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/444.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/443 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/443/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/443/comments | https://api.github.com/repos/coleifer/peewee/issues/443/events | https://github.com/coleifer/peewee/issues/443 | 45,177,715 | MDU6SXNzdWU0NTE3NzcxNQ== | 443 | Model without auto increment primary key is not saved without force_insert=True | {
"login": "ElvisTheKing",
"id": 384889,
"node_id": "MDQ6VXNlcjM4NDg4OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/384889?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ElvisTheKing",
"html_url": "https://github.com/ElvisTheKing",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [
"This is known and documented behavior: http://docs.peewee-orm.com/en/latest/peewee/models.html#id3\n\nYou can always implement a custom method to perform this query if you are using MySQL (or create a mysql_ext module for the playhouse).\n\nIn the events where I've needed \"get object or create if it does not exis... | 2014-10-07T22:19:00 | 2018-05-17T05:04:30 | 2015-06-27T23:08:28 | NONE | null | Model save() method is implemented in such a way that it only use insert statement if primary key is null, which is correct only if primary key is auto increment or sequence field.
for example
```
class Object(BaseModel):
uuid = CharField(primary_key=True)
object = Object(uuid="some-text-uuid")
object.save()
#re... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/443/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/443/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/442 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/442/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/442/comments | https://api.github.com/repos/coleifer/peewee/issues/442/events | https://github.com/coleifer/peewee/issues/442 | 44,967,547 | MDU6SXNzdWU0NDk2NzU0Nw== | 442 | Cross database join | {
"login": "RealJTG",
"id": 930399,
"node_id": "MDQ6VXNlcjkzMDM5OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/930399?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/RealJTG",
"html_url": "https://github.com/RealJTG",
"followers_url": "https://api.github.com/users/RealJTG/fo... | [] | closed | false | null | [] | null | [
"Interesting. Peewee does not support this out of the box, so your best option right now is to probably use the `RawQuery` helper ([docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#RawQuery)).\n\nAnother option is to take a look at how the `PostgresqlDatabase` supports a \"schema\" argument. The schema is... | 2014-10-06T10:13:43 | 2014-10-07T14:21:13 | 2014-10-07T14:21:13 | NONE | null | Is it possible to perform cross database join somehow on the same MySQL instance? For example:
``` SQL
SELECT A.value, B.value
FROM db1.foo A
JOIN db2.bar B ON A.id = B.id
```
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/442/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/442/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/441 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/441/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/441/comments | https://api.github.com/repos/coleifer/peewee/issues/441/events | https://github.com/coleifer/peewee/pull/441 | 44,760,939 | MDExOlB1bGxSZXF1ZXN0MjIxODMyMDQ= | 441 | Update README.rst | {
"login": "wwj718",
"id": 3153878,
"node_id": "MDQ6VXNlcjMxNTM4Nzg=",
"avatar_url": "https://avatars.githubusercontent.com/u/3153878?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wwj718",
"html_url": "https://github.com/wwj718",
"followers_url": "https://api.github.com/users/wwj718/foll... | [] | closed | false | null | [] | null | [
"Nice catch, thank you!\n",
":smile: \n"
] | 2014-10-03T02:30:48 | 2014-10-03T12:15:15 | 2014-10-03T02:52:01 | CONTRIBUTOR | null | import datetime
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/441/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/441/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/441",
"html_url": "https://github.com/coleifer/peewee/pull/441",
"diff_url": "https://github.com/coleifer/peewee/pull/441.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/441.patch",
"merged_at": "2014-10-03T02:52:01"
} |
https://api.github.com/repos/coleifer/peewee/issues/440 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/440/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/440/comments | https://api.github.com/repos/coleifer/peewee/issues/440/events | https://github.com/coleifer/peewee/issues/440 | 44,759,584 | MDU6SXNzdWU0NDc1OTU4NA== | 440 | What is the meaning of Model.dirty_fields? | {
"login": "ak4nv",
"id": 73960,
"node_id": "MDQ6VXNlcjczOTYw",
"avatar_url": "https://avatars.githubusercontent.com/u/73960?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ak4nv",
"html_url": "https://github.com/ak4nv",
"followers_url": "https://api.github.com/users/ak4nv/followers",
"f... | [] | closed | false | null | [] | null | [
"Looks like a bug -- the `dirty_fields` property should return an empty list for instances that are fetched from the database. Thanks for letting me know!\n",
"Yeah, I read it in docs.\nI'll wait a bugfix. I need this functionality in my small project. :)\n"
] | 2014-10-03T01:59:27 | 2014-10-03T15:54:57 | 2014-10-03T15:54:57 | NONE | null | Just a code:
``` python
>>> from blueprints.auth.models import User
>>> user = User.get(User.id == 1)
>>> user.dirty_fields
[<peewee.PrimaryKeyField object at 0x7f8d2e948da0>, <peewee.CharField object at 0x7f8d2e9487b8>, <peewee.CharField object at 0x7f8d2e948a58>, <peewee.CharField object at 0x7f8d2e948898>, <peewee.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/440/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/440/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/439 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/439/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/439/comments | https://api.github.com/repos/coleifer/peewee/issues/439/events | https://github.com/coleifer/peewee/issues/439 | 44,606,553 | MDU6SXNzdWU0NDYwNjU1Mw== | 439 | Writing under a select query iterator results in unexpected behavior | {
"login": "josephschorr",
"id": 4073002,
"node_id": "MDQ6VXNlcjQwNzMwMDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/4073002?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/josephschorr",
"html_url": "https://github.com/josephschorr",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"Note: The above code works fine when executed on a MySQL database.\n",
"https://github.com/coleifer/peewee/issues/12#issuecomment-5614404\n\nAnd #109 and #327 and #388 and #437.\n\nPerhaps I need to add this very clearly to the docs?\n",
"Might help, but I think it would best to raise an exception if we can de... | 2014-10-01T19:41:51 | 2014-10-02T02:35:30 | 2014-10-02T02:35:30 | NONE | null | I'm seeing very odd behavior as a result of a loop over a select query which creates rows in another table.
```
from peewee import Model, SqliteDatabase, CharField, ForeignKeyField, create_model_tables
db = SqliteDatabase(':memory:')
class Person(Model):
name = CharField()
gender = CharField()
class Meta:
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/439/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/439/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/438 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/438/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/438/comments | https://api.github.com/repos/coleifer/peewee/issues/438/events | https://github.com/coleifer/peewee/issues/438 | 43,814,907 | MDU6SXNzdWU0MzgxNDkwNw== | 438 | Order of join clause with alias join and select can lead to invalid configurations | {
"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 | [
"Thanks for sharing some code to reproduce this!\n",
"Basically what peewee is trying to figure out is how to patch the joined instance (`PersonAlias`, which is actually a `Person`) onto `RelatesToPerson` given the join predicate. There's some special-casing around aliases and expressions -- I think there are som... | 2014-09-24T21:04:31 | 2014-09-27T09:34:07 | 2014-09-27T09:34:07 | NONE | null | I'm not sure how to describe the problem accurately, so here is a repro case:
``` python
from peewee import Model, SqliteDatabase, CharField, ForeignKeyField, create_model_tables
db = SqliteDatabase(':memory:')
class Person(Model):
name = CharField(default='aperson')
class Meta:
database = db
class ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/438/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/438/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/437 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/437/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/437/comments | https://api.github.com/repos/coleifer/peewee/issues/437/events | https://github.com/coleifer/peewee/issues/437 | 43,270,829 | MDU6SXNzdWU0MzI3MDgyOQ== | 437 | Query iteration bug? | {
"login": "frdfsnlght",
"id": 417767,
"node_id": "MDQ6VXNlcjQxNzc2Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/417767?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/frdfsnlght",
"html_url": "https://github.com/frdfsnlght",
"followers_url": "https://api.github.com/users/f... | [] | closed | false | null | [] | null | [
"Check out:\n- https://github.com/coleifer/peewee/issues/12#issuecomment-5614404\n- https://github.com/coleifer/peewee/issues/81\n"
] | 2014-09-19T18:57:40 | 2014-10-01T20:16:47 | 2014-09-19T19:00:31 | NONE | null | ``` python
from peewee import *
from datetime import datetime
db = SqliteDatabase('test.db')
class A(Model):
id = PrimaryKeyField()
date = DateTimeField()
class Meta:
database = db
A.create_table(fail_silently = True);
if not A.select().count():
A(date = datetime.now()).save()
A(date = da... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/437/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/437/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/436 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/436/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/436/comments | https://api.github.com/repos/coleifer/peewee/issues/436/events | https://github.com/coleifer/peewee/issues/436 | 43,212,512 | MDU6SXNzdWU0MzIxMjUxMg== | 436 | Query bug | {
"login": "ak4nv",
"id": 73960,
"node_id": "MDQ6VXNlcjczOTYw",
"avatar_url": "https://avatars.githubusercontent.com/u/73960?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ak4nv",
"html_url": "https://github.com/ak4nv",
"followers_url": "https://api.github.com/users/ak4nv/followers",
"f... | [] | closed | false | null | [] | null | [
"First of all, your use of the python `and` keyword is incorrect -- see [query operators table](http://docs.peewee-orm.com/en/latest/peewee/querying.html#query-operators), particularly the section on logical operators.\n\nAs to the other examples, I will take a look. Your final query (using `&`) looks like it shoul... | 2014-09-19T07:36:16 | 2014-09-24T11:39:15 | 2014-09-24T11:39:15 | NONE | null | ``` python
tasks = Task.select()\
.where(Task.deadline.year == year)\
.where(Task.performer << performers)\
.where(Task.state << (States.ACCEPTED, States.CLOSED))
```
peewee.OperationalError: user-defined function raised exception
``` python
tasks = Task.select()\
.where(Task.performer... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/436/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/436/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/435 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/435/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/435/comments | https://api.github.com/repos/coleifer/peewee/issues/435/events | https://github.com/coleifer/peewee/issues/435 | 43,134,965 | MDU6SXNzdWU0MzEzNDk2NQ== | 435 | Peewee gives error in combination with Flask-login | {
"login": "kramer65",
"id": 596581,
"node_id": "MDQ6VXNlcjU5NjU4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/596581?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kramer65",
"html_url": "https://github.com/kramer65",
"followers_url": "https://api.github.com/users/kramer6... | [] | closed | false | null | [] | null | [
"Peewee models implement a `get_id()` method, which is used by the `pk_expr()` method. I am guessing that is the source of the issue.\n"
] | 2014-09-18T13:52:20 | 2014-09-18T18:15:18 | 2014-09-18T18:15:18 | NONE | null | I'm trying to use peewee in combination with Flask-login, and I now get into trouble when implementing the `get_id()` method. The User class I have is as follows:
```
class User(db.Model, BaseUser):
username = CharField()
password = CharField()
def is_authenticated(self):
return True
def is_a... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/435/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/435/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/434 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/434/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/434/comments | https://api.github.com/repos/coleifer/peewee/issues/434/events | https://github.com/coleifer/peewee/issues/434 | 43,124,600 | MDU6SXNzdWU0MzEyNDYwMA== | 434 | Integration with mongodb? | {
"login": "kramer65",
"id": 596581,
"node_id": "MDQ6VXNlcjU5NjU4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/596581?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kramer65",
"html_url": "https://github.com/kramer65",
"followers_url": "https://api.github.com/users/kramer6... | [] | closed | false | null | [] | null | [
"I think you'll find that its better to use an existing library. Or be prepared to do a really close reading of the source code!\n",
"Basically you're going to be dealing with replacing the database classes and the query compiler. The model and field semantics are probably different as well. Please comment if you... | 2014-09-18T11:59:29 | 2014-09-18T21:14:43 | 2014-09-18T21:14:43 | NONE | null | I'm using Peewee in more and more projects now, but I'm currently working on a project in which we need to use MongoDB. Is there a way that I can make Peewee work with MongoDB? All tips are welcome!
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/434/reactions",
"total_count": 2,
"+1": 2,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/434/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/433 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/433/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/433/comments | https://api.github.com/repos/coleifer/peewee/issues/433/events | https://github.com/coleifer/peewee/issues/433 | 43,117,972 | MDU6SXNzdWU0MzExNzk3Mg== | 433 | Using Peewee with Twisted | {
"login": "fikisipi",
"id": 8115972,
"node_id": "MDQ6VXNlcjgxMTU5NzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/8115972?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/fikisipi",
"html_url": "https://github.com/fikisipi",
"followers_url": "https://api.github.com/users/fikis... | [] | closed | false | null | [] | null | [
"I have no plans to support twisted but I'd accept s pull request for a playhouse module. If you're interested, I'd start here: \n\nhttp://docs.peewee-orm.com/en/latest/peewee/database.html#adding-a-new-database-driver\n"
] | 2014-09-18T10:27:06 | 2014-09-18T21:07:50 | 2014-09-18T21:07:50 | NONE | null | At the moment, there is no way to use peewee with async Twisted.
Twisted handles database connections using [ConnectionPool](https://twistedmatrix.com/documents/14.0.0/api/twisted.enterprise.adbapi.ConnectionPool.html)
```
from twisted.enterprise import adbapi
db= adbapi.ConnectionPool("MySQLdb",
host = "",
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/433/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/433/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/432 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/432/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/432/comments | https://api.github.com/repos/coleifer/peewee/issues/432/events | https://github.com/coleifer/peewee/issues/432 | 42,946,454 | MDU6SXNzdWU0Mjk0NjQ1NA== | 432 | hstore extension is required to initialise a postgresql database | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"I'm not really sure what to do here -- it's kind of on the database user to install the extension if they want to use it.\n",
"The point is I don't want to use it, it's forcing me to install it to use peewee.\n",
"Oh, I see.\n",
"I've added a `register_hstore` parameter to `PostgresqlExtDatabase`. The defaul... | 2014-09-16T23:35:13 | 2019-06-18T19:51:15 | 2014-09-17T03:54:14 | CONTRIBUTOR | null | I've been meaning to write this one up for a while.. I've just installed the extension every time to avoid this one :)
```
Traceback (most recent call last):
File "peewee_bug.py", line 22, in <module>
MyModel.create_table()
File "/Users/alexlatchford/Code/peewee/peewee.py", line 3423, in create_table
db.cr... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/432/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/432/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/431 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/431/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/431/comments | https://api.github.com/repos/coleifer/peewee/issues/431/events | https://github.com/coleifer/peewee/issues/431 | 42,886,748 | MDU6SXNzdWU0Mjg4Njc0OA== | 431 | Iterating over big dataset | {
"login": "demongoo",
"id": 941459,
"node_id": "MDQ6VXNlcjk0MTQ1OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/941459?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/demongoo",
"html_url": "https://github.com/demongoo",
"followers_url": "https://api.github.com/users/demongo... | [] | closed | false | null | [] | null | [
"Normally peewee will cache result rows so that if you iterate, slice or index the result set multiple times you will not incur multiple queries. When you use `iterator()`, rows will not be cached.\n\nIt's still possible to run out of memory, depending on your database, because the rows are not streamed to the curs... | 2014-09-16T14:16:31 | 2022-03-02T06:57:45 | 2014-09-16T16:40:40 | NONE | null | I try to iterate result set:
```
for field1, field2 in query.tuples().iterator():
print ....
```
But it failes with 'out of memory' (script just gets killed by kernel), so, I see no difference in my case - either with iterator or without.
I have there python 2.6 and peewee 2.3.2.
I'm not familiar much with laz... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/431/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/431/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/430 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/430/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/430/comments | https://api.github.com/repos/coleifer/peewee/issues/430/events | https://github.com/coleifer/peewee/pull/430 | 42,834,293 | MDExOlB1bGxSZXF1ZXN0MjEyNzA1NjA= | 430 | Cast to db_value for insert queries | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"I thought I had commented on this, but looks like it did not get saved. At any rate, I believe that peewee should already be converting values using the associated field's `db_value`. If you take a look at `QueryCompiler.generate_insert`, you'll see this code:\n\n``` python\n for row_dict in query._iter... | 2014-09-16T00:46:27 | 2014-09-16T23:38:53 | 2014-09-16T23:26:52 | CONTRIBUTOR | null | I was getting problems with foreign key fields not being cast properly, looks like this is the solution. It's not well tested so you might want to have a play yourself before accepting.
``` python
class MyModel(Model):
uuid = UUIDField(primary_key=True)
class MyRelatedModel(Model):
name = CharField()
m... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/430/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/430/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/430",
"html_url": "https://github.com/coleifer/peewee/pull/430",
"diff_url": "https://github.com/coleifer/peewee/pull/430.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/430.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/429 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/429/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/429/comments | https://api.github.com/repos/coleifer/peewee/issues/429/events | https://github.com/coleifer/peewee/issues/429 | 42,832,945 | MDU6SXNzdWU0MjgzMjk0NQ== | 429 | UUID field is not instantiated multiple times for insert_many fields | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"Well, I would think that in those examples you would get an error because the first row's UUID would be `None`. But if you specified `default=uuid.uuid4` or something, I think your error would be replicated.\n",
"Ah yes, sorry I knew I'd forgotten something in the example! I've updated my original post\n",
"Sh... | 2014-09-16T00:19:06 | 2014-09-16T03:07:37 | 2014-09-16T03:07:37 | CONTRIBUTOR | null | Hi Charles,
``` python
class MyModel(Model):
uuid = UUIDField(primary_key=True, default=uuid.uuid4)
name = CharField()
my_models = [{"name": "foo"}, {"name": "bar"}]
MyModel.insert_many(my_models).execute()
```
You'll get the same uuid in `InsertQuery._defaults` applied to both rows and it'll result in an er... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/429/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/429/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/428 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/428/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/428/comments | https://api.github.com/repos/coleifer/peewee/issues/428/events | https://github.com/coleifer/peewee/issues/428 | 42,820,696 | MDU6SXNzdWU0MjgyMDY5Ng== | 428 | Docs build error for peewee-2.3.2 | {
"login": "pitchforks",
"id": 4378791,
"node_id": "MDQ6VXNlcjQzNzg3OTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4378791?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pitchforks",
"html_url": "https://github.com/pitchforks",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [] | 2014-09-15T21:24:28 | 2014-09-15T21:27:21 | 2014-09-15T21:27:21 | NONE | null | Getting this while running Sphinx v1.2.1 to build the docs
```
peewee-2.3.2/docs/peewee/playhouse.rst:2346: ERROR: Malformed table.
Text in column margin in table line 6.
================ ============= =======================================
Option Default Description
================ ========... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/428/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/428/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/427 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/427/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/427/comments | https://api.github.com/repos/coleifer/peewee/issues/427/events | https://github.com/coleifer/peewee/issues/427 | 42,732,661 | MDU6SXNzdWU0MjczMjY2MQ== | 427 | caniusepython3 thinks peewee does not support python3 | {
"login": "Amleto",
"id": 2996796,
"node_id": "MDQ6VXNlcjI5OTY3OTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2996796?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Amleto",
"html_url": "https://github.com/Amleto",
"followers_url": "https://api.github.com/users/Amleto/foll... | [] | closed | false | null | [] | null | [
"I'm not positive, I tried to find the reason or code in caniusepython3.com's codebase but didn't seem to see it.\n",
"Appears to be fixed with the latest release. Thanks for mentioning this.\n"
] | 2014-09-14T22:42:52 | 2014-09-15T18:32:09 | 2014-09-15T18:32:09 | NONE | null | Is this down to the tags used on pypi?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/427/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/427/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/426 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/426/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/426/comments | https://api.github.com/repos/coleifer/peewee/issues/426/events | https://github.com/coleifer/peewee/issues/426 | 42,641,325 | MDU6SXNzdWU0MjY0MTMyNQ== | 426 | pwiz.py SqliteIntrospector.get_foreign_keys | {
"login": "mattjvincent",
"id": 1842565,
"node_id": "MDQ6VXNlcjE4NDI1NjU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1842565?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mattjvincent",
"html_url": "https://github.com/mattjvincent",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"Hmmm... it seems also that ForeignKeyField have to be integers? I usually design my databases with keys being integers, but that's not always going to be the case. See above example. When populated and trying to use, errors occur trying to coerce to be ints.\n\n```\n/Library/Frameworks/Python.framework/Versions... | 2014-09-12T15:34:16 | 2014-09-24T11:44:55 | 2014-09-12T23:14:47 | NONE | null | Some SQLite databases will return EOL characters in the following query:
```
SELECT sql
FROM sqlite_master
WHERE (tbl_name = ? AND type = ?)
```
This makes it so foreign keys don't work. To fix change line **442 in pwiz.py**.
```
def get_foreign_keys(self, table, schema=None):
query = ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/426/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/426/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/425 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/425/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/425/comments | https://api.github.com/repos/coleifer/peewee/issues/425/events | https://github.com/coleifer/peewee/issues/425 | 42,635,767 | MDU6SXNzdWU0MjYzNTc2Nw== | 425 | ExtQueryWrapper raises exception when selecting fn.NOW() | {
"login": "demongoo",
"id": 941459,
"node_id": "MDQ6VXNlcjk0MTQ1OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/941459?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/demongoo",
"html_url": "https://github.com/demongoo",
"followers_url": "https://api.github.com/users/demongo... | [] | closed | false | null | [] | null | [
"Nice catch, you're right.\n"
] | 2014-09-12T14:40:34 | 2014-09-12T14:46:20 | 2014-09-12T14:46:20 | NONE | null | When using something like this: `Record.select(Record.datetime, fn.NOW()).tuples()`, on iteration exception gets thrown:
```
File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 1686, in next
obj = self.iterate()
File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 1672, in iterate
self.initi... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/425/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/425/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/424 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/424/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/424/comments | https://api.github.com/repos/coleifer/peewee/issues/424/events | https://github.com/coleifer/peewee/issues/424 | 42,551,982 | MDU6SXNzdWU0MjU1MTk4Mg== | 424 | `Expression.__bool__` should raise an exception | {
"login": "abarnert",
"id": 1808250,
"node_id": "MDQ6VXNlcjE4MDgyNTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1808250?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/abarnert",
"html_url": "https://github.com/abarnert",
"followers_url": "https://api.github.com/users/abarn... | [] | closed | false | null | [] | null | [
"I think raising an exception will prevent a lot of hard-to-diagnose bugs...great suggestion.\n",
"Unfortunately, this will mean overriding the `__nonzero__` method and there are just too many places where the truthiness of a node object is checked. Maybe I could override it only for `Expression`...\n",
"One th... | 2014-09-11T17:52:09 | 2014-09-13T00:35:45 | 2014-09-13T00:35:45 | NONE | null | I haven't looked carefully enough to know if this is a plausible idea or not, but…
I've seen multiple people getting confused because `where(Meal.spam==2 and Meal.eggs==3)` ignores the `Meal.spam=2` part. To anyone who understands how Python's `and` operator works, this is pretty obvious, but Peewee is very useful to ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/424/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/424/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/423 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/423/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/423/comments | https://api.github.com/repos/coleifer/peewee/issues/423/events | https://github.com/coleifer/peewee/issues/423 | 41,623,988 | MDU6SXNzdWU0MTYyMzk4OA== | 423 | Accessing column values using magic .c lookup with Subqueries | {
"login": "oneleaftea",
"id": 8613451,
"node_id": "MDQ6VXNlcjg2MTM0NTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/8613451?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/oneleaftea",
"html_url": "https://github.com/oneleaftea",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"Can you share the generated SQL for the query that is failing?\n",
"Hello,\nI think I figured out what the issue was:\n\nHere is the python code as originally written:\n\n``` python\njoinquery = Salaries.select().order_by(Salaries.salary.desc()).limit(howmany)\njoinquery = joinquery.alias('jq')\nquery = Employee... | 2014-09-01T10:03:39 | 2014-09-04T22:28:28 | 2014-09-04T22:28:28 | NONE | null | I ran into a behavior with peewee where it seems the .c lookup for a subquery only works for the **on clause**, but not for the **select()** and **order_by** clauses, as well as subsequent access in a **print** command.
For instance, this works
``` python
joinquery = Salaries.select().order_by(Salaries.salary.desc())... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/423/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/423/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/422 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/422/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/422/comments | https://api.github.com/repos/coleifer/peewee/issues/422/events | https://github.com/coleifer/peewee/issues/422 | 40,966,006 | MDU6SXNzdWU0MDk2NjAwNg== | 422 | Sub-queries using union | {
"login": "awahlig",
"id": 1263649,
"node_id": "MDQ6VXNlcjEyNjM2NDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1263649?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/awahlig",
"html_url": "https://github.com/awahlig",
"followers_url": "https://api.github.com/users/awahlig/... | [] | closed | false | null | [] | null | [
"Ahh, good catch. I had to be explicit about removing parentheses from union queries because one of the dbs (I think SQLite?) didn't like them, but I did not think about subqueries. I'll look into a fix, thanks for the great bug report.\n",
"Fixed in b13ff6c131d0722f6a3cfb54c8280bc99ea0\n"
] | 2014-08-23T03:22:45 | 2014-09-04T20:14:13 | 2014-09-04T20:13:53 | NONE | null | First of all, thanks for your continued great work! I've been using peewee successfully for quite some time now.
Today I hit a small issue though. If you build a union query and try to use it in WHERE of another query using << (IN), the union in the resulting SQL will not have parentheses around it which causes a synt... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/422/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/422/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/421 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/421/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/421/comments | https://api.github.com/repos/coleifer/peewee/issues/421/events | https://github.com/coleifer/peewee/issues/421 | 40,962,884 | MDU6SXNzdWU0MDk2Mjg4NA== | 421 | Python 3 problem with division | {
"login": "NJDFan",
"id": 8527880,
"node_id": "MDQ6VXNlcjg1Mjc4ODA=",
"avatar_url": "https://avatars.githubusercontent.com/u/8527880?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/NJDFan",
"html_url": "https://github.com/NJDFan",
"followers_url": "https://api.github.com/users/NJDFan/foll... | [] | closed | false | null | [] | null | [
"Thanks, good catch.\n"
] | 2014-08-23T00:42:18 | 2014-08-25T01:09:33 | 2014-08-25T01:09:33 | NONE | null | All the other mathematical operators work fine in queries, but division doesn't. This is most likely because Python3 killed `__div__` in favor of `__truediv__` and `__floordiv__`.
After the line that reads::
```
__div__ = _e(OP_DIV)
```
I put::
```
__truediv__ = _e(OP_DIV)
```
And that seemed to fix it, but I'm n... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/421/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/421/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/420 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/420/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/420/comments | https://api.github.com/repos/coleifer/peewee/issues/420/events | https://github.com/coleifer/peewee/issues/420 | 40,622,050 | MDU6SXNzdWU0MDYyMjA1MA== | 420 | Table name not quoted as of 2.3.0 | {
"login": "jhorman",
"id": 323697,
"node_id": "MDQ6VXNlcjMyMzY5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/323697?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jhorman",
"html_url": "https://github.com/jhorman",
"followers_url": "https://api.github.com/users/jhorman/fo... | [] | closed | false | null | [] | null | [
"See #414 -- I'll push a new release soon.\n",
"Oh, sorry, didn't see it was already filed.\n"
] | 2014-08-19T18:32:33 | 2014-08-19T20:18:33 | 2014-08-19T20:17:39 | CONTRIBUTOR | null | I accidentally upgraded to 2.3.0 on a staging environment, and /admin started throwing errors. I have a table called `user` (I regret this, it is a keyword), and in 2.2.5 everything is ok. In 2.3.0, `user` is no longer quoted properly when attempting to update a record in /admin, possibly everywhere. I end up with
```... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/420/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/420/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/419 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/419/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/419/comments | https://api.github.com/repos/coleifer/peewee/issues/419/events | https://github.com/coleifer/peewee/issues/419 | 40,429,077 | MDU6SXNzdWU0MDQyOTA3Nw== | 419 | python_value not returning as expected | {
"login": "sojourning",
"id": 537668,
"node_id": "MDQ6VXNlcjUzNzY2OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/537668?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sojourning",
"html_url": "https://github.com/sojourning",
"followers_url": "https://api.github.com/users/s... | [] | closed | false | null | [] | null | [] | 2014-08-17T07:52:36 | 2014-08-18T23:11:14 | 2014-08-18T23:11:14 | NONE | null | Never mind. Figured it out. Thanks
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/419/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/419/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/418 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/418/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/418/comments | https://api.github.com/repos/coleifer/peewee/issues/418/events | https://github.com/coleifer/peewee/issues/418 | 40,403,054 | MDU6SXNzdWU0MDQwMzA1NA== | 418 | “exc_value.args” at line 2591 may caused the error " AttributeError: 'str' object has no attribute 'args' " sometime | {
"login": "JoneXiong",
"id": 2276625,
"node_id": "MDQ6VXNlcjIyNzY2MjU=",
"avatar_url": "https://avatars.githubusercontent.com/u/2276625?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JoneXiong",
"html_url": "https://github.com/JoneXiong",
"followers_url": "https://api.github.com/users/Jo... | [] | closed | false | null | [] | null | [
"On python 2, I get:\n\n```\nProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 140311384954624 and this is thread id 140311230535424\n```\n\nWhich I believe is the correct traceback. What python version are you using?\n",
"Actually, on py... | 2014-08-16T04:12:51 | 2015-05-18T18:54:02 | 2014-08-28T14:18:19 | NONE | null | eg:
if you haven't seted "check_same_thread=False" may lead to:
exc_value = “SQLite objects created in a thread can only be used in that same thread.The object was created in thread id.....”
and then:
reraise(new_type, new_type(*exc_value.args), traceback)
AttributeError: 'str' object has no attribute 'args'
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/418/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/418/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/417 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/417/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/417/comments | https://api.github.com/repos/coleifer/peewee/issues/417/events | https://github.com/coleifer/peewee/issues/417 | 40,303,486 | MDU6SXNzdWU0MDMwMzQ4Ng== | 417 | peewee regexp works only the first time | {
"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 | [
"The `regexp` function is covered by unit tests and I can verify from local testing that it works. Can you share your code that is causing the problem? I wonder if at some point in between you are assigning a value to `Table.column` (maybe using single `=` sign instead of 2)?\n",
"Hello. This is usually what I ru... | 2014-08-14T21:50:49 | 2014-08-18T23:13:15 | 2014-08-16T14:08:51 | NONE | null | I'm running into an issue with the peewee regexp function. Queries like this work the first time I run it:
query = Table.select().where(Table.column.regexp('string'))
However, if I try to run it with a different string, I get this error: 'unicode' object has no attribute 'regexp':
query = Table.select().where(Table.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/417/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/417/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/416 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/416/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/416/comments | https://api.github.com/repos/coleifer/peewee/issues/416/events | https://github.com/coleifer/peewee/issues/416 | 40,274,720 | MDU6SXNzdWU0MDI3NDcyMA== | 416 | Database.drop_tables hide warning when a table doesn't exist | {
"login": "rvindas-gap",
"id": 8330613,
"node_id": "MDQ6VXNlcjgzMzA2MTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/8330613?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rvindas-gap",
"html_url": "https://github.com/rvindas-gap",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"When I test this locally it appears to be working correctly:\n\n``` python\nIn [4]: db.drop_tables([User])\n\n.... traceback ....\n\n/home/charles/pypath/peewee.pyc in execute_sql(self, sql, params, require_commit)\n 2711 cursor = self.get_cursor()\n 2712 try:\n-> 2713 c... | 2014-08-14T16:51:21 | 2016-12-02T12:09:44 | 2014-08-14T21:05:28 | NONE | null | Just ugraded to version 2.3.0 and I was trying the `drop_tables` function. If a table doesn't exist then I get a warning like the following (even specifying the `safe=True` parameter)
```
/mypathto/env/site-packages/peewee.py:2702: Warning: Unknown table 'variables' cursor.execute(sql, params or ())
/mypathto/env/site... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/416/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/416/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/415 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/415/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/415/comments | https://api.github.com/repos/coleifer/peewee/issues/415/events | https://github.com/coleifer/peewee/issues/415 | 40,255,541 | MDU6SXNzdWU0MDI1NTU0MQ== | 415 | Regexp only works 1st time | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [] | 2014-08-14T13:48:38 | 2014-08-14T14:01:31 | 2014-08-14T14:01:31 | OWNER | null | I'm running into an issue with the peewee regexp function. Queries like this work the first time I run it:
```
query = Table.select().where(Table.column.regexp('string'))
```
However, if I try to run it with a different string, I get this error: 'unicode' object has no attribute 'regexp':
```
query = Table.select().... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/415/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/415/timeline | null | completed | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.