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/2118 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2118/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2118/comments | https://api.github.com/repos/coleifer/peewee/issues/2118/events | https://github.com/coleifer/peewee/issues/2118 | 573,608,441 | MDU6SXNzdWU1NzM2MDg0NDE= | 2,118 | How works count subquery? | {
"login": "EugeneRymarev",
"id": 6260309,
"node_id": "MDQ6VXNlcjYyNjAzMDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/6260309?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/EugeneRymarev",
"html_url": "https://github.com/EugeneRymarev",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"Fixed. As a workaround until I tag a new release, you can use:\r\n\r\n```python\r\nExpression(subquery, OP.EQ, 0)\r\n```\r\n\r\nInstead of `subquery == 0`."
] | 2020-03-01T20:20:35 | 2020-04-01T13:30:31 | 2020-03-01T21:52:33 | NONE | null | I need count in subquery. Example at http://docs.peewee-orm.com/en/latest/peewee/hacks.html#other-methods
My code:
```
subquery_condition = (UserSurvey.user == User.id) & (UserSurvey.is_current == False)
subquery = (UserSurvey.select(fn.COUNT(UserSurvey.id)).where(subquery_condition))
condition = User.next_notify ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2118/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/2118/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2117 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2117/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2117/comments | https://api.github.com/repos/coleifer/peewee/issues/2117/events | https://github.com/coleifer/peewee/pull/2117 | 573,007,845 | MDExOlB1bGxSZXF1ZXN0MzgxNTk3ODU5 | 2,117 | Update sqliteq.py | {
"login": "dev-dsp",
"id": 4235552,
"node_id": "MDQ6VXNlcjQyMzU1NTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/4235552?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dev-dsp",
"html_url": "https://github.com/dev-dsp",
"followers_url": "https://api.github.com/users/dev-dsp/... | [] | closed | false | null | [] | null | [] | 2020-02-28T21:13:46 | 2020-02-28T23:00:57 | 2020-02-28T23:00:57 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2117/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/2117/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2117",
"html_url": "https://github.com/coleifer/peewee/pull/2117",
"diff_url": "https://github.com/coleifer/peewee/pull/2117.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2117.patch",
"merged_at": "2020-02-28T23:00:57"
} | |
https://api.github.com/repos/coleifer/peewee/issues/2116 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2116/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2116/comments | https://api.github.com/repos/coleifer/peewee/issues/2116/events | https://github.com/coleifer/peewee/pull/2116 | 572,999,914 | MDExOlB1bGxSZXF1ZXN0MzgxNTkxMjU3 | 2,116 | add jsonb array oid | {
"login": "james-lawrence",
"id": 2835871,
"node_id": "MDQ6VXNlcjI4MzU4NzE=",
"avatar_url": "https://avatars.githubusercontent.com/u/2835871?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/james-lawrence",
"html_url": "https://github.com/james-lawrence",
"followers_url": "https://api.gith... | [] | closed | false | null | [] | null | [
"I don't think using arrays with jsonb is a sensible thing for anyone to do, since json has a native list type already. Going to pass on this.",
"whether you think it is sensible is immaterial, postgresql allows it. and clearly some people have usecases for it.\r\n"
] | 2020-02-28T20:56:16 | 2020-03-04T12:45:30 | 2020-02-28T21:11:09 | CONTRIBUTOR | null | attempts to add JSONB array column to postgresql.
however unsure of how to use it. the generated code looks correct
however these fail:
```python
Model.update(array=[{}]).where(Model.id == 1).execute()
Model.create(array=[{}])
``` | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2116/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/2116/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2116",
"html_url": "https://github.com/coleifer/peewee/pull/2116",
"diff_url": "https://github.com/coleifer/peewee/pull/2116.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2116.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/2115 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2115/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2115/comments | https://api.github.com/repos/coleifer/peewee/issues/2115/events | https://github.com/coleifer/peewee/issues/2115 | 572,379,320 | MDU6SXNzdWU1NzIzNzkzMjA= | 2,115 | Fix for #1991 causes DoesNotExist error during row iteration | {
"login": "brandond",
"id": 370103,
"node_id": "MDQ6VXNlcjM3MDEwMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/370103?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/brandond",
"html_url": "https://github.com/brandond",
"followers_url": "https://api.github.com/users/brandon... | [] | closed | false | null | [] | null | [
"```sql\r\nSELECT\r\n COALESCE(\"t1\".\"guid\", \"t2\".\"guid\") AS \"guid\",\r\n COALESCE(\"t1\".\"remedy_group\", ?) AS \"name\",\r\n \"t3\".\"id\",\r\n COUNT(\"t2\".\"host_id\") AS \"count\",\r\n JSON_GROUP_ARRAY(\"t2\".\"host_id\") AS \"host_ids\" \r\nFROM \"vulnerability\" AS \"t2\" \r\nINNER JOIN \"plugi... | 2020-02-27T21:44:37 | 2020-03-02T22:16:34 | 2020-03-02T20:42:57 | NONE | null | I have a rather large cross-model join query that started throwing an exception after updating from 3.9.6 to 3.13.1. This appears to be caused by the fix for #1991 .
The query is:
```python
for inc in (self.vulnerabilities
.select(fn.COALESCE(Team.guid, Vulnerability.guid).alias('g... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2115/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/2115/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2114 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2114/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2114/comments | https://api.github.com/repos/coleifer/peewee/issues/2114/events | https://github.com/coleifer/peewee/issues/2114 | 569,523,683 | MDU6SXNzdWU1Njk1MjM2ODM= | 2,114 | generate_models on SQLite database throws KeyError when database contains invalid foreign keys | {
"login": "kohavytank",
"id": 46892817,
"node_id": "MDQ6VXNlcjQ2ODkyODE3",
"avatar_url": "https://avatars.githubusercontent.com/u/46892817?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kohavytank",
"html_url": "https://github.com/kohavytank",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"Ehhh, man that's a really quite badly-broken schema. Not using constraints is one thing, but using constraints and then having them be extremely broken is not really something I intend to support.\r\n\r\nIf you need a workaround, just use pwiz' \"-t\" option to explicitly specify the list of un-broken tables, and ... | 2020-02-23T16:49:03 | 2020-02-23T20:34:09 | 2020-02-23T20:34:08 | NONE | null | Because foreign key constraints in SQLite can be disabled (and is disabled by default), it is possible to create a table with an invalid foreign key, like this:
```python
from peewee import SqliteDatabase
sqlite_db = SqliteDatabase(':memory:')
sqlite_db.execute_sql("""CREATE TABLE IF NOT EXISTS "table1" ("_id" INTE... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2114/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/2114/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2113 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2113/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2113/comments | https://api.github.com/repos/coleifer/peewee/issues/2113/events | https://github.com/coleifer/peewee/issues/2113 | 568,820,837 | MDU6SXNzdWU1Njg4MjA4Mzc= | 2,113 | Update record through foreign key | {
"login": "albireox",
"id": 568775,
"node_id": "MDQ6VXNlcjU2ODc3NQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/568775?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/albireox",
"html_url": "https://github.com/albireox",
"followers_url": "https://api.github.com/users/albireo... | [] | closed | false | null | [] | null | [
"Peewee is an active record ORM, so you would need to `save()` any instances you modify."
] | 2020-02-21T08:56:33 | 2020-02-21T16:29:21 | 2020-02-21T16:29:21 | NONE | null | If I have two tables, say `User` and `Tweet` related via a foreign key, and I try to do
```python
tweet = Tweet.select().first()
tweet.user.name = 'John Smith'
tweet.save()
```
The new name for the user is not saved (although no error is raised and `tweet.save()` returns `1`). The same is true if I do `tweet.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2113/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/2113/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2112 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2112/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2112/comments | https://api.github.com/repos/coleifer/peewee/issues/2112/events | https://github.com/coleifer/peewee/issues/2112 | 567,168,858 | MDU6SXNzdWU1NjcxNjg4NTg= | 2,112 | playhouse.reflection.generate_models does not reflect field constraints | {
"login": "gregspurrier",
"id": 5880,
"node_id": "MDQ6VXNlcjU4ODA=",
"avatar_url": "https://avatars.githubusercontent.com/u/5880?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gregspurrier",
"html_url": "https://github.com/gregspurrier",
"followers_url": "https://api.github.com/users/gre... | [] | closed | false | null | [] | null | [
"We don't currently support inspecting constraints besides \"NOT NULL\" and an implied \"UNIQUE\"."
] | 2020-02-18T21:27:31 | 2020-02-18T21:30:04 | 2020-02-18T21:30:04 | NONE | null | Using peewee 3.13.1 with PostgreSQL 9.6.15 and psycopg2 2.8.2, I noticed that a model class generated with `generate_models()` had a column that did not reflect its specified `constraints`:
```python
from peewee import TextField, Check
from playhouse.reflection import generate_models
class TestModel(db.Model):
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2112/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/2112/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2111 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2111/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2111/comments | https://api.github.com/repos/coleifer/peewee/issues/2111/events | https://github.com/coleifer/peewee/issues/2111 | 567,161,372 | MDU6SXNzdWU1NjcxNjEzNzI= | 2,111 | playhouse.reflection.generate_models does not reflect index_type | {
"login": "gregspurrier",
"id": 5880,
"node_id": "MDQ6VXNlcjU4ODA=",
"avatar_url": "https://avatars.githubusercontent.com/u/5880?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gregspurrier",
"html_url": "https://github.com/gregspurrier",
"followers_url": "https://api.github.com/users/gre... | [] | closed | false | null | [] | null | [
"Currently we don't support detection of special index-types."
] | 2020-02-18T21:12:53 | 2020-02-18T21:30:28 | 2020-02-18T21:30:28 | NONE | null | Using peewee 3.13.1 with PostgreSQL 9.6.15 and psycopg2 2.8.2, I noticed that a model class generated with generate_models() had a column that did not reflect its specified `index_type`:
```python
# db is a FlaskDB object
class TestModel(db.Model):
a_field = TextField(index=True, index_type="BRIN")
TestMod... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2111/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/2111/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2110 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2110/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2110/comments | https://api.github.com/repos/coleifer/peewee/issues/2110/events | https://github.com/coleifer/peewee/pull/2110 | 565,960,340 | MDExOlB1bGxSZXF1ZXN0Mzc1ODY1NzMy | 2,110 | Fix tests for UTC >=+ 4 timezones | {
"login": "felixonmars",
"id": 1006477,
"node_id": "MDQ6VXNlcjEwMDY0Nzc=",
"avatar_url": "https://avatars.githubusercontent.com/u/1006477?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/felixonmars",
"html_url": "https://github.com/felixonmars",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Thanks!"
] | 2020-02-16T19:59:54 | 2020-02-17T01:24:45 | 2020-02-17T00:40:10 | CONTRIBUTOR | null | Currently test_timestamp_field_from_ts assumes the timezone to be less than +4 so it remains the same day. This would fail when running with for example UTC+8:
```
======================================================================
FAIL: test_timestamp_field_parts (tests.fields.TestTimestampField)
------------... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2110/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/2110/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2110",
"html_url": "https://github.com/coleifer/peewee/pull/2110",
"diff_url": "https://github.com/coleifer/peewee/pull/2110.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2110.patch",
"merged_at": "2020-02-17T00:40:09"
} |
https://api.github.com/repos/coleifer/peewee/issues/2109 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2109/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2109/comments | https://api.github.com/repos/coleifer/peewee/issues/2109/events | https://github.com/coleifer/peewee/pull/2109 | 565,950,202 | MDExOlB1bGxSZXF1ZXN0Mzc1ODU4NzIx | 2,109 | postgres/introspector: fix query to find capitalized table | {
"login": "fmarcolino",
"id": 19367970,
"node_id": "MDQ6VXNlcjE5MzY3OTcw",
"avatar_url": "https://avatars.githubusercontent.com/u/19367970?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/fmarcolino",
"html_url": "https://github.com/fmarcolino",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [] | 2020-02-16T18:48:10 | 2020-02-17T00:37:39 | 2020-02-17T00:37:39 | CONTRIBUTOR | null | Fixes #2108
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2109/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/2109/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2109",
"html_url": "https://github.com/coleifer/peewee/pull/2109",
"diff_url": "https://github.com/coleifer/peewee/pull/2109.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2109.patch",
"merged_at": "2020-02-17T00:37:38"
} |
https://api.github.com/repos/coleifer/peewee/issues/2108 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2108/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2108/comments | https://api.github.com/repos/coleifer/peewee/issues/2108/events | https://github.com/coleifer/peewee/issues/2108 | 565,949,595 | MDU6SXNzdWU1NjU5NDk1OTU= | 2,108 | playhouse/introspector: doesn't work with capitalized table names (Postgres DB) | {
"login": "fmarcolino",
"id": 19367970,
"node_id": "MDQ6VXNlcjE5MzY3OTcw",
"avatar_url": "https://avatars.githubusercontent.com/u/19367970?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/fmarcolino",
"html_url": "https://github.com/fmarcolino",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"Thanks, I've merged your patch."
] | 2020-02-16T18:43:53 | 2020-02-17T00:37:52 | 2020-02-17T00:37:38 | CONTRIBUTOR | null | Hello, I'm trying inspect a table, but he doesn't find her. A exception is raised: UndefinedTable. I think that there is a bug in the query. When we don't put the double quotes in the table name, the postgres database consider name table as lower case.
` had the incorrect order for the keys of a reflected compound index:
```
# \d typicaluser
Table "public.typicaluser"
Column | Type | Collation | Nulla... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2104/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/2104/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2103 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2103/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2103/comments | https://api.github.com/repos/coleifer/peewee/issues/2103/events | https://github.com/coleifer/peewee/issues/2103 | 563,252,971 | MDU6SXNzdWU1NjMyNTI5NzE= | 2,103 | ForeignKeyFields out of sync? | {
"login": "oz123",
"id": 1083045,
"node_id": "MDQ6VXNlcjEwODMwNDU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1083045?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/oz123",
"html_url": "https://github.com/oz123",
"followers_url": "https://api.github.com/users/oz123/follower... | [] | closed | false | null | [] | null | [
"usermessage is not user? I think you have problems with your schema. Peewee is not fundamentally broken, if that's what you're suggesting.\r\n\r\nTry stackoverflow for questions like these in the future.",
"I am not suggesting peewee is broken. I am just trying to figure what is going on here. \r\nI being bugged... | 2020-02-11T14:41:42 | 2020-02-11T19:07:59 | 2020-02-11T17:54:15 | NONE | null | At the risk of sounding stupid, I don't know how to give this issue a title.
I have the following database schema:
```python
class UserMessage(BaseModel):
uuid = UUIDField(index=True)
link = UUIDField(index=True)
email = CharField()
name = CharField()
message = CharField()
timestamp... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2103/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/2103/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2102 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2102/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2102/comments | https://api.github.com/repos/coleifer/peewee/issues/2102/events | https://github.com/coleifer/peewee/pull/2102 | 562,803,993 | MDExOlB1bGxSZXF1ZXN0MzczMzMzNDEw | 2,102 | Add `.union` to the CTE class | {
"login": "aconz2",
"id": 3137597,
"node_id": "MDQ6VXNlcjMxMzc1OTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/3137597?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aconz2",
"html_url": "https://github.com/aconz2",
"followers_url": "https://api.github.com/users/aconz2/foll... | [] | closed | false | null | [] | null | [
"UNION ALL is provided because it is needed for writing recursive queries, so the omission was somewhat intentional.",
"And UNION is required for writing other recursive queries. I added another small example to further illustrate the difference [here](https://github.com/aconz2/peewee/blob/feature/cte-union/tests... | 2020-02-10T20:19:41 | 2020-02-12T17:40:29 | 2020-02-12T17:19:43 | CONTRIBUTOR | null | This complements the existing `union_all` method for CTE's.
`tests/sql.py` is purely syntactic b/c the following are identical
```
echo 'WITH RECURSIVE "fibonacci" AS (SELECT 1 AS "n", 0 AS "fib_n", 1 AS "next_fib_n" UNION ALL SELECT ("fibonacci"."n" + 1) AS "n", "fibonacci"."next_fib_n", ("fibonacci"."fib_n" + "... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2102/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/2102/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2102",
"html_url": "https://github.com/coleifer/peewee/pull/2102",
"diff_url": "https://github.com/coleifer/peewee/pull/2102.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2102.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/2101 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2101/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2101/comments | https://api.github.com/repos/coleifer/peewee/issues/2101/events | https://github.com/coleifer/peewee/issues/2101 | 562,225,544 | MDU6SXNzdWU1NjIyMjU1NDQ= | 2,101 | inserting silently fails | {
"login": "DavHau",
"id": 42246742,
"node_id": "MDQ6VXNlcjQyMjQ2NzQy",
"avatar_url": "https://avatars.githubusercontent.com/u/42246742?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/DavHau",
"html_url": "https://github.com/DavHau",
"followers_url": "https://api.github.com/users/DavHau/fo... | [] | closed | false | null | [] | null | [
"When you have a primary key that is not autogenerated, you need to specify `force_insert=True` when saving.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html#id4\r\n\r\nHere's my advice: don't use composite keys. Just use the standard autoinc primary key and use a multi-column unique constraint. You'l... | 2020-02-09T19:23:42 | 2020-02-09T20:26:18 | 2020-02-09T20:26:18 | NONE | null | python: 3.7
peewee: 3.13.1
The following code fails to insert without any notice:
```python
from peewee import *
db = SqliteDatabase(f'test.db')
class BaseModel(Model):
class Meta:
database = db
class Script(BaseModel):
name = CharField()
version = CharField()
script = TextFi... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2101/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/2101/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2100 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2100/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2100/comments | https://api.github.com/repos/coleifer/peewee/issues/2100/events | https://github.com/coleifer/peewee/issues/2100 | 562,024,451 | MDU6SXNzdWU1NjIwMjQ0NTE= | 2,100 | on_conflict(update) doesn't return count of changed rows | {
"login": "vladiscripts",
"id": 6325118,
"node_id": "MDQ6VXNlcjYzMjUxMTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/6325118?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vladiscripts",
"html_url": "https://github.com/vladiscripts",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"In this minimal test, using an auto-increment primary key, Peewee is returning the PK of the modified row:\r\n\r\n```python\r\n\r\ndb = SqliteDatabase(':memory:')\r\n# Or use postgres\r\n# db = PostgresqlDatabase('peewee_test')\r\n\r\nclass Register(Model):\r\n key = TextField(unique=True)\r\n value = Intege... | 2020-02-08T14:15:44 | 2021-03-08T12:11:44 | 2020-02-09T17:14:04 | NONE | null | The `Insert.execute()` and `Update.execute()` methods, when making changes, return non-zero values, according to the [help](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.update).
The `Insert.on_conflict().execute()` method works same.
But `Insert.on_conflict(update = ...).execute()` makes changes alwa... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2100/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/2100/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2099 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2099/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2099/comments | https://api.github.com/repos/coleifer/peewee/issues/2099/events | https://github.com/coleifer/peewee/issues/2099 | 559,567,176 | MDU6SXNzdWU1NTk1NjcxNzY= | 2,099 | LATERAL join without on= | {
"login": "albireox",
"id": 568775,
"node_id": "MDQ6VXNlcjU2ODc3NQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/568775?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/albireox",
"html_url": "https://github.com/albireox",
"followers_url": "https://api.github.com/users/albireo... | [] | closed | false | null | [] | null | [
"Can you share your desired SQL?",
"Possibly there's some quirk in Postgresql's query grammar that requires the \"ON true\" clause. That's rather annoying that it's so particular about it -- but for now I'll suggest using `SQL('true')` until I can look into this a bit more.",
"The desired SQL would be \r\n\r\n`... | 2020-02-04T08:43:01 | 2020-02-04T12:47:45 | 2020-02-04T12:47:45 | NONE | null | I'm trying to do the following query
```python
class Sky(peewee.Model):
pk = peewee.PrimaryKeyField()
ra = peewee.FloatField()
dec = peewee.FloatField()
class Meta:
db_table = 'sky'
database = database
# Select a sample here. For now use just a filter on pk for testing.
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2099/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/2099/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2098 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2098/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2098/comments | https://api.github.com/repos/coleifer/peewee/issues/2098/events | https://github.com/coleifer/peewee/issues/2098 | 558,627,057 | MDU6SXNzdWU1NTg2MjcwNTc= | 2,098 | Recursive save | {
"login": "ZhaofengWu",
"id": 11954789,
"node_id": "MDQ6VXNlcjExOTU0Nzg5",
"avatar_url": "https://avatars.githubusercontent.com/u/11954789?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ZhaofengWu",
"html_url": "https://github.com/ZhaofengWu",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"It's pretty simple - check out: https://github.com/coleifer/flask-peewee/blob/master/flask_peewee/rest.py#L419 for an example of how flask-peewee's REST module handles it.\r\n\r\nYou could also write something recursive. To get the relations, just look at the `model._meta.refs` dict, which maps field instances to ... | 2020-02-02T01:42:43 | 2020-02-03T12:33:58 | 2020-02-02T12:08:40 | NONE | null | Is there a convenient function to recursively save a nested object? I'm using [`dict_to_model`](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#dict_to_model) that produces a nested object, and calling `save` on the returned object seems to only save the top-level one. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2098/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/2098/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2097 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2097/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2097/comments | https://api.github.com/repos/coleifer/peewee/issues/2097/events | https://github.com/coleifer/peewee/issues/2097 | 557,937,560 | MDU6SXNzdWU1NTc5Mzc1NjA= | 2,097 | About optional field | {
"login": "ZhaofengWu",
"id": 11954789,
"node_id": "MDQ6VXNlcjExOTU0Nzg5",
"avatar_url": "https://avatars.githubusercontent.com/u/11954789?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ZhaofengWu",
"html_url": "https://github.com/ZhaofengWu",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"If a field is optional, use `null=True`. It will default to an empty (NULL) value."
] | 2020-01-31T06:17:53 | 2020-01-31T14:17:07 | 2020-01-31T14:17:07 | NONE | null | If I want to designate some `Field` as being optional, in its `__init__` should I use `null=True`, or set `default` to some value (`"NULL"` or `None`)? Or should I be using both of these two options at the same time? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2097/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/2097/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2096 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2096/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2096/comments | https://api.github.com/repos/coleifer/peewee/issues/2096/events | https://github.com/coleifer/peewee/issues/2096 | 555,560,080 | MDU6SXNzdWU1NTU1NjAwODA= | 2,096 | Just the first row can be inserted by insert_many(). The database I uesd is postgresql | {
"login": "TraderWithPython",
"id": 45730706,
"node_id": "MDQ6VXNlcjQ1NzMwNzA2",
"avatar_url": "https://avatars.githubusercontent.com/u/45730706?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/TraderWithPython",
"html_url": "https://github.com/TraderWithPython",
"followers_url": "https://... | [] | closed | false | null | [] | null | [
"I'm not sure what to tell you, but I've added a (passing) unit-test which shows that this is working correctly in my test setup. If you can provide me a minimal failing test-case I will re-examine, but I think the problem is not with Peewee."
] | 2020-01-27T13:04:23 | 2020-01-27T15:06:42 | 2020-01-27T15:06:42 | NONE | null | The model is
class DbTick(Model):
instrument_id: str = CharField()
datetime: datetime = DateTimeField()
bid_price1: float = FloatField()
bid_price2: float = FloatField(null=True)
bid_price3: float = FloatField(null=True)
bid_pr... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2096/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/2096/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2095 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2095/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2095/comments | https://api.github.com/repos/coleifer/peewee/issues/2095/events | https://github.com/coleifer/peewee/issues/2095 | 554,845,500 | MDU6SXNzdWU1NTQ4NDU1MDA= | 2,095 | Q: How to defer SqliteQueueDatabase? | {
"login": "BoboTiG",
"id": 2033598,
"node_id": "MDQ6VXNlcjIwMzM1OTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/2033598?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/BoboTiG",
"html_url": "https://github.com/BoboTiG",
"followers_url": "https://api.github.com/users/BoboTiG/... | [] | closed | false | null | [] | null | [
"The tables *are* created, but since this multi-threaded, their creation may be deferred for a moment.\r\n\r\nFor example:\r\n\r\n```python\r\n\r\ndb = SqliteQueueDatabase(None)\r\n\r\nclass Reg(Model):\r\n key = TextField()\r\n value = IntegerField()\r\n class Meta:\r\n database = db\r\n\r\ndb.init... | 2020-01-24T16:52:31 | 2022-11-04T13:10:29 | 2020-01-24T21:24:01 | NONE | null | Hello,
This is a very great module, thanks for that :muscle:
I am trying to defer `SqliteQueueDatabase` initalization as the database filename is only known at run-time. This is the code:
```python
# models.py
PRAGMAS = (("foreign_keys", 1), ("journal_mode", "wal"), ("synchronous", 3))
DATABASE = SqliteQueue... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2095/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/2095/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2094 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2094/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2094/comments | https://api.github.com/repos/coleifer/peewee/issues/2094/events | https://github.com/coleifer/peewee/issues/2094 | 554,773,212 | MDU6SXNzdWU1NTQ3NzMyMTI= | 2,094 | Array aggregate with ORDER BY clause | {
"login": "iksteen",
"id": 1001206,
"node_id": "MDQ6VXNlcjEwMDEyMDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1001206?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/iksteen",
"html_url": "https://github.com/iksteen",
"followers_url": "https://api.github.com/users/iksteen/... | [] | closed | false | null | [] | null | [
"The method you're describing is an acceptable way of handling this. I'm going to pass on implementing a fix right now, but may reconsider it later.",
"Actual fix is now in: fe84246980d0b68290db9566b40dad446eefd600",
"That's awesome! Thanks for the quick response (and implementing the feature!)."
] | 2020-01-24T14:39:05 | 2020-01-25T15:07:27 | 2020-01-24T21:15:17 | NONE | null | Postgresql supports ordered array aggregation in the form of:
`ARRAY_AGG(expression [ORDER BY [sort_expression {ASC | DESC}], [...])`
The way I currently implement it:
```
fn.array_agg(NodeList([
subscriptions_q.c.topic_id,
SQL("ORDER BY"),
popularity_q.c.popularity.asc(),
]))
```
Do you happe... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2094/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/2094/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2093 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2093/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2093/comments | https://api.github.com/repos/coleifer/peewee/issues/2093/events | https://github.com/coleifer/peewee/issues/2093 | 554,259,022 | MDU6SXNzdWU1NTQyNTkwMjI= | 2,093 | join model with prefetched another model | {
"login": "senya96",
"id": 11079921,
"node_id": "MDQ6VXNlcjExMDc5OTIx",
"avatar_url": "https://avatars.githubusercontent.com/u/11079921?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/senya96",
"html_url": "https://github.com/senya96",
"followers_url": "https://api.github.com/users/senya9... | [] | closed | false | null | [] | null | [] | 2020-01-23T16:16:11 | 2020-01-24T12:24:59 | 2020-01-24T12:24:59 | NONE | null | Hello.
I have 3 models.
```python
class Model1(peewee.Model):
model2 = ForeignKeyField(Model2)
class Model2(peewee.Model):
pass
class Model3(peewee.Model):
model2 = ForeignKeyField(Model2)
```
I want to select all data from **Model1** joined with **Model2** and prefetch all **Model3-objects** to ever... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2093/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/2093/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2092 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2092/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2092/comments | https://api.github.com/repos/coleifer/peewee/issues/2092/events | https://github.com/coleifer/peewee/issues/2092 | 553,178,196 | MDU6SXNzdWU1NTMxNzgxOTY= | 2,092 | Select the nth element of an array created dynamically in a query | {
"login": "bdoms",
"id": 126839,
"node_id": "MDQ6VXNlcjEyNjgzOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/126839?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bdoms",
"html_url": "https://github.com/bdoms",
"followers_url": "https://api.github.com/users/bdoms/followers"... | [] | closed | false | null | [] | null | [
"You need a couple things. It seems postgres *requires* the additional parentheses around the function invocation -- which is annoying but workable.\r\n\r\n```python\r\n\r\nfrom peewee import EnclosedNodeList\r\nfrom playhouse.postgres_ext import ObjectSlice\r\n\r\n# Function invocation - nothing weird here.\r\nf =... | 2020-01-21T22:26:49 | 2020-01-21T23:57:18 | 2020-01-21T23:57:17 | NONE | null | Love peewee, using the most recent version (3.13.1) and I've run into a situation causing an error. I may not have the right syntax, but after scouring the web and the docs and the source code I can't find it if it exists.
I'm trying to mimic this SQL, which works in Postgres:
```sql
select (string_to_array(page... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2092/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/2092/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2091 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2091/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2091/comments | https://api.github.com/repos/coleifer/peewee/issues/2091/events | https://github.com/coleifer/peewee/issues/2091 | 552,812,014 | MDU6SXNzdWU1NTI4MTIwMTQ= | 2,091 | prefetch causes fields to be added in dirty_fields | {
"login": "navolotsky",
"id": 43314216,
"node_id": "MDQ6VXNlcjQzMzE0MjE2",
"avatar_url": "https://avatars.githubusercontent.com/u/43314216?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/navolotsky",
"html_url": "https://github.com/navolotsky",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"@coleifer Please check it. I got this behavior again on Peewee 3.13.3, Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32.",
"The regression test is passing fine for me. If you add a failing test, I will look into this again.",
"```python\r\nfrom peewee import CharFi... | 2020-01-21T11:17:10 | 2020-05-19T14:33:08 | 2020-05-19T14:33:08 | NONE | null | `prefetch` causes fields related to prefetched models to be added in `dirty_fields`.
Could you say why this is so? Is it not possible to make another implementation?
Thanks so much for the answer and excellent ORM. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2091/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/2091/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2090 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2090/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2090/comments | https://api.github.com/repos/coleifer/peewee/issues/2090/events | https://github.com/coleifer/peewee/issues/2090 | 552,407,775 | MDU6SXNzdWU1NTI0MDc3NzU= | 2,090 | AttributeError: 'str' object has no attribute 'unwrap' | {
"login": "Rizhiy",
"id": 5617397,
"node_id": "MDQ6VXNlcjU2MTczOTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/5617397?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rizhiy",
"html_url": "https://github.com/Rizhiy",
"followers_url": "https://api.github.com/users/Rizhiy/foll... | [] | closed | false | null | [] | null | [
"Paste the full traceback.",
"Oh, I see - you're using `Decimal` instead of `DecimalField`. That's likely the issue.",
"That's mistake in the code here. In my file it is correct.",
"Then paste the full traceback??",
"```\r\nTraceback (most recent call last):\r\n File \"tmp.py\", line 22, in <module>\r\n ... | 2020-01-20T16:41:28 | 2020-01-20T17:06:04 | 2020-01-20T16:50:45 | NONE | null | I'm trying to retrieve rows from the database and get this error.
My table looks as follows:
```python
class Post(Model):
date = DateField()
user = ForeignKeyField(User, backref='numbers')
number1 = DecimalField(6,2)
number2 = DecimalField(6,2)
class Meta:
database = SqliteDatabase('data.d... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2090/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/2090/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2089 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2089/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2089/comments | https://api.github.com/repos/coleifer/peewee/issues/2089/events | https://github.com/coleifer/peewee/issues/2089 | 552,356,262 | MDU6SXNzdWU1NTIzNTYyNjI= | 2,089 | Add backref after foreign key declaration | {
"login": "Rizhiy",
"id": 5617397,
"node_id": "MDQ6VXNlcjU2MTczOTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/5617397?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Rizhiy",
"html_url": "https://github.com/Rizhiy",
"followers_url": "https://api.github.com/users/Rizhiy/foll... | [] | closed | false | null | [] | null | [
"You're going to have a really bad time inheriting foreign-keys. It just doesn't work well.\r\n\r\nFurthermore, composite primary-keys are not well-supported, e.g. Peewee doesn't support foreign-keys to models with composite PKs.\r\n\r\nAlso, having different tables for various \"post\" types is almost guaranteed t... | 2020-01-20T15:06:49 | 2020-01-20T16:44:38 | 2020-01-20T16:44:38 | NONE | null | Is it possible to add `backref` after foreign key is declared?
I'm trying to do something like:
```python
class User(Model):
username = CharField(unique=True)
class BasePost(Model):
date = DateField()
user = ForeignKeyField(User)
class Meta:
primary_key = CompositeKey('date', 'ticker')
clas... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2089/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/2089/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2088 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2088/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2088/comments | https://api.github.com/repos/coleifer/peewee/issues/2088/events | https://github.com/coleifer/peewee/issues/2088 | 551,905,400 | MDU6SXNzdWU1NTE5MDU0MDA= | 2,088 | Changing single column primary key to a composite primary key | {
"login": "neenuj",
"id": 39304368,
"node_id": "MDQ6VXNlcjM5MzA0MzY4",
"avatar_url": "https://avatars.githubusercontent.com/u/39304368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/neenuj",
"html_url": "https://github.com/neenuj",
"followers_url": "https://api.github.com/users/neenuj/fo... | [] | closed | false | null | [] | null | [
"I would strongly advise against trying to use a composite primary-key for this, as Peewee provides much better support for scalar primary-keys (integers, uuids, etc). Many things will be harder for you if you switch to a composite primary-key - specifically creating foreign-keys to your \"Person\" table. Peewee **... | 2020-01-19T11:00:52 | 2020-01-19T15:18:19 | 2020-01-19T15:18:18 | NONE | null | I have a 'person' table with auto generated 'id' as the primary key. I want to change this primary key to a composite primary key with first_name and last_name as the columns, using schema migrator. Is it possible to achieve this? Or is executing a SQL my only alternative? I am using PostgreSQL.
def perform_sch... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2088/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/2088/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2087 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2087/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2087/comments | https://api.github.com/repos/coleifer/peewee/issues/2087/events | https://github.com/coleifer/peewee/issues/2087 | 551,823,017 | MDU6SXNzdWU1NTE4MjMwMTc= | 2,087 | [Question] Searching through binary data in Postgres | {
"login": "its-a-feature",
"id": 5313261,
"node_id": "MDQ6VXNlcjUzMTMyNjE=",
"avatar_url": "https://avatars.githubusercontent.com/u/5313261?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/its-a-feature",
"html_url": "https://github.com/its-a-feature",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"Got it working with the `fn` hook into the underlying functions."
] | 2020-01-18T20:53:37 | 2020-01-18T22:43:59 | 2020-01-18T22:43:59 | NONE | null | I'm storing user output into a BlobField within my database (instead of a TextField) in case the user's output includes null characters. However, I still want to do regex searching across this data.
From the postgresql command line, I can do a command like:
`select encode(Response.response, 'escape') LIKE 'test%' ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2087/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/2087/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2086 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2086/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2086/comments | https://api.github.com/repos/coleifer/peewee/issues/2086/events | https://github.com/coleifer/peewee/issues/2086 | 550,451,753 | MDU6SXNzdWU1NTA0NTE3NTM= | 2,086 | how write one code in peewee for mysql, sqlite | {
"login": "TechComet",
"id": 5288136,
"node_id": "MDQ6VXNlcjUyODgxMzY=",
"avatar_url": "https://avatars.githubusercontent.com/u/5288136?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/TechComet",
"html_url": "https://github.com/TechComet",
"followers_url": "https://api.github.com/users/Te... | [] | closed | false | null | [] | null | [
"You can specify a custom field type, e.g.\r\n\r\n```python\r\nclass MediumTextField(TextField):\r\n field_type = 'MEDIUMTEXT'\r\n```\r\n\r\nAnd just use that if the db is mysql.\r\n\r\nAlternatively, you can configure MySQL to treat all textfields as MEDIUMTEXT if you wish:\r\n\r\n```python\r\nMySQLDatabase.fie... | 2020-01-15T21:55:45 | 2020-01-23T14:01:02 | 2020-01-15T22:27:30 | NONE | null | Hi,
how write one code in peewee for mysql, sqlite
I use peewee and sqlite on local server but on server use mysql need write one code to use mysql and sqlite
Like
```
database_type = 'mysql'
if database_type == 'mysql':
db = peewee.mysql_connect('localhost', 'root', 'password', 'test1234.db')
else:... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2086/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/2086/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2085 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2085/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2085/comments | https://api.github.com/repos/coleifer/peewee/issues/2085/events | https://github.com/coleifer/peewee/issues/2085 | 549,109,233 | MDU6SXNzdWU1NDkxMDkyMzM= | 2,085 | Support indexing into array using expression w/postgres | {
"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 | [
"Fixed."
] | 2020-01-13T18:35:47 | 2020-01-13T18:51:44 | 2020-01-13T18:51:39 | OWNER | null | Question on SO: https://stackoverflow.com/questions/59708993/how-do-i-access-the-last-index-of-an-arrayfield-in-a-peewee-query-with-postgres
Example:
```python
from peewee import *
from playhouse.postgres_ext import *
db = PostgresqlExtDatabase('peewee_test')
class Test(Model):
value = ArrayField(I... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2085/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/2085/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2084 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2084/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2084/comments | https://api.github.com/repos/coleifer/peewee/issues/2084/events | https://github.com/coleifer/peewee/issues/2084 | 547,903,492 | MDU6SXNzdWU1NDc5MDM0OTI= | 2,084 | mysql query limit 0 | {
"login": "hereisok",
"id": 16496811,
"node_id": "MDQ6VXNlcjE2NDk2ODEx",
"avatar_url": "https://avatars.githubusercontent.com/u/16496811?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hereisok",
"html_url": "https://github.com/hereisok",
"followers_url": "https://api.github.com/users/her... | [] | closed | false | null | [] | null | [] | 2020-01-10T07:05:56 | 2020-01-10T12:15:43 | 2020-01-10T12:15:43 | NONE | null | "limit 0" is a legal operation in [MySQL](https://dev.mysql.com/doc/refman/8.0/en/limit-optimization.html)
> LIMIT 0 quickly returns an empty set. This can be useful for checking the validity of a query. It can also be employed to obtain the types of the result columns within applications that use a MySQL API that m... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2084/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/2084/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2083 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2083/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2083/comments | https://api.github.com/repos/coleifer/peewee/issues/2083/events | https://github.com/coleifer/peewee/issues/2083 | 545,671,916 | MDU6SXNzdWU1NDU2NzE5MTY= | 2,083 | What is wrong about join method? | {
"login": "AntmanTmp",
"id": 45066722,
"node_id": "MDQ6VXNlcjQ1MDY2NzIy",
"avatar_url": "https://avatars.githubusercontent.com/u/45066722?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/AntmanTmp",
"html_url": "https://github.com/AntmanTmp",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Don't alias the good or supplier name in query2. The aliases are confusing you. Query2 returns rows but the repr is empty (none) because of the way you aliases the good name.",
"I strongly suggest you check out the docs on relationships and joins:\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/relationships.... | 2020-01-06T11:09:10 | 2020-01-07T02:28:36 | 2020-01-06T12:26:59 | NONE | null | I have two model and random insert some rows
```
class BaseModel(Model):
created_time = DateTimeField(default=datetime.now)
class Meta:
database = db
class Supplier(BaseModel):
name = CharField(max_length=100, index=True)
address = CharField(max_length=100)
phone = CharField(max_l... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2083/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/2083/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2082 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2082/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2082/comments | https://api.github.com/repos/coleifer/peewee/issues/2082/events | https://github.com/coleifer/peewee/issues/2082 | 542,485,906 | MDU6SXNzdWU1NDI0ODU5MDY= | 2,082 | ambiguous column error on update query | {
"login": "ydelibasi",
"id": 10705144,
"node_id": "MDQ6VXNlcjEwNzA1MTQ0",
"avatar_url": "https://avatars.githubusercontent.com/u/10705144?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ydelibasi",
"html_url": "https://github.com/ydelibasi",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Can you share the generated SQL for your query? I tried to replicate a minimal example and the generated SQL contains qualified names that would seem to resolve any ambiguity.\r\n\r\nAlso, what version of Peewee are you using?",
"generated SQL:\r\n`\r\n('UPDATE \"user_data\".\"user_file_rows\" SET \"location_ids... | 2019-12-26T08:49:34 | 2019-12-26T15:09:49 | 2019-12-26T14:52:22 | NONE | null | I have two geometry columns with same name. I would like execute update query but I get "peewee.ProgrammingError: column reference "geom" is ambiguous" error.
How to use alias for this columns ?
```
UserFileRows.update(
location_ids=Location.parent_ids
)
.from_(Location)
.where((fn.st_intersects(UserFil... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2082/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/2082/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2081 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2081/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2081/comments | https://api.github.com/repos/coleifer/peewee/issues/2081/events | https://github.com/coleifer/peewee/issues/2081 | 542,453,955 | MDU6SXNzdWU1NDI0NTM5NTU= | 2,081 | on_conflict update is not evaluating the WHERE clause correctly | {
"login": "neenuj",
"id": 39304368,
"node_id": "MDQ6VXNlcjM5MzA0MzY4",
"avatar_url": "https://avatars.githubusercontent.com/u/39304368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/neenuj",
"html_url": "https://github.com/neenuj",
"followers_url": "https://api.github.com/users/neenuj/fo... | [] | closed | false | null | [] | null | [
"The docs are very clear, you cannot use python \"or\", \"and\" or \"not\" to combine expressions.\r\n\r\nRewrite\r\n\r\n```python\r\nPerson.fname != EXCLUDED.fname or Person.lname != EXCLUDED.lname\r\n```\r\n\r\nAs\r\n\r\n```python\r\n(Person.fname != EXCLUDED.fname) | (Person.lname != EXCLUDED.lname)\r\n```",
"... | 2019-12-26T06:46:05 | 2022-12-03T14:39:16 | 2019-12-26T13:48:58 | NONE | null | Thank you for creating Peewee and for being active on addressing issues and on answering questions.
I encountered issues while upserting data using on_conflict() method. So i faked a scenario to identify the root cause and here is what i could find.
I created a Person model using Peewee inserted a record using t... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2081/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/2081/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2080 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2080/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2080/comments | https://api.github.com/repos/coleifer/peewee/issues/2080/events | https://github.com/coleifer/peewee/issues/2080 | 541,352,797 | MDU6SXNzdWU1NDEzNTI3OTc= | 2,080 | something is wrong with proxy | {
"login": "viponedream",
"id": 16624529,
"node_id": "MDQ6VXNlcjE2NjI0NTI5",
"avatar_url": "https://avatars.githubusercontent.com/u/16624529?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/viponedream",
"html_url": "https://github.com/viponedream",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"Please edit your issue to format your code and I will reopen."
] | 2019-12-21T17:51:31 | 2019-12-21T22:34:41 | 2019-12-21T22:34:40 | NONE | null | in one app, i want to use two database, but it only save to the last database.
1, define model
database_proxy = Proxy()
class Item_DB(Model):
user = CharField(null=True, unique=False)
class Meta:
database = database_proxy # Use proxy for our DB.
2, define my own class the use peewee.
cla... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2080/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/2080/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2079 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2079/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2079/comments | https://api.github.com/repos/coleifer/peewee/issues/2079/events | https://github.com/coleifer/peewee/issues/2079 | 541,161,215 | MDU6SXNzdWU1NDExNjEyMTU= | 2,079 | create_tables with safe=True doesn't work for indexes | {
"login": "miguelglopes",
"id": 23117662,
"node_id": "MDQ6VXNlcjIzMTE3NjYy",
"avatar_url": "https://avatars.githubusercontent.com/u/23117662?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/miguelglopes",
"html_url": "https://github.com/miguelglopes",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"MySQL does not support \"IF NOT EXISTS\" for indexes for some reason.\r\n\r\nSo what peewee does when you're using MySQL is to first check if the table exists -- and if it does -- then it's a no-op. So I think something weird may be going on in your setup.",
"Ok, I think I found the problem.\r\n\r\nI capitalized... | 2019-12-20T19:30:37 | 2019-12-21T01:14:08 | 2019-12-20T20:37:12 | NONE | null | When running the following code:
```
import peewee
db = peewee.MySQLDatabase(
config["database"]["db"],
user=config["database"]["user"],
password=config["database"]["pwd"],
host=config["database"]["host"],
port=config["database"]["port"],
)
db.connect()
class Show(peewee.Model):
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2079/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/2079/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2078 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2078/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2078/comments | https://api.github.com/repos/coleifer/peewee/issues/2078/events | https://github.com/coleifer/peewee/issues/2078 | 539,442,526 | MDU6SXNzdWU1Mzk0NDI1MjY= | 2,078 | Get the SQL output of count? | {
"login": "ztj1993",
"id": 13493380,
"node_id": "MDQ6VXNlcjEzNDkzMzgw",
"avatar_url": "https://avatars.githubusercontent.com/u/13493380?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ztj1993",
"html_url": "https://github.com/ztj1993",
"followers_url": "https://api.github.com/users/ztj199... | [] | closed | false | null | [] | null | [
">I want to get SQL output\r\n\r\nI don't know what this means? The above function will query the database and return the count of rows in the select query.",
"You can use `.scalar()` to obtain the result of a scalar aggregate query.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/querying.html#retrieving-scal... | 2019-12-18T04:21:21 | 2019-12-18T14:24:40 | 2019-12-18T14:23:56 | NONE | null | Suppose I have a query
```
OrderModel.select().count()
```
I want to get SQL output, Because I only use the model, not the database.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2078/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/2078/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2077 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2077/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2077/comments | https://api.github.com/repos/coleifer/peewee/issues/2077/events | https://github.com/coleifer/peewee/issues/2077 | 539,054,275 | MDU6SXNzdWU1MzkwNTQyNzU= | 2,077 | Suggestions for moving from SQLIte to PostgreSQL ? | {
"login": "nhi-vanye",
"id": 17260552,
"node_id": "MDQ6VXNlcjE3MjYwNTUy",
"avatar_url": "https://avatars.githubusercontent.com/u/17260552?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nhi-vanye",
"html_url": "https://github.com/nhi-vanye",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"This is more appropriate for stack-overflow, as the issue tracker is used for tracking issues with the library."
] | 2019-12-17T13:05:56 | 2019-12-18T14:19:02 | 2019-12-18T14:19:02 | NONE | null |
I'm currently using SQLite as the backend for a simulation program and am interested in supporting the use of PostgreSQL to allow for multiple independent simulations to be run in parallel.
The blocker is a user-defined function.
SQLite has no SQL functions so I wrote it in python
PostgreSQL might be able to... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2077/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/2077/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2076 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2076/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2076/comments | https://api.github.com/repos/coleifer/peewee/issues/2076/events | https://github.com/coleifer/peewee/issues/2076 | 538,994,670 | MDU6SXNzdWU1Mzg5OTQ2NzA= | 2,076 | [Question] Query database output | {
"login": "zaee-k",
"id": 51817794,
"node_id": "MDQ6VXNlcjUxODE3Nzk0",
"avatar_url": "https://avatars.githubusercontent.com/u/51817794?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zaee-k",
"html_url": "https://github.com/zaee-k",
"followers_url": "https://api.github.com/users/zaee-k/fo... | [] | closed | false | null | [] | null | [
">What I get now:\r\n\r\nThat is *not* returned by executing a `select()` query. That is metadata on the model instance. By default, issuing a `select()` will return a cursor that yields model instances for each row of the result set.\r\n\r\nMy guess is that you want something like `.dicts()`, which should give you... | 2019-12-17T11:03:34 | 2019-12-19T14:18:19 | 2019-12-18T14:22:02 | NONE | null | Hey there!
First of all a big big thank you for creating peewee, it's a nice module to work with PostgreSQL and SQLite!
I have one silly question in regard of querying database. Currently I'm playing with peewee and FastAPI. One thing I've noticed is upon executing select(), data is of course queried and returned BUT... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2076/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/2076/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2075 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2075/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2075/comments | https://api.github.com/repos/coleifer/peewee/issues/2075/events | https://github.com/coleifer/peewee/issues/2075 | 538,174,286 | MDU6SXNzdWU1MzgxNzQyODY= | 2,075 | pwiz incorrectly generates a composite unique index | {
"login": "navolotsky",
"id": 43314216,
"node_id": "MDQ6VXNlcjQzMzE0MjE2",
"avatar_url": "https://avatars.githubusercontent.com/u/43314216?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/navolotsky",
"html_url": "https://github.com/navolotsky",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"Yes, `pwiz` is intended to provide a reasonable best-effort at converting the schema into the db into models, but it is not 100% perfect. As the docs say, it's purpose is to produce some basic skeleton code that should handle correct column types and foreign-keys. Things like constraints across columns with arbitr... | 2019-12-16T04:12:05 | 2019-12-18T14:49:51 | 2019-12-18T14:49:50 | NONE | null | ### Issue
There is the problem with pwiz: if there is a unique index across two fields, one of which is `text` or `varchar` and a value of the `lower()` function from a value of such field is taken into the unique index, then a composite unique index is not generated. Instead, the non-text field is assigned unique.
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2075/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/2075/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2074 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2074/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2074/comments | https://api.github.com/repos/coleifer/peewee/issues/2074/events | https://github.com/coleifer/peewee/issues/2074 | 538,032,222 | MDU6SXNzdWU1MzgwMzIyMjI= | 2,074 | Update from values | {
"login": "eternalflow",
"id": 9920174,
"node_id": "MDQ6VXNlcjk5MjAxNzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/9920174?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eternalflow",
"html_url": "https://github.com/eternalflow",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Yes:\r\n\r\n```python\r\n# let's say we want to update two rows.\r\nvl = ValuesList([\r\n (1, 'huey-x'),\r\n (2, 'zaizee-x')], columns=['id', 'username'], alias='vl')\r\nquery = (User\r\n .update({'username': vl.c.username})\r\n .from_(vl)\r\n .where(User.id == vl.c.id))\r\n```",
"A... | 2019-12-15T10:37:24 | 2019-12-16T12:47:31 | 2019-12-16T12:46:49 | NONE | null | Is there a way to create following query for batch updating rows from given values?
```sql
UPDATE mytable m
SET
field1 = v.field1,
field2 = v.field2
FROM (SELECT * FROM (VALUES %s) as t (id, field1, field2)) v
WHERE m.id = v.id
``` | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2074/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/2074/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2073 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2073/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2073/comments | https://api.github.com/repos/coleifer/peewee/issues/2073/events | https://github.com/coleifer/peewee/issues/2073 | 534,737,220 | MDU6SXNzdWU1MzQ3MzcyMjA= | 2,073 | Should there be an All expression? | {
"login": "toppk",
"id": 6306634,
"node_id": "MDQ6VXNlcjYzMDY2MzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/6306634?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/toppk",
"html_url": "https://github.com/toppk",
"followers_url": "https://api.github.com/users/toppk/follower... | [] | closed | false | null | [] | null | [
"Just append to a list and use `reduce` to combine the list elements (expressions).",
"https://stackoverflow.com/questions/22238194/python-peewee-dynamically-or-clauses?r=SearchResults",
"That still has the same issue with an empty clauses array. you need to have one element for this to work.",
"```python\r\... | 2019-12-09T07:17:03 | 2019-12-09T15:42:42 | 2019-12-09T12:13:35 | NONE | null | Just getting started with peewee, and I was looking at this pattern , to dynamically control the "where " clause.
```
where = Expression(1,"=",1) # All
if some_condition1():
where &= (Users.group_id != 1)
if some_condition2():
where &= (Users.name % "%en%")
query = Users.select().where(where)
```
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2073/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/2073/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2072 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2072/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2072/comments | https://api.github.com/repos/coleifer/peewee/issues/2072/events | https://github.com/coleifer/peewee/pull/2072 | 534,182,902 | MDExOlB1bGxSZXF1ZXN0MzUwMTM3Nzcx | 2,072 | Use contextvars when available, to support async frameworks | {
"login": "tiangolo",
"id": 1326112,
"node_id": "MDQ6VXNlcjEzMjYxMTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1326112?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tiangolo",
"html_url": "https://github.com/tiangolo",
"followers_url": "https://api.github.com/users/tiang... | [] | closed | false | null | [] | null | [
"I'm going to pass on this implementation. I think a more correct approach would be to create a standalone connection-state manager for asyncio usage. This could be provided by a mixin that overrides the `Database.__init__()` method and assigns compatible values to `_state` and `_lock` (also note that this patch do... | 2019-12-06T18:02:16 | 2020-04-10T10:58:04 | 2019-12-08T13:29:53 | NONE | null | ## Summary
This is a backwards-compatible change to use [`contextvars`](https://docs.python.org/3/library/contextvars.html) instead of [`threading.local`](https://docs.python.org/3/library/threading.html#thread-local-data) when available.
`contextvars` is only available in Python 3.7 and above, so the implementat... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2072/reactions",
"total_count": 6,
"+1": 6,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/2072/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2072",
"html_url": "https://github.com/coleifer/peewee/pull/2072",
"diff_url": "https://github.com/coleifer/peewee/pull/2072.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2072.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/2071 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2071/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2071/comments | https://api.github.com/repos/coleifer/peewee/issues/2071/events | https://github.com/coleifer/peewee/issues/2071 | 533,907,588 | MDU6SXNzdWU1MzM5MDc1ODg= | 2,071 | atomic() does not seem to have lock_type argument on 3.13.0 | {
"login": "JeanBarriere",
"id": 11390722,
"node_id": "MDQ6VXNlcjExMzkwNzIy",
"avatar_url": "https://avatars.githubusercontent.com/u/11390722?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JeanBarriere",
"html_url": "https://github.com/JeanBarriere",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"Looks like a breaking change made here: https://github.com/coleifer/peewee/commit/36f5b4a0fef0bd236f25bf99f92f74852f219103",
"For now try removing the keyword (lock_type) and just pass the string 'immediate'. I will put together a fix, in any case.",
"I'm tagging a new release once the build passes. Thanks for... | 2019-12-06T11:27:42 | 2019-12-06T15:49:38 | 2019-12-06T15:28:58 | NONE | null | Hi !
We're using peewee on our project and we are using it with an IMMEDIATE lock type, as:
`db.atomic(lock_type="IMMEDIATE")`
Everything was working fine on the 3.12.0, but now we have this error:
`TypeError: atomic() got an unexpected keyword argument 'lock_type'`
Any idea why ? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2071/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/2071/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2070 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2070/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2070/comments | https://api.github.com/repos/coleifer/peewee/issues/2070/events | https://github.com/coleifer/peewee/issues/2070 | 532,480,049 | MDU6SXNzdWU1MzI0ODAwNDk= | 2,070 | Regression in 3.12.0 with regard to saving model with JSONField | {
"login": "arel",
"id": 153497,
"node_id": "MDQ6VXNlcjE1MzQ5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/153497?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arel",
"html_url": "https://github.com/arel",
"followers_url": "https://api.github.com/users/arel/followers",
... | [] | closed | false | null | [] | null | [
"Thanks for reporting, this is now fixed in master."
] | 2019-12-04T06:34:28 | 2019-12-04T14:10:48 | 2019-12-04T14:10:41 | NONE | null | A change between 3.11.2 and 3.12.0 broke support for JSONFields. This seems related to #2034, but I don't think this is a duplicate.
I'm using mysql as the database.
To reproduce:
```python
import os
import json
from peewee import Model, TextField
from playhouse.db_url import connect
uri = os.environ.ge... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2070/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/2070/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2069 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2069/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2069/comments | https://api.github.com/repos/coleifer/peewee/issues/2069/events | https://github.com/coleifer/peewee/issues/2069 | 532,019,357 | MDU6SXNzdWU1MzIwMTkzNTc= | 2,069 | Mixing hybrid properties with relationships | {
"login": "LVerneyPEReN",
"id": 58298410,
"node_id": "MDQ6VXNlcjU4Mjk4NDEw",
"avatar_url": "https://avatars.githubusercontent.com/u/58298410?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LVerneyPEReN",
"html_url": "https://github.com/LVerneyPEReN",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"It's pretty simple, I added a test-case showing how to do it:\r\n\r\n```python\r\nclass Order(TestModel):\r\n name = TextField()\r\n\r\n @hybrid_property\r\n def quantity(self):\r\n return sum([item.qt for item in self.items])\r\n\r\n @quantity.expression\r\n def quantity(cls):\r\n ret... | 2019-12-03T14:20:43 | 2019-12-04T14:12:36 | 2019-12-03T17:09:42 | NONE | null | Hi,
I'd like to have something similar to SQLAlchemy's hybrid with relationships example in Peewee. Typically, given the following simple models,
```
class Housing(BaseModel):
id = peewee.AutoField()
@hybrid_property
def nb_nights(self):
return sum(x.nb_nuitees for x in self.nuitees)
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2069/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/2069/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2068 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2068/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2068/comments | https://api.github.com/repos/coleifer/peewee/issues/2068/events | https://github.com/coleifer/peewee/pull/2068 | 532,008,525 | MDExOlB1bGxSZXF1ZXN0MzQ4MzQ4MjAy | 2,068 | BL-536 | {
"login": "rafae1",
"id": 31249932,
"node_id": "MDQ6VXNlcjMxMjQ5OTMy",
"avatar_url": "https://avatars.githubusercontent.com/u/31249932?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rafae1",
"html_url": "https://github.com/rafae1",
"followers_url": "https://api.github.com/users/rafae1/fo... | [] | closed | false | null | [] | null | [
"Hey, there's some cool stuff in here. I'll look to maybe integrate some of this. Can you tell me more about some of the changes I'm looking at? I understand the reasoning for certain of them, but others aren't clear exactly what the intent is.",
"* e5ad248db24210e62a2a3829ea78627202aa0d3d\r\n* 99921b9b3d8444eec1... | 2019-12-03T14:04:41 | 2019-12-03T16:58:06 | 2019-12-03T14:05:19 | NONE | null | imporve JSONLookUp contains method | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2068/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/2068/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2068",
"html_url": "https://github.com/coleifer/peewee/pull/2068",
"diff_url": "https://github.com/coleifer/peewee/pull/2068.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2068.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/2067 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2067/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2067/comments | https://api.github.com/repos/coleifer/peewee/issues/2067/events | https://github.com/coleifer/peewee/issues/2067 | 531,994,408 | MDU6SXNzdWU1MzE5OTQ0MDg= | 2,067 | Support for SuperSQLite | {
"login": "lllama",
"id": 598411,
"node_id": "MDQ6VXNlcjU5ODQxMQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/598411?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lllama",
"html_url": "https://github.com/lllama",
"followers_url": "https://api.github.com/users/lllama/follow... | [] | closed | false | null | [] | null | [
"You have *got* to be kidding me, this is absolute garbage. It is incredibly easy to build your own SQLite, which the default Python driver should pick up.\r\n\r\nThis should contain all the information you might need:\r\n\r\nhttp://charlesleifer.com/blog/compiling-sqlite-for-use-with-python-applications/",
"Not ... | 2019-12-03T13:43:25 | 2019-12-03T14:40:04 | 2019-12-03T14:11:25 | NONE | null | Is it possible to swap out the default sqlite driver with SuperSQLite? (https://github.com/plasticityai/supersqlite). The library provides an up to date version of sqlite and adds a number of extensions which would be useful for my app.
Can I swap the underlying lib, or would it require its own backend? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2067/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/2067/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2066 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2066/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2066/comments | https://api.github.com/repos/coleifer/peewee/issues/2066/events | https://github.com/coleifer/peewee/issues/2066 | 531,948,641 | MDU6SXNzdWU1MzE5NDg2NDE= | 2,066 | delete_instance causes error if tables are not created | {
"login": "JuleBert",
"id": 26938997,
"node_id": "MDQ6VXNlcjI2OTM4OTk3",
"avatar_url": "https://avatars.githubusercontent.com/u/26938997?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JuleBert",
"html_url": "https://github.com/JuleBert",
"followers_url": "https://api.github.com/users/Jul... | [] | closed | false | null | [] | null | [
"Peewee should only be traversing the graph of tables related by foreign-key, so my guess is that you have some weird stuff going on in your foreign-key inheritance because Peewee will not traverse subclasses blindly. If you can provide a minimal example showing a bug I will reopen.",
"A minimal example is no pro... | 2019-12-03T12:25:47 | 2019-12-04T15:27:36 | 2019-12-03T14:06:08 | NONE | null | Hi there,
we are using peewee to create a medium complex data structur. We are using inheritance since a lot of table are similar to each other. We do this by creating template classes which are not created as tables later on. These classes are picked up by delete_instance although they are created as tables. Which ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2066/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/2066/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2065 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2065/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2065/comments | https://api.github.com/repos/coleifer/peewee/issues/2065/events | https://github.com/coleifer/peewee/issues/2065 | 531,530,509 | MDU6SXNzdWU1MzE1MzA1MDk= | 2,065 | fn.IF returning True instead of values | {
"login": "mikemill",
"id": 1652125,
"node_id": "MDQ6VXNlcjE2NTIxMjU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1652125?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mikemill",
"html_url": "https://github.com/mikemill",
"followers_url": "https://api.github.com/users/mikem... | [] | closed | false | null | [] | null | [
"Peewee uses a heuristic for function calls when the first argument is a field, where peewee applies that field's conversion method to the value returned by the database. This usually works, but you've found a case where it is problematic. To avoid coercing the function output, specify `coerce=False`:\r\n\r\n```pyt... | 2019-12-02T20:49:49 | 2019-12-02T21:35:46 | 2019-12-02T21:09:32 | NONE | null | I'm trying to use `fn.IF` to pick a value to use. However, if using a model property it is returning `True` as the value instead of the proper value and this is happening even if that property is `False`.
Example script (note: this is a greatly simplified version of what I'm actually trying to do):
```python
fr... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2065/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/2065/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2064 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2064/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2064/comments | https://api.github.com/repos/coleifer/peewee/issues/2064/events | https://github.com/coleifer/peewee/issues/2064 | 530,233,802 | MDU6SXNzdWU1MzAyMzM4MDI= | 2,064 | How to print raw sql for Blog.select().where(Blog.id == 1) | {
"login": "jet10000",
"id": 2258120,
"node_id": "MDQ6VXNlcjIyNTgxMjA=",
"avatar_url": "https://avatars.githubusercontent.com/u/2258120?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jet10000",
"html_url": "https://github.com/jet10000",
"followers_url": "https://api.github.com/users/jet10... | [] | closed | false | null | [] | null | [
"Peewee returns a parameterized query, a 2-tuple of SQL string and parameters. This is to save people doing crazy stuff and getting SQL injection vulnerabilities. The driver accepts this 2-tuple and does the right thing.",
"What about for DB API (PEP-249) v2.0 drivers? How can I tell peewee to not add double quo... | 2019-11-29T09:11:10 | 2020-07-06T19:33:37 | 2019-11-29T17:43:18 | NONE | null | ```
q = Blog.select().where(Blog.id == 1)
print(q.sql())
```
I want to compile to raw sql .
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2064/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/2064/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2063 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2063/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2063/comments | https://api.github.com/repos/coleifer/peewee/issues/2063/events | https://github.com/coleifer/peewee/issues/2063 | 529,769,075 | MDU6SXNzdWU1Mjk3NjkwNzU= | 2,063 | Model.filter not generating correct SQL for join clause | {
"login": "yifeikong",
"id": 1035487,
"node_id": "MDQ6VXNlcjEwMzU0ODc=",
"avatar_url": "https://avatars.githubusercontent.com/u/1035487?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yifeikong",
"html_url": "https://github.com/yifeikong",
"followers_url": "https://api.github.com/users/yi... | [] | closed | false | null | [] | null | [
"Sorry, 3.12.0 seems to work, closing. I was using 3.10",
"OK, It's not fixed. Actually it randomly happens each time you restart the flask server.",
"I think the reason is in function of peewee.ModelSelect.filter().\r\ntarget code is:\r\n```python\r\n dq_joins = set()\r\n while q:\r\n ... | 2019-11-28T08:43:23 | 2019-11-29T02:26:20 | 2019-11-28T15:01:03 | NONE | null | I have three models in a heritical order:
```python
class CrawlProject(Model):
name = CharField()
class CrawlGroup(Model):
name = CharField()
project = ForeignKeyField(CrawlProject)
class CrawlRule(Model):
name = CharField()
group = ForeignKeyField(CrawlGroup)
```
Given the fo... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2063/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/2063/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2062 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2062/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2062/comments | https://api.github.com/repos/coleifer/peewee/issues/2062/events | https://github.com/coleifer/peewee/issues/2062 | 529,756,395 | MDU6SXNzdWU1Mjk3NTYzOTU= | 2,062 | Dealys with multiprocessing | {
"login": "codez266",
"id": 7484906,
"node_id": "MDQ6VXNlcjc0ODQ5MDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/7484906?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/codez266",
"html_url": "https://github.com/codez266",
"followers_url": "https://api.github.com/users/codez... | [] | closed | false | null | [] | null | [
"I'm sorry, this is not something I can help with. No code, extremely vague description, no information about where things are stuck.\r\n\r\nYou might just make sure that before you fork new processes you are creating a new database connection, as an open connection in the parent-process might get inherited by the ... | 2019-11-28T08:13:41 | 2019-11-30T05:02:37 | 2019-11-28T15:04:39 | NONE | null | Hi, I have a code that uses peewee to access a MySQL backend. The code needs to look for the data related to a bunch of wikipedia pages first in the MySQL table, and if not present fetch it from the internet using an API. I'm multiprocessing to fetch data for multiple pages simultaneously. Each process handles one page... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2062/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/2062/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2061 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2061/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2061/comments | https://api.github.com/repos/coleifer/peewee/issues/2061/events | https://github.com/coleifer/peewee/issues/2061 | 528,416,379 | MDU6SXNzdWU1Mjg0MTYzNzk= | 2,061 | Join attr does get added with left outer join (3.11 ... 3.12) | {
"login": "nad2000",
"id": 177266,
"node_id": "MDQ6VXNlcjE3NzI2Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/177266?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nad2000",
"html_url": "https://github.com/nad2000",
"followers_url": "https://api.github.com/users/nad2000/fo... | [] | closed | false | null | [] | null | [
"It seems you included two versions in the issue title -- are you indicating this is a regression?",
"At any rate -- when you are using a left outer join, all rows from the left-hand table (Tweet) are included, along with any matching from the right-hand (User). This means you can have Tweet without a User.\r\n\r... | 2019-11-26T00:33:15 | 2020-11-23T05:21:15 | 2019-11-26T02:47:52 | NONE | null | http://docs.peewee-orm.com/en/latest/peewee/relationships.html#selecting-from-multiple-sources shows how to user **attr** with joins. It works with inner join fine. The query fails with the outer join.
```python
>>> class User(Model):
... name = CharField()
... class Meta:
... database = db
>... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2061/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/2061/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2060 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2060/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2060/comments | https://api.github.com/repos/coleifer/peewee/issues/2060/events | https://github.com/coleifer/peewee/issues/2060 | 528,070,489 | MDU6SXNzdWU1MjgwNzA0ODk= | 2,060 | dynamic table name support | {
"login": "TaylorChen",
"id": 2860840,
"node_id": "MDQ6VXNlcjI4NjA4NDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/2860840?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/TaylorChen",
"html_url": "https://github.com/TaylorChen",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"It's right there in the docs.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html#table-names\r\n\r\n> If you wish to implement your own naming convention\r\n\r\nIt has example code."
] | 2019-11-25T12:59:14 | 2019-11-25T17:04:57 | 2019-11-25T17:04:57 | NONE | null | In my business, some tables are divided according to time, such as table table_20191214, table_20191215, how can I do it in the current orm framework? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2060/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/2060/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2059 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2059/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2059/comments | https://api.github.com/repos/coleifer/peewee/issues/2059/events | https://github.com/coleifer/peewee/pull/2059 | 527,726,849 | MDExOlB1bGxSZXF1ZXN0MzQ0OTI3NDA3 | 2,059 | Typo in example.rst doc | {
"login": "maghniem",
"id": 16522435,
"node_id": "MDQ6VXNlcjE2NTIyNDM1",
"avatar_url": "https://avatars.githubusercontent.com/u/16522435?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/maghniem",
"html_url": "https://github.com/maghniem",
"followers_url": "https://api.github.com/users/mag... | [] | closed | false | null | [] | null | [] | 2019-11-24T17:04:48 | 2019-11-24T23:18:20 | 2019-11-24T23:18:20 | CONTRIBUTOR | null | Adding fields after the table has been created will required you to
either drop the table and re-create it or manually add the columns
using an *ALTER TABLE* query.
To
Adding fields after the table has been created will require you to
either drop the table and re-create it or manually add the colum... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2059/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/2059/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2059",
"html_url": "https://github.com/coleifer/peewee/pull/2059",
"diff_url": "https://github.com/coleifer/peewee/pull/2059.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2059.patch",
"merged_at": "2019-11-24T23:18:20"
} |
https://api.github.com/repos/coleifer/peewee/issues/2058 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2058/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2058/comments | https://api.github.com/repos/coleifer/peewee/issues/2058/events | https://github.com/coleifer/peewee/pull/2058 | 527,655,107 | MDExOlB1bGxSZXF1ZXN0MzQ0ODc2ODg5 | 2,058 | Support for FastAPI | {
"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 | [
"Lovely!"
] | 2019-11-24T06:08:10 | 2019-11-29T04:59:04 | 2019-11-24T23:17:52 | NONE | null | Update docs with connection management in FastAPI framework | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2058/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/2058/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2058",
"html_url": "https://github.com/coleifer/peewee/pull/2058",
"diff_url": "https://github.com/coleifer/peewee/pull/2058.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2058.patch",
"merged_at": "2019-11-24T23:17:52"
} |
https://api.github.com/repos/coleifer/peewee/issues/2057 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2057/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2057/comments | https://api.github.com/repos/coleifer/peewee/issues/2057/events | https://github.com/coleifer/peewee/pull/2057 | 527,654,756 | MDExOlB1bGxSZXF1ZXN0MzQ0ODc2NjQz | 2,057 | FastAPI support in Docs | {
"login": "aniljaiswal",
"id": 43805107,
"node_id": "MDQ6VXNlcjQzODA1MTA3",
"avatar_url": "https://avatars.githubusercontent.com/u/43805107?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aniljaiswal",
"html_url": "https://github.com/aniljaiswal",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [] | 2019-11-24T06:03:35 | 2019-11-24T06:04:40 | 2019-11-24T06:04:33 | NONE | null | Add docs for connection management in FastAPI | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2057/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/2057/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2057",
"html_url": "https://github.com/coleifer/peewee/pull/2057",
"diff_url": "https://github.com/coleifer/peewee/pull/2057.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2057.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/2056 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2056/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2056/comments | https://api.github.com/repos/coleifer/peewee/issues/2056/events | https://github.com/coleifer/peewee/issues/2056 | 527,641,515 | MDU6SXNzdWU1Mjc2NDE1MTU= | 2,056 | BloomFilter add from_buffer function | {
"login": "winterxc",
"id": 633342,
"node_id": "MDQ6VXNlcjYzMzM0Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/633342?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/winterxc",
"html_url": "https://github.com/winterxc",
"followers_url": "https://api.github.com/users/winterx... | [] | closed | false | null | [] | null | [
"Done.\r\n\r\n```python\r\nnew_bf = BloomFilter.from_buffer(buf)\r\n```",
"Thank you!"
] | 2019-11-24T02:59:07 | 2019-12-01T02:01:44 | 2019-11-24T23:46:22 | NONE | null | Hi, for rebuild Bloomfilter from cache, can add a from_buffer function to BloomFilter?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2056/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/2056/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2055 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2055/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2055/comments | https://api.github.com/repos/coleifer/peewee/issues/2055/events | https://github.com/coleifer/peewee/issues/2055 | 527,475,367 | MDU6SXNzdWU1Mjc0NzUzNjc= | 2,055 | Peewee and Postgres HA: load balancer or master/master fail-over? | {
"login": "Andrei-Pozolotin",
"id": 1622151,
"node_id": "MDQ6VXNlcjE2MjIxNTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/1622151?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Andrei-Pozolotin",
"html_url": "https://github.com/Andrei-Pozolotin",
"followers_url": "https://ap... | [] | closed | false | null | [] | null | [
"I'm not familiar with that project, but I think I get the jist of your question and hopefully can provide some pointers.\r\n\r\nPeewee implements a simple connection-per-thread model internally. The connection pool simply plugs into the connect / close steps of the usual peewee workflow to recycle connections. So ... | 2019-11-23T00:18:40 | 2019-11-23T01:58:56 | 2019-11-23T01:20:47 | NONE | null | @coleifer Charles:
1. say, there is a master/master replication cluster based on `pglogical`:
https://www.2ndquadrant.com/en/resources/pglogical/pglogical-docs/
2. question: is there an easy way to reuse [PooledPostgresqlExtDatabase](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#PooledPostgresqlExtD... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2055/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/2055/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2054 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2054/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2054/comments | https://api.github.com/repos/coleifer/peewee/issues/2054/events | https://github.com/coleifer/peewee/issues/2054 | 526,765,954 | MDU6SXNzdWU1MjY3NjU5NTQ= | 2,054 | Proxy for Metadata's `schema` field? | {
"login": "rmoretto",
"id": 12282955,
"node_id": "MDQ6VXNlcjEyMjgyOTU1",
"avatar_url": "https://avatars.githubusercontent.com/u/12282955?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rmoretto",
"html_url": "https://github.com/rmoretto",
"followers_url": "https://api.github.com/users/rmo... | [] | closed | false | null | [] | null | [
"Well, I think you could probably get rid of your `get_base_model()` function, as it seems redundant given that you're already using a proxy for your database. That doesn't address the issue, but in your example it's really not doing anything but adding an unnecessary layer of misdirection.\r\n\r\nNow to the crux o... | 2019-11-21T18:26:21 | 2019-11-22T16:28:31 | 2019-11-22T02:14:45 | NONE | null | Hello,
I'm trying to replicate the `DatabaseProxy` behavior but with the `Model._meta.schema` property. I need to define the name of the schema with the `DatabaseProxy` initialization, but I'm failing miserably.
I basically have a factory for base models that go basically like:
```python
# util.py
import peewe... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2054/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/2054/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2053 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2053/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2053/comments | https://api.github.com/repos/coleifer/peewee/issues/2053/events | https://github.com/coleifer/peewee/issues/2053 | 522,012,914 | MDU6SXNzdWU1MjIwMTI5MTQ= | 2,053 | Iterating through a ManyToManyField with a DeferredThroughModel gives back Expression objects | {
"login": "seanballais",
"id": 7175885,
"node_id": "MDQ6VXNlcjcxNzU4ODU=",
"avatar_url": "https://avatars.githubusercontent.com/u/7175885?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/seanballais",
"html_url": "https://github.com/seanballais",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Eureka! I solved the problem.\r\n\r\nI did not perform `.set_model()` to the `DeferredThroughModel` instance I was using for `Class`. It was only being used inside a function that only gets called during creation of the database file causing the field to be unbounded and causing my problem when the database file w... | 2019-11-13T07:31:36 | 2019-11-13T14:02:38 | 2019-11-13T14:02:38 | NONE | null | I have a two models, `Class` and `TimeSlot`. `Class` has a many-to-many field, `timeslots`, to `TimeSlot`. The field uses a `DeferredThroughModel`.
Now, say I have an instance of `Class` in a variable called `class`. I want to iterate through the `timeslots` of `class`, so let's do:
for timeslot in class.time... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2053/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/2053/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2052 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2052/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2052/comments | https://api.github.com/repos/coleifer/peewee/issues/2052/events | https://github.com/coleifer/peewee/issues/2052 | 517,733,263 | MDU6SXNzdWU1MTc3MzMyNjM= | 2,052 | How to get last day of month | {
"login": "Maheshkumar094",
"id": 39484115,
"node_id": "MDQ6VXNlcjM5NDg0MTE1",
"avatar_url": "https://avatars.githubusercontent.com/u/39484115?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Maheshkumar094",
"html_url": "https://github.com/Maheshkumar094",
"followers_url": "https://api.gi... | [] | closed | false | null | [] | null | [
"Couple ways, this way worked for me just now:\r\n\r\n```python\r\n\r\nfrom peewee import *\r\nfrom peewee import NodeList # Grab this explicitly.\r\n\r\nclass Foo(BaseModel):\r\n timestamp = DateTimeField()\r\n\r\nts_month = fn.date_trunc('month', Foo.timestamp)\r\neom = NodeList((SQL('INTERVAL'), '1 MONTH - 1... | 2019-11-05T12:06:48 | 2019-11-06T06:33:00 | 2019-11-05T15:02:37 | NONE | null | I am trying to get last day of the month for that I can find out the sql query
`SELECT (date_trunc('MONTH', now()::date) + INTERVAL '1 MONTH - 1 day')::DATE;`
but I am unable formate into peewee query can you please help me doing this.
Your comment and suggestion really appreciate.
Thank You
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2052/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/2052/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2051 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2051/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2051/comments | https://api.github.com/repos/coleifer/peewee/issues/2051/events | https://github.com/coleifer/peewee/pull/2051 | 515,176,648 | MDExOlB1bGxSZXF1ZXN0MzM0Njc5NDY1 | 2,051 | Update querying.rst | {
"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 | [] | 2019-10-31T05:31:57 | 2019-10-31T14:53:31 | 2019-10-31T14:53:31 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2051/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/2051/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2051",
"html_url": "https://github.com/coleifer/peewee/pull/2051",
"diff_url": "https://github.com/coleifer/peewee/pull/2051.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2051.patch",
"merged_at": "2019-10-31T14:53:31"
} | |
https://api.github.com/repos/coleifer/peewee/issues/2050 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2050/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2050/comments | https://api.github.com/repos/coleifer/peewee/issues/2050/events | https://github.com/coleifer/peewee/issues/2050 | 514,745,880 | MDU6SXNzdWU1MTQ3NDU4ODA= | 2,050 | how to create multiple tables with one class ? | {
"login": "wongzhichao",
"id": 19945110,
"node_id": "MDQ6VXNlcjE5OTQ1MTEw",
"avatar_url": "https://avatars.githubusercontent.com/u/19945110?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wongzhichao",
"html_url": "https://github.com/wongzhichao",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"Really depends on what you're trying to do, but there are APIs for setting the table name, or you can use inheritance or dynamic class-creation to create additional classes."
] | 2019-10-30T15:05:38 | 2019-10-30T15:17:25 | 2019-10-30T15:17:25 | NONE | null | I need to create multiple tables with one class, but i cannot find a way to implement it! | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2050/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/2050/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2049 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2049/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2049/comments | https://api.github.com/repos/coleifer/peewee/issues/2049/events | https://github.com/coleifer/peewee/issues/2049 | 514,303,792 | MDU6SXNzdWU1MTQzMDM3OTI= | 2,049 | BlobField not converted to bytes on Python 3.3+ and Postgresql | {
"login": "PatTheMav",
"id": 9436503,
"node_id": "MDQ6VXNlcjk0MzY1MDM=",
"avatar_url": "https://avatars.githubusercontent.com/u/9436503?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/PatTheMav",
"html_url": "https://github.com/PatTheMav",
"followers_url": "https://api.github.com/users/Pa... | [] | closed | false | null | [] | null | [
"A `memoryview` is just a pointer to a buffer of bytes. It can be indexed, sliced, etc without incurring an allocation and copy. This is a very important optimization to retain when the database-driver supports it (eg psycopg2). Your example field is exactly how I would work-around this if your code depends on havi... | 2019-10-29T23:55:04 | 2019-10-30T16:18:58 | 2019-10-30T13:25:21 | NONE | null | Due to psycopg2 converting Postgres' `bytea` data to `memoryview` objects starting with Python 3.3, models with `BlobField`s require special care:
Data needs to be converted to bytes via `tobytes()` to achieve expected behavior.
Right now Peewee's core implementation doesn't seem to take this into account (the te... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2049/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/2049/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2048 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2048/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2048/comments | https://api.github.com/repos/coleifer/peewee/issues/2048/events | https://github.com/coleifer/peewee/issues/2048 | 510,609,438 | MDU6SXNzdWU1MTA2MDk0Mzg= | 2,048 | Difficulty in accessing joined-on attribute | {
"login": "esztermarton",
"id": 35615910,
"node_id": "MDQ6VXNlcjM1NjE1OTEw",
"avatar_url": "https://avatars.githubusercontent.com/u/35615910?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/esztermarton",
"html_url": "https://github.com/esztermarton",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"You need to explicitly select the columns from Tweet which you want to retain.\r\n\r\nUsing `self.users` is a bit yuck. In fact using that many-to-many is extremely yuck because it serves no purpose and adds needless tables/joins. All you really need is a table containing two foreign keys to User to serve as your ... | 2019-10-22T12:02:59 | 2019-10-24T09:56:30 | 2019-10-22T15:43:32 | NONE | null | Using version 3.9.2.
Attempting to create a query for the following usecase (quite similar to [an example with tweets in the documentation](http://docs.peewee-orm.com/en/latest/peewee/relationships.html#common-table-expressions)):
- Fetch a subset of users with their latest tweet (if it exists)
- Be able to access... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2048/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/2048/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2047 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2047/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2047/comments | https://api.github.com/repos/coleifer/peewee/issues/2047/events | https://github.com/coleifer/peewee/issues/2047 | 509,702,302 | MDU6SXNzdWU1MDk3MDIzMDI= | 2,047 | ModuleNotFoundError: No module named 'peewee' | {
"login": "52lemon",
"id": 13587459,
"node_id": "MDQ6VXNlcjEzNTg3NDU5",
"avatar_url": "https://avatars.githubusercontent.com/u/13587459?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/52lemon",
"html_url": "https://github.com/52lemon",
"followers_url": "https://api.github.com/users/52lemo... | [] | closed | false | null | [] | null | [
"You must have some problem in your imports. This is definitely not the appropriate place for questions like this. Try stackoverflow."
] | 2019-10-21T02:51:28 | 2019-10-21T02:54:22 | 2019-10-21T02:54:22 | NONE | null | i install peewee with pip3, and i got the error below
`
(logpress-tornado) F:\Projects\logpress-tornado>python3 manager.py --cmd=syncdb
Traceback (most recent call last):
File "manager.py", line 17, in <module>
from core import jinja_environment, smtp_server
File "F:\Projects\logpress-tornado\core.py", li... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2047/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/2047/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2046 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2046/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2046/comments | https://api.github.com/repos/coleifer/peewee/issues/2046/events | https://github.com/coleifer/peewee/issues/2046 | 509,644,235 | MDU6SXNzdWU1MDk2NDQyMzU= | 2,046 | Query.returning() wrong alias implementation | {
"login": "dmkulazhenko",
"id": 13505031,
"node_id": "MDQ6VXNlcjEzNTA1MDMx",
"avatar_url": "https://avatars.githubusercontent.com/u/13505031?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dmkulazhenko",
"html_url": "https://github.com/dmkulazhenko",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"peewee==3.11.2\r\npsycopg2-binary==2.8.4\r\n(PostgreSQL)\r\n\r\n\r\n",
"@coleifer, any reply?)",
"Fixed in c2dc7ca7caaafc0840b771de6e5dfc5cbabe83a0",
"@coleifer, thx, have a nice day!"
] | 2019-10-20T20:00:09 | 2019-10-20T21:52:13 | 2019-10-20T21:46:00 | NONE | null | Hi there!
I tried to use peewee as SQLGenerator (yeah, I know that it's very strange and ... know, I just have a reason of doing this shit :trollface:)
That's OK:
```
c = User.insert(username='Petr').returning(User.username)
c.sql()
[stdout]: ('INSERT INTO "user" ("username", "password", "last_activity") VALU... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2046/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/2046/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2045 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2045/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2045/comments | https://api.github.com/repos/coleifer/peewee/issues/2045/events | https://github.com/coleifer/peewee/issues/2045 | 509,517,955 | MDU6SXNzdWU1MDk1MTc5NTU= | 2,045 | BinaryJSONField unescaped JSON text | {
"login": "DucChau",
"id": 1124271,
"node_id": "MDQ6VXNlcjExMjQyNzE=",
"avatar_url": "https://avatars.githubusercontent.com/u/1124271?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/DucChau",
"html_url": "https://github.com/DucChau",
"followers_url": "https://api.github.com/users/DucChau/... | [] | closed | false | null | [] | null | [
"I'm not clear on why you used a text-field in the first place or whether that is in any way related to the problem. Or, for that matter, what the underlying actual column type is on your table? The peewee `playhouse.postgres_ext.BinaryJSONField` will store and retrieve data as JSON. So you can store `dict`, `list`... | 2019-10-19T22:34:11 | 2019-10-19T23:01:35 | 2019-10-19T23:01:35 | NONE | null | Hello,
I'm using `PostgresqlExtDatabase` for the `JSONBField` types.
I currently have a JSONB text field in a Postgres table. When I set the field type to `TextField` in the PeeWee model, saving data in the table looks like valid JSON. Example of JSON value I'm saving to the table below.
``` {"query": "select ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2045/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/2045/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2044 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2044/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2044/comments | https://api.github.com/repos/coleifer/peewee/issues/2044/events | https://github.com/coleifer/peewee/issues/2044 | 508,824,500 | MDU6SXNzdWU1MDg4MjQ1MDA= | 2,044 | Confusing @db.atomic() behavior - transactions don't wrap entire method? | {
"login": "brandond",
"id": 370103,
"node_id": "MDQ6VXNlcjM3MDEwMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/370103?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/brandond",
"html_url": "https://github.com/brandond",
"followers_url": "https://api.github.com/users/brandon... | [] | closed | false | null | [] | null | [
"FWIW, if I switch APSWDatabase out for SqliteDatabase I do see it starting an exclusive transaction when populate_forum is entered, but it does not appear to be committed when the function returns? But it is getting committed somehow.\r\n\r\n```\r\nINFO:__main__:About to call populate\r\nDEBUG:peewee:('BEGIN EXCLU... | 2019-10-18T02:55:34 | 2019-10-18T12:27:39 | 2019-10-18T12:27:38 | NONE | null | I have some code that does a bunch of batch importing from another system. This takes a while and creates/deletes/modifies a bunch of rows across multiple tables. I'd like to do this all in a single transaction so that I can serve read requests while the batch process is running without getting odd partially-processed ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2044/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/2044/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2043 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2043/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2043/comments | https://api.github.com/repos/coleifer/peewee/issues/2043/events | https://github.com/coleifer/peewee/issues/2043 | 508,404,864 | MDU6SXNzdWU1MDg0MDQ4NjQ= | 2,043 | How to research peewee code? | {
"login": "eebeloglazov",
"id": 29166575,
"node_id": "MDQ6VXNlcjI5MTY2NTc1",
"avatar_url": "https://avatars.githubusercontent.com/u/29166575?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eebeloglazov",
"html_url": "https://github.com/eebeloglazov",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"The main module should be skimmable in one sitting. The code flows logically, starting at the lower-level and building up. Correlate with the API doc."
] | 2019-10-17T11:14:02 | 2019-10-17T12:31:22 | 2019-10-17T12:31:22 | NONE | null | Hi!
where is the docstrings and comments?
why all code in one file? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2043/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/2043/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2042 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2042/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2042/comments | https://api.github.com/repos/coleifer/peewee/issues/2042/events | https://github.com/coleifer/peewee/issues/2042 | 508,388,059 | MDU6SXNzdWU1MDgzODgwNTk= | 2,042 | Usage example with FastAPI framework | {
"login": "aniljaiswal",
"id": 43805107,
"node_id": "MDQ6VXNlcjQzODA1MTA3",
"avatar_url": "https://avatars.githubusercontent.com/u/43805107?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aniljaiswal",
"html_url": "https://github.com/aniljaiswal",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"http://docs.peewee-orm.com/en/latest/peewee/contributing.html#questions"
] | 2019-10-17T10:39:04 | 2019-10-17T13:24:08 | 2019-10-17T13:24:07 | NONE | null | Hi,
I'm trying to integrate peewee with FastAPI and would be using it with the Serverless lambda framework. Can you provide me an example of how I would structure and use the database in terms of Models? I need to make sure that in a single lambda invocation I'm opening the DB connection, it's closed when the respon... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2042/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/2042/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2041 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2041/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2041/comments | https://api.github.com/repos/coleifer/peewee/issues/2041/events | https://github.com/coleifer/peewee/pull/2041 | 507,872,844 | MDExOlB1bGxSZXF1ZXN0MzI4Nzc3NzIx | 2,041 | Fix a typo in the doc | {
"login": "kipyin",
"id": 28321392,
"node_id": "MDQ6VXNlcjI4MzIxMzky",
"avatar_url": "https://avatars.githubusercontent.com/u/28321392?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kipyin",
"html_url": "https://github.com/kipyin",
"followers_url": "https://api.github.com/users/kipyin/fo... | [] | closed | false | null | [] | null | [
"Thank you."
] | 2019-10-16T14:01:37 | 2019-10-16T14:06:14 | 2019-10-16T14:06:14 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2041/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/2041/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2041",
"html_url": "https://github.com/coleifer/peewee/pull/2041",
"diff_url": "https://github.com/coleifer/peewee/pull/2041.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2041.patch",
"merged_at": "2019-10-16T14:06:14"
} | |
https://api.github.com/repos/coleifer/peewee/issues/2040 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2040/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2040/comments | https://api.github.com/repos/coleifer/peewee/issues/2040/events | https://github.com/coleifer/peewee/issues/2040 | 506,574,026 | MDU6SXNzdWU1MDY1NzQwMjY= | 2,040 | sqlite3.Warning: You can only execute one statement at a time. | {
"login": "luminousmen",
"id": 9168534,
"node_id": "MDQ6VXNlcjkxNjg1MzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/9168534?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/luminousmen",
"html_url": "https://github.com/luminousmen",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"pysqlite does not like it. Just break it up into multiple statements or use the connection directly and call the `executescript()` method.\r\n\r\nhttps://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.executescript"
] | 2019-10-14T10:41:37 | 2019-10-14T13:22:41 | 2019-10-14T13:22:40 | NONE | null | Hi, I'm trying to execute some SQL scripts on the sqlite database. The SQL scripts example:
```sql
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id integer,
name VARCHAR(100)
);
INSERT INTO t1(id, name) VALUES
(1, 'test');
```
And the code:
```python
from peewee import SqliteDatabase
databas... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2040/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/2040/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2039 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2039/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2039/comments | https://api.github.com/repos/coleifer/peewee/issues/2039/events | https://github.com/coleifer/peewee/issues/2039 | 506,378,203 | MDU6SXNzdWU1MDYzNzgyMDM= | 2,039 | Peewee returns trigger information, but psycopg2 does not | {
"login": "phuvp",
"id": 6632710,
"node_id": "MDQ6VXNlcjY2MzI3MTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/6632710?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/phuvp",
"html_url": "https://github.com/phuvp",
"followers_url": "https://api.github.com/users/phuvp/follower... | [] | closed | false | null | [] | null | [
"This is not a peewee issue. This is a psycopg2 question. Please use the appropriate forum going forward.\r\n\r\nPsycopg2 cursor methods do not return a result. So:\r\n\r\n```\r\ncursor = conn.cursor()\r\ncursor.execute('select ...')\r\nfor row in cursor.fetchall():\r\n ...\r\n```"
] | 2019-10-13T20:33:12 | 2019-10-13T20:57:45 | 2019-10-13T20:57:44 | NONE | null | Hi, I have created a few triggers and am now trying to print their information out. When I run the below, the psyco method errors out since `result=None`, whereas the peewee method returns a list of trigger info shown below. I've already checked that the cursor for psycopg2 is in the right database. I'd like to know wh... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2039/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/2039/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2038 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2038/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2038/comments | https://api.github.com/repos/coleifer/peewee/issues/2038/events | https://github.com/coleifer/peewee/issues/2038 | 506,193,089 | MDU6SXNzdWU1MDYxOTMwODk= | 2,038 | [Request] field type migrations for playhouse.migrate PostgresqlMigrator | {
"login": "mountainash",
"id": 27637,
"node_id": "MDQ6VXNlcjI3NjM3",
"avatar_url": "https://avatars.githubusercontent.com/u/27637?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mountainash",
"html_url": "https://github.com/mountainash",
"followers_url": "https://api.github.com/users/moun... | [] | closed | false | null | [] | null | [
"Just found this as a possible workaround, but it's a fair bit of \"work\" :-)\r\n\r\nhttps://teamtreehouse.com/community/changing-a-peewee-charfield-to-a-textfield",
"This is a pretty decent request, let me think about what it would entail.",
"Dang - that was fast. Nice work!",
"Thx, I appreciate the suggest... | 2019-10-12T14:21:21 | 2019-10-12T16:05:13 | 2019-10-12T15:59:35 | NONE | null | Can a function be added to PostgresqlMigrator to allow for field types to be changed and logged in a migration? (eg smallint to biginit)
Thank you. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2038/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/2038/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2037 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2037/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2037/comments | https://api.github.com/repos/coleifer/peewee/issues/2037/events | https://github.com/coleifer/peewee/issues/2037 | 505,798,373 | MDU6SXNzdWU1MDU3OTgzNzM= | 2,037 | read from slave, write to master | {
"login": "evstratbg",
"id": 10176401,
"node_id": "MDQ6VXNlcjEwMTc2NDAx",
"avatar_url": "https://avatars.githubusercontent.com/u/10176401?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/evstratbg",
"html_url": "https://github.com/evstratbg",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"You'll have to implement it yourself, which can actually be pretty easy.\r\n\r\nYou probably want to have two database instances (or two pools):\r\n\r\n```python\r\n\r\nmaster = PooledPostgresqlDatabase('master')\r\ndb = PooledPostgresqlDatabase('slave')\r\n```\r\n\r\nThen you can use the `bind_ctx()` context mana... | 2019-10-11T11:32:34 | 2022-10-11T13:20:24 | 2019-10-11T14:08:32 | NONE | null | Hi! I'm using peewee 3.11.2
We have master-slave postgres instances, slave - for reading, master - for writing
https://github.com/coleifer/peewee/blob/fc842eaf54a5d047f9281cf1866f81ce93a98496/docs/peewee/changes.rst
I've found out, that there is no longer `read_slave` extension (link above)
Any possibilities ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2037/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/2037/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2036 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2036/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2036/comments | https://api.github.com/repos/coleifer/peewee/issues/2036/events | https://github.com/coleifer/peewee/issues/2036 | 505,300,673 | MDU6SXNzdWU1MDUzMDA2NzM= | 2,036 | Postgres - server down/up, connect with reuse, but error connection already close | {
"login": "wibimaster",
"id": 626666,
"node_id": "MDQ6VXNlcjYyNjY2Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/626666?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wibimaster",
"html_url": "https://github.com/wibimaster",
"followers_url": "https://api.github.com/users/w... | [] | closed | false | null | [] | null | [
"> What's expected\r\n\r\nRead the description of the parameter: http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.connect",
"Sure, I've read it:\r\n\r\nParameters: reuse_if_open (bool) – Do not raise an exception if a connection is already opened.\r\nReturns: whether a new connection was opened.\r\n\... | 2019-10-10T14:14:23 | 2020-12-17T03:14:45 | 2019-10-10T14:45:04 | NONE | null | Hi,
Sorry for the long title, I don't know how to summarize it :x
**Environment:**
* PostgreSQL server
* aiohttp project with Peewee as ORM
* Python 3.7
**How to reproduce**
* Start the aiohttp project, with a "db.connect(reuse=True)" (return True)
* Kill the DB server
* Restart the DB server
* Attem... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2036/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/2036/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2035 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2035/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2035/comments | https://api.github.com/repos/coleifer/peewee/issues/2035/events | https://github.com/coleifer/peewee/issues/2035 | 505,151,202 | MDU6SXNzdWU1MDUxNTEyMDI= | 2,035 | PostgresqlExtDatabase with RealDictCursor causes KeyError on every select | {
"login": "schulzsebastian",
"id": 18170075,
"node_id": "MDQ6VXNlcjE4MTcwMDc1",
"avatar_url": "https://avatars.githubusercontent.com/u/18170075?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/schulzsebastian",
"html_url": "https://github.com/schulzsebastian",
"followers_url": "https://api... | [] | closed | false | null | [] | null | [
"Yeah, don't use that. If you want dicts, then use the `.dicts()` method. Peewee expects cursors to yield row tuples.\r\n\r\n```python\r\n\r\nq = MyModel.select().dicts()\r\nfor row_dict in q:\r\n # ...\r\n```"
] | 2019-10-10T09:33:41 | 2019-10-10T13:19:33 | 2019-10-10T13:19:32 | NONE | null | Peewee version: 3.11.2
Postgresql version: 11
Db init:
```python
from playhouse.postgres_ext import PostgresqlExtDatabase
from psycopg2.extras import RealDictCursor
database = PostgresqlExtDatabase(
None,
register_hstore=False,
autorollback = True,
cursor_factory=RealDictCursor
)
```
Sett... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2035/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/2035/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2034 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2034/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2034/comments | https://api.github.com/repos/coleifer/peewee/issues/2034/events | https://github.com/coleifer/peewee/issues/2034 | 504,616,585 | MDU6SXNzdWU1MDQ2MTY1ODU= | 2,034 | JSONFields can't be updated using Model.bulk_update if they're top-level lists | {
"login": "KarolTrojanowskiDL",
"id": 55237638,
"node_id": "MDQ6VXNlcjU1MjM3NjM4",
"avatar_url": "https://avatars.githubusercontent.com/u/55237638?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/KarolTrojanowskiDL",
"html_url": "https://github.com/KarolTrojanowskiDL",
"followers_url": "ht... | [] | closed | false | null | [] | null | [
"Fixed by above commit. Thanks for the report!"
] | 2019-10-09T12:23:18 | 2019-10-09T13:50:40 | 2019-10-09T13:50:40 | NONE | null | DISCLAIMER: I am terribly sorry I didn't read that I should post an issue first. There's already a PR I made for this: #2033
I noticed that using `Model.bulk_update` won't work with `JSONField`s that are top-level lists because by default `Value` will unpack the list into multiple values. Top-level lists are valid ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2034/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/2034/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2033 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2033/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2033/comments | https://api.github.com/repos/coleifer/peewee/issues/2033/events | https://github.com/coleifer/peewee/pull/2033 | 504,602,942 | MDExOlB1bGxSZXF1ZXN0MzI2MjE1MDc1 | 2,033 | Add ability to update JSON fields that are lists in Model.bulk_update | {
"login": "KarolTrojanowskiDL",
"id": 55237638,
"node_id": "MDQ6VXNlcjU1MjM3NjM4",
"avatar_url": "https://avatars.githubusercontent.com/u/55237638?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/KarolTrojanowskiDL",
"html_url": "https://github.com/KarolTrojanowskiDL",
"followers_url": "ht... | [] | closed | false | null | [] | null | [
"I've patched this in a slightly different way. Am hoping to extend the code elsewhere to use the new `to_value()` interface (as opposed to manually creating Value instances w/the appropriate converter). Thx for the patch, at any rate."
] | 2019-10-09T11:57:22 | 2019-10-09T13:51:58 | 2019-10-09T13:50:23 | NONE | null | I noticed that using `Model.bulk_update` won't work with `JSONField`s that are top-level lists because by default `Value` will unpack the list into multiple values. Top-level lists are valid JSON objects.
Example (before):
```python
class Item(Model):
json = JSONField()
item = Item.create(json=['a','b'])
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2033/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/2033/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2033",
"html_url": "https://github.com/coleifer/peewee/pull/2033",
"diff_url": "https://github.com/coleifer/peewee/pull/2033.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2033.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/2032 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2032/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2032/comments | https://api.github.com/repos/coleifer/peewee/issues/2032/events | https://github.com/coleifer/peewee/issues/2032 | 504,145,894 | MDU6SXNzdWU1MDQxNDU4OTQ= | 2,032 | Install fails if sqlite3 headers not present | {
"login": "fungs",
"id": 8776981,
"node_id": "MDQ6VXNlcjg3NzY5ODE=",
"avatar_url": "https://avatars.githubusercontent.com/u/8776981?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/fungs",
"html_url": "https://github.com/fungs",
"followers_url": "https://api.github.com/users/fungs/follower... | [] | closed | false | null | [] | null | [
"Only way around is to install libsqlite3-dev package on Debian based systems, which is not an option in some environments.",
"Looks like you have cython installed, but perhaps it is not compatible with Python 3.5? This error looks to be cython-related rather than anything else (to me).",
"Sqlite does show an e... | 2019-10-08T16:22:19 | 2019-10-09T15:35:24 | 2019-10-08T16:57:17 | NONE | null | For latest version 0.11.2 and Python 3.5.2 installing with pip on Linux 64bit does give an exit status of 1 instead of installing without sqlite3 module. On the same system, `import sqlite3` works fine, only development files are missing.
pip install peewee
```
Collecting peewee
Using cached https://files.pytho... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2032/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/2032/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2031 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2031/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2031/comments | https://api.github.com/repos/coleifer/peewee/issues/2031/events | https://github.com/coleifer/peewee/issues/2031 | 503,583,173 | MDU6SXNzdWU1MDM1ODMxNzM= | 2,031 | Forced default value | {
"login": "BukinPK",
"id": 18446718,
"node_id": "MDQ6VXNlcjE4NDQ2NzE4",
"avatar_url": "https://avatars.githubusercontent.com/u/18446718?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/BukinPK",
"html_url": "https://github.com/BukinPK",
"followers_url": "https://api.github.com/users/BukinP... | [] | closed | false | null | [] | null | [
"I think something is missing in your example, because this code correctly prints \"None\":\r\n\r\n```python\r\n\r\nfrom peewee import *\r\n\r\n\r\ndb = SqliteDatabase(':memory:')\r\n\r\nclass M(Model):\r\n value = IntegerField(null=True)\r\n class Meta:\r\n database = db\r\n\r\ndb.create_tables([M])\r... | 2019-10-07T17:17:22 | 2019-10-08T00:25:23 | 2019-10-07T21:14:35 | NONE | null | I create a model with a fild:
```
class Map(Model):
size = IntegerField()
```
It is NOT NULL and don't have DEFAULT value by default:
```
pw.IntegerField(
null=False,
default=None,
...
)
```
But when I create new object, with no "size" argument put in automatically generated constructor, a ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2031/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/2031/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2030 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2030/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2030/comments | https://api.github.com/repos/coleifer/peewee/issues/2030/events | https://github.com/coleifer/peewee/pull/2030 | 501,846,142 | MDExOlB1bGxSZXF1ZXN0MzI0MDM5MTc2 | 2,030 | Use the pythonic way to filter with list comprehensions or generator expressions | {
"login": "eltonvs",
"id": 8386137,
"node_id": "MDQ6VXNlcjgzODYxMzc=",
"avatar_url": "https://avatars.githubusercontent.com/u/8386137?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eltonvs",
"html_url": "https://github.com/eltonvs",
"followers_url": "https://api.github.com/users/eltonvs/... | [] | closed | false | null | [] | null | [
"Gonna pass, thanks though."
] | 2019-10-03T04:32:34 | 2019-10-03T11:11:56 | 2019-10-03T11:11:55 | NONE | null | This is a really small refactor in order to use the pythonic way to filter in python.
References:
- https://www.oreilly.com/library/view/python-cookbook/0596001673/ch01s11.html
- https://www.artima.com/weblogs/viewpost.jsp?thread=98196 | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2030/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/2030/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/2030",
"html_url": "https://github.com/coleifer/peewee/pull/2030",
"diff_url": "https://github.com/coleifer/peewee/pull/2030.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/2030.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/2029 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2029/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2029/comments | https://api.github.com/repos/coleifer/peewee/issues/2029/events | https://github.com/coleifer/peewee/issues/2029 | 500,492,709 | MDU6SXNzdWU1MDA0OTI3MDk= | 2,029 | OpenAPI Specification / SwaggerUI for REST API | {
"login": "brandond",
"id": 370103,
"node_id": "MDQ6VXNlcjM3MDEwMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/370103?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/brandond",
"html_url": "https://github.com/brandond",
"followers_url": "https://api.github.com/users/brandon... | [] | closed | false | null | [] | null | [
"That's a no then?",
"> flask_peewee\r\n\r\nwrong repo",
"Right, sorry. I mistakenly assumed it was a submodule like the playhouse stuff. I just saw the message that you're not working on it any more. Did you ever get around to breaking out the REST bits into a separate library?"
] | 2019-09-30T20:00:07 | 2019-10-02T07:17:30 | 2019-09-30T20:08:20 | NONE | null | I'd love to have an autogenerated OpenAPI spec with SwaggerUI support that was easy to use with `flask_peewee.rest`. Someone hacked this together as a standalone module but the project appears to be dead:
https://github.com/hapyak/flask-peewee-swagger
I recently hacked together a translation layer to expose PynamoD... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2029/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/2029/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2028 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2028/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2028/comments | https://api.github.com/repos/coleifer/peewee/issues/2028/events | https://github.com/coleifer/peewee/issues/2028 | 500,486,465 | MDU6SXNzdWU1MDA0ODY0NjU= | 2,028 | Add option tu AutoField | {
"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 | [
"If you're using postgresql, `AutoField` will be created as a `SERIAL` column. This automatically creates a sequence for the ID generation and sets up the default nextval. MySQL uses `AUTO_INCREMENT` and Sqlite just uses `INTEGER` (due to the aliasing of the rowid) for auto-incrementing integer fields.\r\n\r\nIt sh... | 2019-09-30T19:48:53 | 2019-10-01T16:43:29 | 2019-09-30T20:18:03 | NONE | null | Hello...
I need add some extra options in field ID, currently automatic generate in:
```python
class Person(BaseModel):
name = CharField()
last_name = CharField()
```
Field ID generate like: `INTEGER NOT NULL PRIMARY KEY`, it's ok, but, I need:
`INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2028/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/2028/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2027 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2027/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2027/comments | https://api.github.com/repos/coleifer/peewee/issues/2027/events | https://github.com/coleifer/peewee/issues/2027 | 499,753,222 | MDU6SXNzdWU0OTk3NTMyMjI= | 2,027 | what does 'backref' really mean in foreign key? | {
"login": "bmxbmx3",
"id": 33427015,
"node_id": "MDQ6VXNlcjMzNDI3MDE1",
"avatar_url": "https://avatars.githubusercontent.com/u/33427015?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bmxbmx3",
"html_url": "https://github.com/bmxbmx3",
"followers_url": "https://api.github.com/users/bmxbmx... | [] | closed | false | null | [] | null | [
"It's pretty straightforward if you have an understanding of foreign-keys in the first place.\r\n\r\nIf you have a user and tweet model, the tweet has a foreign-key to user to indicate the author of the tweet:\r\n\r\n```python\r\nclass User(Model):\r\n username = TextField()\r\n\r\nclass Tweet(Model):\r\n use... | 2019-09-28T10:15:23 | 2021-01-09T20:32:39 | 2019-09-28T13:47:14 | NONE | null | I have read the documentation and try to understand the meaning of 'backref',which I have found in the word said "Every foreign-key field has an implied back-reference, which is exposed as a pre-filtered Select query using the provided backref attribute."But I still don't know how the back-reference could be exposed as... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2027/reactions",
"total_count": 8,
"+1": 8,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/2027/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2026 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2026/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2026/comments | https://api.github.com/repos/coleifer/peewee/issues/2026/events | https://github.com/coleifer/peewee/issues/2026 | 499,542,877 | MDU6SXNzdWU0OTk1NDI4Nzc= | 2,026 | How best to get inserted row count from Model.insert_many()? | {
"login": "grantcox",
"id": 186808,
"node_id": "MDQ6VXNlcjE4NjgwOA==",
"avatar_url": "https://avatars.githubusercontent.com/u/186808?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/grantcox",
"html_url": "https://github.com/grantcox",
"followers_url": "https://api.github.com/users/grantco... | [] | closed | false | null | [] | null | [
"I hear you -- thanks for mentioning the database you're using. This should work with sqlite as well, though I don't believe it will work for postgres -- but I need to test it out. Let me look into this as I think it's a worthwhile request.",
"ab43376",
"Just a heads-up that this change has been rolled-back in ... | 2019-09-27T16:40:45 | 2022-03-28T00:07:11 | 2019-09-30T15:03:08 | NONE | null | I would expect the `Model.insert_many().execute()` return value to the `rowcount` affected, however it appears to always be `0` (presumably it's attempting to get the primary row id inserted?).
I have found that the following approach works, hacking on how the `returning` implementation works. But it doesn't look l... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2026/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/2026/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2025 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2025/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2025/comments | https://api.github.com/repos/coleifer/peewee/issues/2025/events | https://github.com/coleifer/peewee/issues/2025 | 497,755,435 | MDU6SXNzdWU0OTc3NTU0MzU= | 2,025 | querying jsonfields | {
"login": "Nocturem",
"id": 4144490,
"node_id": "MDQ6VXNlcjQxNDQ0OTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/4144490?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Nocturem",
"html_url": "https://github.com/Nocturem",
"followers_url": "https://api.github.com/users/Noctu... | [] | closed | false | null | [] | null | [
"Assuming you're using sqlite, right?",
"yes ",
"This may be related to a change in 3.11.0. If you're using 3.11.0 or newer, can you try using 3.10 and letting me know if it works there?",
"currently on Version: 3.10.0\r\ncan try 3.11.0 if that may help",
"I've just added a test for the `children()` method ... | 2019-09-24T15:15:44 | 2019-09-24T16:31:58 | 2019-09-24T15:42:26 | NONE | null | Hi there,
Having a little trouble figuring out the children or json_each function in peewee
trying to replicate the basic example
`SELECT DISTINCT user.name
FROM user, json_each(user.phone)
WHERE json_each.value LIKE '704-%';`
however I can't see an example in the documentation
tried mocking up my... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2025/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/2025/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2024 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2024/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2024/comments | https://api.github.com/repos/coleifer/peewee/issues/2024/events | https://github.com/coleifer/peewee/issues/2024 | 497,135,438 | MDU6SXNzdWU0OTcxMzU0Mzg= | 2,024 | pip install failed | {
"login": "JoanEliot",
"id": 30822817,
"node_id": "MDQ6VXNlcjMwODIyODE3",
"avatar_url": "https://avatars.githubusercontent.com/u/30822817?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JoanEliot",
"html_url": "https://github.com/JoanEliot",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Couldn't tell you. Peewee should be in the main folder, as it installs as a module, not a package."
] | 2019-09-23T14:31:51 | 2019-09-23T14:42:21 | 2019-09-23T14:42:21 | NONE | null | (Windows 10, same experience with global/'main' Python and a venv)
I'm a Python dunderhead so excuse any bad lingo or other evidence of lack.
Installation via pip/pypi gave no errors, but imports failed. Checking \site-packages I find peewee.py and pwiz.py out bare in the main folder, and an egg-info folder but n... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2024/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/2024/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2023 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2023/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2023/comments | https://api.github.com/repos/coleifer/peewee/issues/2023/events | https://github.com/coleifer/peewee/issues/2023 | 497,077,444 | MDU6SXNzdWU0OTcwNzc0NDQ= | 2,023 | Model.filter with alias behaves different from Model.select.where | {
"login": "altunyurt",
"id": 126674,
"node_id": "MDQ6VXNlcjEyNjY3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/126674?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/altunyurt",
"html_url": "https://github.com/altunyurt",
"followers_url": "https://api.github.com/users/altu... | [] | closed | false | null | [] | null | [
"Why are you using an alias on a plain old select query? Aliases are designed for one reason: to allow you to reference the same table in multiple contexts within a query (e.g. a self-join). There is no reason to alias a model class simply to select from it -- just use the model itself.\r\n\r\nFurthermore, you're u... | 2019-09-23T12:49:00 | 2019-09-23T13:42:52 | 2019-09-23T13:42:28 | NONE | null | When alias is used with Model.filter, it somehow adds another table reference to queries.
```
In [5]: oi = OrganizationInvitation.alias()
In [6]: oi.select().where(oi.invitee == "1212121212").sql()
Out[6]:
('SELECT "t1"."id", "t1"."organization_id", "t1"."inviter_id", "t1"."invitee" FROM "organization_invi... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2023/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/2023/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2022 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2022/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2022/comments | https://api.github.com/repos/coleifer/peewee/issues/2022/events | https://github.com/coleifer/peewee/issues/2022 | 497,038,444 | MDU6SXNzdWU0OTcwMzg0NDQ= | 2,022 | Sybase Database Connection in Peewee. | {
"login": "govind-savara",
"id": 13663733,
"node_id": "MDQ6VXNlcjEzNjYzNzMz",
"avatar_url": "https://avatars.githubusercontent.com/u/13663733?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/govind-savara",
"html_url": "https://github.com/govind-savara",
"followers_url": "https://api.githu... | [] | closed | false | null | [] | null | [
"No, but it's easy to add your own database backed.",
"You'll probably want to find a db-api 2.0 driver and then read the docs on adding a new database driver:\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/database.html#adding-a-new-database-driver"
] | 2019-09-23T11:23:26 | 2019-09-23T13:37:27 | 2019-09-23T13:37:27 | NONE | null | Hi, Developers.
Do we have an option to connect to Sybase Database using Peewee ORM? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2022/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/2022/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2021 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2021/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2021/comments | https://api.github.com/repos/coleifer/peewee/issues/2021/events | https://github.com/coleifer/peewee/issues/2021 | 496,962,491 | MDU6SXNzdWU0OTY5NjI0OTE= | 2,021 | AttributeError: 'bool' object has no attribute 'safe_name' after upgrade 3.10 -> 3.11 | {
"login": "grandchild",
"id": 770029,
"node_id": "MDQ6VXNlcjc3MDAyOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/770029?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/grandchild",
"html_url": "https://github.com/grandchild",
"followers_url": "https://api.github.com/users/g... | [] | closed | false | null | [] | null | [
"Wow, thanks! So impressed by the quality of your work in general. Thank you for what you do!",
"Pushed 3.11.1 as this seemed like a potentially disruptive regression. Thx for reporting."
] | 2019-09-23T08:36:37 | 2019-09-23T14:03:29 | 2019-09-23T13:35:54 | NONE | null | I updated to peewee to `3.11.0` from `3.10.0` 4 days ago and it presented with the following error. I cannot right now get more detail, because I don't have the time. But I will provide a minimal program reproducing the bug tomorrow. This is just meant as a placeholder, and maybe it'll already point you into the right ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2021/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/2021/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2020 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2020/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2020/comments | https://api.github.com/repos/coleifer/peewee/issues/2020/events | https://github.com/coleifer/peewee/issues/2020 | 496,339,371 | MDU6SXNzdWU0OTYzMzkzNzE= | 2,020 | Is there a way to specify postgresql schema at run time? | {
"login": "shon",
"id": 89816,
"node_id": "MDQ6VXNlcjg5ODE2",
"avatar_url": "https://avatars.githubusercontent.com/u/89816?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/shon",
"html_url": "https://github.com/shon",
"followers_url": "https://api.github.com/users/shon/followers",
"follo... | [] | closed | false | null | [] | null | [
"Sorry, peewee doesn't support that. I'd suggest writing a context manager that explicitly sets `Model._meta.schema`.\r\n\r\nUntested, but possibly something like this (could be optimized):\r\n\r\n```python\r\n\r\nfrom contextlib import contextmanager\r\n\r\n@contextmanager\r\ndef with_schema(models, schema):\r\n ... | 2019-09-20T13:00:28 | 2019-09-20T13:37:01 | 2019-09-20T13:37:01 | NONE | null | Is there any way to specify schema at runtime?
This is specific to postgresql.
**Pseudo code**
```python
class Post(Model):
title = TextField()
class Meta:
def schema_name():
return 'site' + appcontext.tenant_id
```
```python
appcontext.tenant = 13
Post.get(Post... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2020/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/2020/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/2019 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2019/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2019/comments | https://api.github.com/repos/coleifer/peewee/issues/2019/events | https://github.com/coleifer/peewee/issues/2019 | 495,676,074 | MDU6SXNzdWU0OTU2NzYwNzQ= | 2,019 | 'autoconnect' unused in 'PostgresqlExtDatabase' | {
"login": "wibimaster",
"id": 626666,
"node_id": "MDQ6VXNlcjYyNjY2Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/626666?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wibimaster",
"html_url": "https://github.com/wibimaster",
"followers_url": "https://api.github.com/users/w... | [] | closed | false | null | [] | null | [
"Nice find. I need to fix, thanks."
] | 2019-09-19T09:19:09 | 2019-09-19T11:37:52 | 2019-09-19T11:37:52 | NONE | null | Hi !
I'm using Peewee for a Postgres database connection.
The latest documentation says "If you would like to use these awesome features, use the PostgresqlExtDatabase from the playhouse.postgres_ext module", so.. That's what I did :D
But I need the "autoconnect=False" feature, to handle the connection on my o... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2019/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/2019/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.