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/1418 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1418/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1418/comments | https://api.github.com/repos/coleifer/peewee/issues/1418/events | https://github.com/coleifer/peewee/issues/1418 | 287,051,886 | MDU6SXNzdWUyODcwNTE4ODY= | 1,418 | Cannot insert_many with optional fields | {
"login": "lukasni",
"id": 5263957,
"node_id": "MDQ6VXNlcjUyNjM5NTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/5263957?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lukasni",
"html_url": "https://github.com/lukasni",
"followers_url": "https://api.github.com/users/lukasni/... | [] | closed | false | null | [] | null | [
"Alternatively, row_dict would have to be generated for every row, which could result in a significant slowdown.\r\n\r\nActually, looking over it again, neither this nor the option above will work. The suggestion from the original issue will fail to insert optional fields if the first inserted row doesn't have all ... | 2018-01-09T11:11:09 | 2018-01-22T22:06:59 | 2018-01-22T22:06:59 | NONE | null | Model.insert_many() fails if the keys of optional fields are omitted in the dictionary, specifically if _some_ of the objects contain the optional keys and some do not:
Example
---------
```python
db = SqliteDatabase('test.db')
class MyModel(Model):
my_id = PrimaryKeyField()
required_field = CharFi... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1418/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/1418/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1417 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1417/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1417/comments | https://api.github.com/repos/coleifer/peewee/issues/1417/events | https://github.com/coleifer/peewee/issues/1417 | 286,174,115 | MDU6SXNzdWUyODYxNzQxMTU= | 1,417 | paginate function return data is error | {
"login": "aofengli",
"id": 22781840,
"node_id": "MDQ6VXNlcjIyNzgxODQw",
"avatar_url": "https://avatars.githubusercontent.com/u/22781840?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aofengli",
"html_url": "https://github.com/aofengli",
"followers_url": "https://api.github.com/users/aof... | [] | closed | false | null | [] | null | [] | 2018-01-05T02:31:54 | 2018-01-05T03:15:07 | 2018-01-05T03:15:00 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1417/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1417/timeline | null | completed | null | null | |
https://api.github.com/repos/coleifer/peewee/issues/1416 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1416/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1416/comments | https://api.github.com/repos/coleifer/peewee/issues/1416/events | https://github.com/coleifer/peewee/issues/1416 | 285,952,423 | MDU6SXNzdWUyODU5NTI0MjM= | 1,416 | peewee .OperationalError: unknown tokenizer: icu zh_CN ( the same as #1371) | {
"login": "Shazoo",
"id": 3198471,
"node_id": "MDQ6VXNlcjMxOTg0NzE=",
"avatar_url": "https://avatars.githubusercontent.com/u/3198471?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Shazoo",
"html_url": "https://github.com/Shazoo",
"followers_url": "https://api.github.com/users/Shazoo/foll... | [] | closed | false | null | [] | null | [
"You don't have the \"icu\" tokenizer, as the error states.",
"http://site.icu-project.org"
] | 2018-01-04T11:15:59 | 2018-01-05T20:28:48 | 2018-01-05T20:28:48 | NONE | null | Hi ,
I installed peewee via:
```bash
git clone ....; cd peewee
python setup.py build_ext
```
but it raise peewee.OperationalError: unknown tokenizer: icu zh_CN.
I checked the issue 1371 https://github.com/coleifer/peewee/issues/1371
Tried the code mentioned , but it failed...
```python
>>> import sql... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1416/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1416/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1415 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1415/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1415/comments | https://api.github.com/repos/coleifer/peewee/issues/1415/events | https://github.com/coleifer/peewee/issues/1415 | 285,376,870 | MDU6SXNzdWUyODUzNzY4NzA= | 1,415 | insert_many get error "KeyError('"%s" is not a recognized field.' % field)" while same data can be stored by mode.save | {
"login": "cn-qlg",
"id": 15536545,
"node_id": "MDQ6VXNlcjE1NTM2NTQ1",
"avatar_url": "https://avatars.githubusercontent.com/u/15536545?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cn-qlg",
"html_url": "https://github.com/cn-qlg",
"followers_url": "https://api.github.com/users/cn-qlg/fo... | [] | closed | false | null | [] | null | [
"Correct:\r\nScheduleDetail.insert_many(sch_details, validate_fields=True).execute(). But another error is raised \"KeyError: '\"scheduleDate\" is not a recognized field.\"\r\n\r\n---\r\n```ScheduleDetail.insert_many(sch_details, validate_fields=False).execute()```, when use validate_fields=False, it said \"Attrib... | 2018-01-02T08:31:04 | 2018-01-03T16:15:13 | 2018-01-03T16:15:13 | NONE | null | The original code like this:
```
detail = {'bookingCountStatus': 1, 'endTime': '2018-01-02 20:40:00', 'classid': '5584', 'startTime': '2018-01-02 19:40:00', 'tag': 'BBB', 'scheduleId': '40089221', 'boxId_id': 1024, 'supermonkeyCardPrice': 4275, 'scheduleDate': '2018-01-02', 'price': 4500, 'className': 'AAA'}
sch... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1415/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1415/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1414 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1414/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1414/comments | https://api.github.com/repos/coleifer/peewee/issues/1414/events | https://github.com/coleifer/peewee/issues/1414 | 285,254,871 | MDU6SXNzdWUyODUyNTQ4NzE= | 1,414 | MYSQL: TimeField returns datetime.time object instead of datetime.timedelta object | {
"login": "mos87",
"id": 10418496,
"node_id": "MDQ6VXNlcjEwNDE4NDk2",
"avatar_url": "https://avatars.githubusercontent.com/u/10418496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mos87",
"html_url": "https://github.com/mos87",
"followers_url": "https://api.github.com/users/mos87/follow... | [] | closed | false | null | [] | null | [
"Yes, this is documented. You can very easily add your own `IntervalField` implementation.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html#creating-a-custom-field"
] | 2017-12-31T12:22:42 | 2017-12-31T15:18:54 | 2017-12-31T15:18:54 | NONE | null | I have the following construction:
```
class Config(Model):
id = IntegerField(primary_key=True) # primary key = unique id
date = DateField()
time = TimeField()
class Meta:
database = db
db_table = 'config'
def getRepetitiveIntervall():
return Config.get(Config.id == 2).... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1414/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1414/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1413 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1413/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1413/comments | https://api.github.com/repos/coleifer/peewee/issues/1413/events | https://github.com/coleifer/peewee/pull/1413 | 285,178,848 | MDExOlB1bGxSZXF1ZXN0MTYwNTc2MTEw | 1,413 | Update metadata.rst | {
"login": "sigma65535",
"id": 18111133,
"node_id": "MDQ6VXNlcjE4MTExMTMz",
"avatar_url": "https://avatars.githubusercontent.com/u/18111133?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sigma65535",
"html_url": "https://github.com/sigma65535",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"Documentation changes that pertain only to 3.0a are contained in the 3.0a branch."
] | 2017-12-30T02:29:48 | 2017-12-31T01:40:06 | 2017-12-30T04:34:48 | NONE | null | from the attributes table of Meta ,
the property of Meta “db_table” should be “table_name”。 | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1413/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1413/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1413",
"html_url": "https://github.com/coleifer/peewee/pull/1413",
"diff_url": "https://github.com/coleifer/peewee/pull/1413.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1413.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1412 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1412/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1412/comments | https://api.github.com/repos/coleifer/peewee/issues/1412/events | https://github.com/coleifer/peewee/pull/1412 | 285,103,613 | MDExOlB1bGxSZXF1ZXN0MTYwNTIzNzk2 | 1,412 | Document exception hierarchy | {
"login": "zmwangx",
"id": 4149852,
"node_id": "MDQ6VXNlcjQxNDk4NTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/4149852?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zmwangx",
"html_url": "https://github.com/zmwangx",
"followers_url": "https://api.github.com/users/zmwangx/... | [] | closed | false | null | [] | null | [
"Cheers!",
"Wow, that was fast. Thanks.",
"For what it's worth, the peewee exceptions are based on those already documented in the DB-API 2.0 spec. https://www.python.org/dev/peps/pep-0249/#exceptions",
"Good to know, thanks for the pointer."
] | 2017-12-29T14:40:11 | 2017-12-29T14:44:27 | 2017-12-29T14:41:58 | CONTRIBUTOR | null | Sometimes I want to make sure I'm catching all possible peewee exceptions, but not knowing the base exception makes it hard. Having the exception hierarchy in API docs (inspired by [docs for built-in exceptions][1]) could be handy for this.
[1]: https://docs.python.org/3/library/exceptions.html#exception-hierarchy | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1412/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1412/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1412",
"html_url": "https://github.com/coleifer/peewee/pull/1412",
"diff_url": "https://github.com/coleifer/peewee/pull/1412.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1412.patch",
"merged_at": "2017-12-29T14:41:58"
} |
https://api.github.com/repos/coleifer/peewee/issues/1411 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1411/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1411/comments | https://api.github.com/repos/coleifer/peewee/issues/1411/events | https://github.com/coleifer/peewee/issues/1411 | 284,897,424 | MDU6SXNzdWUyODQ4OTc0MjQ= | 1,411 | Allow on=SQL() when joining a table | {
"login": "maaaks",
"id": 3010238,
"node_id": "MDQ6VXNlcjMwMTAyMzg=",
"avatar_url": "https://avatars.githubusercontent.com/u/3010238?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/maaaks",
"html_url": "https://github.com/maaaks",
"followers_url": "https://api.github.com/users/maaaks/foll... | [] | closed | false | null | [] | null | [
"You tried using Peewee 3.0a? I checked and it appears to work correctly.",
"No, not yet."
] | 2017-12-28T11:36:35 | 2017-12-28T16:55:18 | 2017-12-28T16:55:18 | CONTRIBUTOR | null | Currently, it's impossible to make a join with `on=SQL('true')`, only with `on=Clause(SQL('true'))`. I believe this doesn't make enough sense.
The problem is in `QueryCompiler.generate_joins()`. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1411/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1411/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1410 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1410/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1410/comments | https://api.github.com/repos/coleifer/peewee/issues/1410/events | https://github.com/coleifer/peewee/issues/1410 | 284,861,056 | MDU6SXNzdWUyODQ4NjEwNTY= | 1,410 | feature request: add validate schema in peewee model. | {
"login": "rfyiamcool",
"id": 3785409,
"node_id": "MDQ6VXNlcjM3ODU0MDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/3785409?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rfyiamcool",
"html_url": "https://github.com/rfyiamcool",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"I'll pass, I'm not even sure what validate schema means, btw."
] | 2017-12-28T07:50:23 | 2017-12-28T16:54:37 | 2017-12-28T16:54:36 | NONE | null | see title, thank U. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1410/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1410/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1409 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1409/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1409/comments | https://api.github.com/repos/coleifer/peewee/issues/1409/events | https://github.com/coleifer/peewee/issues/1409 | 284,379,383 | MDU6SXNzdWUyODQzNzkzODM= | 1,409 | [Question] Custom setter\callback for model fields | {
"login": "Nixellion",
"id": 20309785,
"node_id": "MDQ6VXNlcjIwMzA5Nzg1",
"avatar_url": "https://avatars.githubusercontent.com/u/20309785?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Nixellion",
"html_url": "https://github.com/Nixellion",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"You can use Model.dirty_fields, which tracks changes to fields. Will that work?",
"It could work, yes. However in a few functions I'm updating all fields and they all get dirty, even if information does not change.\r\n\r\nSo I ended up writing a function that uses `dict(self._data)` and compares current instance... | 2017-12-24T19:42:23 | 2017-12-26T23:31:44 | 2017-12-26T21:11:02 | NONE | null | I'd like my application to send notifications whenever model is saved and certain fields are changed.
I tried doing it by using `@var.setter` but naturally I can not just create a setter for peewee field, so I'd have to make separate set of variable\parameters, which gets quite bulky.
I also read that I can overr... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1409/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1409/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1408 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1408/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1408/comments | https://api.github.com/repos/coleifer/peewee/issues/1408/events | https://github.com/coleifer/peewee/issues/1408 | 284,373,486 | MDU6SXNzdWUyODQzNzM0ODY= | 1,408 | pwiz throwing peewee.ProgrammingError: op ANY/ALL (array) requires array on right side | {
"login": "idvorkin",
"id": 280981,
"node_id": "MDQ6VXNlcjI4MDk4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/280981?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/idvorkin",
"html_url": "https://github.com/idvorkin",
"followers_url": "https://api.github.com/users/idvorki... | [] | closed | false | null | [] | null | [
"```psycopg2.ProgrammingError: op ANY/ALL (array) requires array on right side```\r\n\r\nCan you turn on SQL logging and print out the SQL that causes the problem?\r\n\r\n```python\r\nimport logging\r\nlogger = logging.getLogger('peewee')\r\nlogger.addHandler(logging.StreamHandler())\r\nlogger.setLevel(logging.DEBU... | 2017-12-24T17:09:45 | 2019-11-26T22:09:44 | 2017-12-26T19:15:49 | NONE | null | Howdy, I'm trying to get pwiz to run against redshift. I'm starting by reflecting my database and have the following errors:
Run pwiz over my redshift database:
```
idvor@IGORBASEMENTHP C:\Users\idvor
> python -m pwiz <snip>
Password:
Traceback (most recent call last):
File "C:\Users\idvor\Anaconda3\lib\s... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1408/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1408/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1407 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1407/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1407/comments | https://api.github.com/repos/coleifer/peewee/issues/1407/events | https://github.com/coleifer/peewee/issues/1407 | 284,236,842 | MDU6SXNzdWUyODQyMzY4NDI= | 1,407 | Document insert_many().execute() behavior | {
"login": "vadimkantorov",
"id": 1041752,
"node_id": "MDQ6VXNlcjEwNDE3NTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1041752?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vadimkantorov",
"html_url": "https://github.com/vadimkantorov",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"It seems it's impossible to implement cleanly (`last_insert_rowid` etc) . So a note in the docs about the difference in behavior of `execute()` would be awesome.",
"What database engine are you using?",
"SQLite",
"Yeah sqlite doesn't support the returning clause so you're out of luck."
] | 2017-12-22T19:35:50 | 2018-01-08T10:29:38 | 2018-01-08T10:29:38 | NONE | null | I'd like to bulk insert new Users in a table (peewee 2.10.2).
I'm doing `User.insert_many([dict(display = 'u1'), dict(display = 'u2')]).execute()`. However, this returned boolean. How do I get primary id's for the newly inserted objects?
I saw in the docs that `insert(...).execute()` will return an id, so I expec... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1407/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1407/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1406 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1406/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1406/comments | https://api.github.com/repos/coleifer/peewee/issues/1406/events | https://github.com/coleifer/peewee/issues/1406 | 284,223,933 | MDU6SXNzdWUyODQyMjM5MzM= | 1,406 | [Question] ForeignKey to self | {
"login": "Nixellion",
"id": 20309785,
"node_id": "MDQ6VXNlcjIwMzA5Nzg1",
"avatar_url": "https://avatars.githubusercontent.com/u/20309785?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Nixellion",
"html_url": "https://github.com/Nixellion",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"http://docs.peewee-orm.com/en/latest/peewee/models.html#self-referential-foreign-keys",
"Thanks a lot, sorry I could not find it myself.",
"No worries it's tricky if you aren't sure what to Google for."
] | 2017-12-22T18:22:46 | 2017-12-23T23:32:36 | 2017-12-22T18:51:36 | NONE | null | I'm trying to create a hierarchy of objects, and for that I need to have a foreign key to self class. Not to same instance, but to same class.
So basically what I need is this:
```
class Object(Model):
parent = ForeignKeyField(Object, related_name='children, null=False)
```
But naturally it does not wor... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1406/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1406/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1405 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1405/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1405/comments | https://api.github.com/repos/coleifer/peewee/issues/1405/events | https://github.com/coleifer/peewee/issues/1405 | 284,038,983 | MDU6SXNzdWUyODQwMzg5ODM= | 1,405 | Foreign key fields without related attribute | {
"login": "vadimkantorov",
"id": 1041752,
"node_id": "MDQ6VXNlcjEwNDE3NTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1041752?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vadimkantorov",
"html_url": "https://github.com/vadimkantorov",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"You can, in the model `Meta`, specify `validate_backrefs = False` to disable validation in 2.x.\r\n\r\nIf you're using 3.0a, validation is not enforced at the moment.\r\n\r\nI had not considered supporting disabling backrefs altogether, but that might be a good idea to add in 3.0a.",
"In 3.0a, by specifying `bac... | 2017-12-22T00:06:02 | 2018-01-08T10:36:56 | 2018-01-08T10:36:56 | NONE | null | I'd like to create a model that has two different foreign keys to another model. Peewee forces to use different `related_name`'s in order to make two different related Python attributes in the other model. In fact, I don't need those attributes.
Is there a way to tell Peewee to skip creating these attributes? I trie... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1405/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1405/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1404 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1404/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1404/comments | https://api.github.com/repos/coleifer/peewee/issues/1404/events | https://github.com/coleifer/peewee/issues/1404 | 283,496,049 | MDU6SXNzdWUyODM0OTYwNDk= | 1,404 | How to create temporary table in peewee?? | {
"login": "ptoyhawinf",
"id": 6279891,
"node_id": "MDQ6VXNlcjYyNzk4OTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/6279891?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ptoyhawinf",
"html_url": "https://github.com/ptoyhawinf",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"In peewee 3.0a you can pass `temporary=True` when calling create_table(). In 2.x you'll need to write the query by hand."
] | 2017-12-20T09:17:26 | 2018-01-05T20:30:06 | 2018-01-05T20:30:06 | NONE | null | HI
I used your API for a long time. And I want to create temporary table in my application, however I can’t find any describe in the document.
Could you give me some advice? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1404/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1404/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1403 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1403/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1403/comments | https://api.github.com/repos/coleifer/peewee/issues/1403/events | https://github.com/coleifer/peewee/issues/1403 | 283,476,187 | MDU6SXNzdWUyODM0NzYxODc= | 1,403 | ImportError: cannot import name PooledPostgresqlExtDatabase | {
"login": "toplinuxsir",
"id": 1111353,
"node_id": "MDQ6VXNlcjExMTEzNTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/1111353?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/toplinuxsir",
"html_url": "https://github.com/toplinuxsir",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"You probably need to install psycopg2 the postgres driver."
] | 2017-12-20T07:48:00 | 2017-12-20T13:40:03 | 2017-12-20T13:40:03 | NONE | null | Install peewee for python 2.7 on windows
```
from playhouse.pool import PooledPostgresqlExtDatabase
```
raise exception :
ImportError: cannot import name PooledPostgresqlExtDatabase | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1403/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1403/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1402 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1402/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1402/comments | https://api.github.com/repos/coleifer/peewee/issues/1402/events | https://github.com/coleifer/peewee/issues/1402 | 282,847,315 | MDU6SXNzdWUyODI4NDczMTU= | 1,402 | External files | {
"login": "hugo-pires",
"id": 7768784,
"node_id": "MDQ6VXNlcjc3Njg3ODQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/7768784?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hugo-pires",
"html_url": "https://github.com/hugo-pires",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"Sure...it's just Python?",
"Thanks."
] | 2017-12-18T11:29:53 | 2017-12-18T14:22:42 | 2017-12-18T14:20:32 | NONE | null | Hello
I am using peewee to run raw MySQL queries. Sometimes, I have to use some multi-lines and they take some space on python code files. May I read an external SQL file? Or a Python file with multiliners?
Thank you | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1402/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1402/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1401 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1401/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1401/comments | https://api.github.com/repos/coleifer/peewee/issues/1401/events | https://github.com/coleifer/peewee/issues/1401 | 282,028,810 | MDU6SXNzdWUyODIwMjg4MTA= | 1,401 | Support of BINARY fields | {
"login": "conqp",
"id": 3766192,
"node_id": "MDQ6VXNlcjM3NjYxOTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/3766192?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/conqp",
"html_url": "https://github.com/conqp",
"followers_url": "https://api.github.com/users/conqp/follower... | [] | closed | false | null | [] | null | [
"I believe you should be fine to use `BlobField` for most things, but it is also very easy to subclass `BlobField` and provide an implementation for the data-type you wish to use.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html#creating-a-custom-field"
] | 2017-12-14T09:11:18 | 2017-12-14T14:24:46 | 2017-12-14T14:24:46 | CONTRIBUTOR | null | I was just searching the internet for possibilities to handle BINARY fields (MySQL) in peewee and came across [this](https://github.com/coleifer/peewee/issues/801).
However, though the [respective pull request](https://github.com/coleifer/peewee/pull/802) was merged in 2015, I cannot find the respective code in peewee... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1401/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1401/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1400 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1400/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1400/comments | https://api.github.com/repos/coleifer/peewee/issues/1400/events | https://github.com/coleifer/peewee/issues/1400 | 281,011,019 | MDU6SXNzdWUyODEwMTEwMTk= | 1,400 | Support enum. | {
"login": "alexpantyukhin",
"id": 6513121,
"node_id": "MDQ6VXNlcjY1MTMxMjE=",
"avatar_url": "https://avatars.githubusercontent.com/u/6513121?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexpantyukhin",
"html_url": "https://github.com/alexpantyukhin",
"followers_url": "https://api.gith... | [] | closed | false | null | [] | null | [
"https://github.com/coleifer/peewee/issues/630"
] | 2017-12-11T13:11:32 | 2017-12-11T15:25:03 | 2017-12-11T15:25:03 | NONE | null | Python supports enums (https://docs.python.org/3/library/enum.html) I think it would be good to have it in the `choices` parameter. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1400/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1400/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1399 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1399/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1399/comments | https://api.github.com/repos/coleifer/peewee/issues/1399/events | https://github.com/coleifer/peewee/issues/1399 | 280,976,279 | MDU6SXNzdWUyODA5NzYyNzk= | 1,399 | Keep getting error: OperationalError: Database has not been initialized | {
"login": "XuyangBai",
"id": 15166089,
"node_id": "MDQ6VXNlcjE1MTY2MDg5",
"avatar_url": "https://avatars.githubusercontent.com/u/15166089?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/XuyangBai",
"html_url": "https://github.com/XuyangBai",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Somehow I assume your dataService() object is not getting instantiated. There is a problem in your python code, not in Peewee.",
"Hello, I checked my code again and found that the error `OperationalError: Database has not been initialized` just thrown when I was trying to `from model import db`. \r\nSo how coul... | 2017-12-11T11:04:40 | 2017-12-12T02:08:26 | 2017-12-11T15:24:05 | NONE | null | Hi, I have following code using SqliteQueueDatabase. But I keep getting error `OperationalError: Database has not been initialized` I tried several methods but nothing works. So would please help me with that? Thanks you : )
dataService.py
```
from model import db
class dataService(object):
def __init__(self... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1399/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1399/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1398 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1398/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1398/comments | https://api.github.com/repos/coleifer/peewee/issues/1398/events | https://github.com/coleifer/peewee/issues/1398 | 280,339,516 | MDU6SXNzdWUyODAzMzk1MTY= | 1,398 | No way to create a table by string? | {
"login": "josephmancuso",
"id": 20172538,
"node_id": "MDQ6VXNlcjIwMTcyNTM4",
"avatar_url": "https://avatars.githubusercontent.com/u/20172538?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/josephmancuso",
"html_url": "https://github.com/josephmancuso",
"followers_url": "https://api.githu... | [] | closed | false | null | [] | null | [
"What would it create if there were no columns defined?",
"it could just create a table with an id column by default",
"And what if you don't want the \"id\" column? Seems weird.",
"`migrator.create_table('users', pk='user_id'),` \r\n",
"Peewee already has APIs for creating tables -- going to pass on these ... | 2017-12-08T01:33:39 | 2017-12-10T21:58:19 | 2017-12-10T21:58:19 | NONE | null | why is this not possible?
```
engine = database.engines['default']
migrator = MySQLMigrator(engine)
engine.create_tables(['users'], True) <--- not possible
migrate(
migrator.add_column('users', 'column_name', 'CharField(default=255)'),
)
engine.close()
```
is there no way to simply create a tabl... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1398/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1398/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1397 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1397/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1397/comments | https://api.github.com/repos/coleifer/peewee/issues/1397/events | https://github.com/coleifer/peewee/issues/1397 | 279,387,256 | MDU6SXNzdWUyNzkzODcyNTY= | 1,397 | Extending JSON queries / building expression with JSON keys | {
"login": "tuukkamustonen",
"id": 94327,
"node_id": "MDQ6VXNlcjk0MzI3",
"avatar_url": "https://avatars.githubusercontent.com/u/94327?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tuukkamustonen",
"html_url": "https://github.com/tuukkamustonen",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [
"You *should* just be able to write:\r\n\r\n```python\r\nData.select().where(Data.notes['org_path'] % '1/2/*')\r\n# ('SELECT \"t1\".\"id\", \"t1\".\"notes\" FROM \"data\" AS \"t1\" WHERE (\"t1\".\"notes\"->>%s LIKE %s)',\r\n# ['org_chart', '1/2/*'])\r\n```",
"Uh, I'll try that. What how about _if_ I actually need... | 2017-12-05T14:07:08 | 2017-12-05T15:52:16 | 2017-12-05T15:22:50 | NONE | null | I'm trying to query by single JSON field value with pattern matching (e.g. `ILIKE "foo*"`), something like:
```python
class BaseModel(peewee.Model):
class Meta(object):
database = db
class Data(BaseModel):
notes = BinaryJsonField()
# Create tables and indexes...
Data.create(notes={'org_p... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1397/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1397/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1396 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1396/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1396/comments | https://api.github.com/repos/coleifer/peewee/issues/1396/events | https://github.com/coleifer/peewee/issues/1396 | 278,900,615 | MDU6SXNzdWUyNzg5MDA2MTU= | 1,396 | Model.get doesn't work when I pass a foreing key field attribute | {
"login": "yanghg-basefx",
"id": 29534214,
"node_id": "MDQ6VXNlcjI5NTM0MjE0",
"avatar_url": "https://avatars.githubusercontent.com/u/29534214?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yanghg-basefx",
"html_url": "https://github.com/yanghg-basefx",
"followers_url": "https://api.githu... | [] | closed | false | null | [] | null | [
"Good catch...the `filter()` API is not very smart when it comes to self-referential foreign-keys. I had thought it would handle this simple case, but apparently I'm missing a unit-test (which would've revealed the issue).\r\n\r\nFor now, try:\r\n\r\n```python\r\nM.get(M.parent == 10000)\r\n```",
"I've pushed a f... | 2017-12-04T07:43:25 | 2017-12-06T00:27:41 | 2017-12-05T14:30:27 | NONE | null | Please see this code:
```python
import peewee
db = peewee.MySQLDatabase(**CONNECT_KWARGS)
class M(peewee.Model):
parent= peewee.ForeignKeyField('self')
class Meta:
database= db
db_table = 'M'
M.get(parent=None) # It works.
M.get(parent=10000) # It doesn't work. peewee.Operation... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1396/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1396/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1395 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1395/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1395/comments | https://api.github.com/repos/coleifer/peewee/issues/1395/events | https://github.com/coleifer/peewee/issues/1395 | 278,847,991 | MDU6SXNzdWUyNzg4NDc5OTE= | 1,395 | ERROR:raysync:pysqlite or sqlite3 must be installed. | {
"login": "nuxwork",
"id": 4026598,
"node_id": "MDQ6VXNlcjQwMjY1OTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/4026598?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nuxwork",
"html_url": "https://github.com/nuxwork",
"followers_url": "https://api.github.com/users/nuxwork/... | [] | closed | false | null | [] | null | [
"Try opening up a python shell and running:\r\n\r\n```\r\nfrom peewee import sqlite3\r\nprint sqlite3\r\n```\r\n\r\nYou can also try:\r\n\r\n```\r\nfrom pysqlite2 import dbapi2\r\nimport sqlite3\r\n```\r\n\r\nWhat happens?",
"My python is compiled by myself, I forget to add sqlite3 module."
] | 2017-12-04T01:58:39 | 2017-12-04T06:09:09 | 2017-12-04T06:09:09 | NONE | null | The peewee i used , running ok on windows, but linux. it print `ERROR:pysqlite or sqlite3 must be installed.`

os: CentOS-x86_64-minimal
python: Python 2.7.13
pip list:
altgraph (0.14)
backpor... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1395/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1395/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1394 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1394/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1394/comments | https://api.github.com/repos/coleifer/peewee/issues/1394/events | https://github.com/coleifer/peewee/issues/1394 | 278,680,969 | MDU6SXNzdWUyNzg2ODA5Njk= | 1,394 | execute_sql pass typle to MySQLdb if param is None | {
"login": "daoiqi",
"id": 2141872,
"node_id": "MDQ6VXNlcjIxNDE4NzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/2141872?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/daoiqi",
"html_url": "https://github.com/daoiqi",
"followers_url": "https://api.github.com/users/daoiqi/foll... | [] | closed | false | null | [] | null | [
"?",
"MySQL\r\n\r\n```python\r\nsql = \"select DATE_FORMAT(MAX(NOW()),'%Y-%m-%d'); \"\r\nprint database.execute_sql(sql)\r\n\r\n\r\nsql = \"insert into t_user set name='abc%abc';\"\r\nprint database.execute_sql(sql)\r\n\r\n\r\n```\r\n```\r\nTraceback (most recent call last):\r\n File \"models.py\", line 1332,... | 2017-12-02T12:38:53 | 2017-12-06T12:52:25 | 2017-12-03T16:23:37 | NONE | null | https://github.com/coleifer/peewee/blob/c6b5946a997e39f9939b0261e2b75c46acbac8f2/peewee.py#L3831
pass typle to MySQLdb if param is `None`, why not `None` to MySQLdb? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1394/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1394/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1393 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1393/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1393/comments | https://api.github.com/repos/coleifer/peewee/issues/1393/events | https://github.com/coleifer/peewee/issues/1393 | 278,344,088 | MDU6SXNzdWUyNzgzNDQwODg= | 1,393 | Problems with playhouse.db_url.connect objects when initialising database connection | {
"login": "andy47",
"id": 782758,
"node_id": "MDQ6VXNlcjc4Mjc1OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/782758?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/andy47",
"html_url": "https://github.com/andy47",
"followers_url": "https://api.github.com/users/andy47/follow... | [] | closed | false | null | [] | null | [
"You might try removing one of the slashes on the sqlite filename.\r\n\r\nIt seems a bit wonky to use `connect` to instantiate a db object, only to throw it away and call `init` on a different instance. I get that you want to use the logic in `connect()` -- but it seems like if you can do it in one place you should... | 2017-12-01T03:10:28 | 2017-12-19T22:38:46 | 2017-12-19T21:18:00 | NONE | null | I'm trying to dynamically initialise my database connection (at run time) using connection strings. This works fine with PostgreSQL
```
>>> from playhouse.db_url import connect
>>> db = connect('postgres://user:password@localhost/database')
>>> import models
>>> models.db.init(db.database, **db.connect_kwargs)
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1393/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1393/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1392 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1392/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1392/comments | https://api.github.com/repos/coleifer/peewee/issues/1392/events | https://github.com/coleifer/peewee/issues/1392 | 277,293,409 | MDU6SXNzdWUyNzcyOTM0MDk= | 1,392 | Cast json string as decimal, dates | {
"login": "aitchnyu",
"id": 5927706,
"node_id": "MDQ6VXNlcjU5Mjc3MDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/5927706?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aitchnyu",
"html_url": "https://github.com/aitchnyu",
"followers_url": "https://api.github.com/users/aitch... | [] | closed | false | null | [] | null | [
"Peewee 3.0a supports a `Cast` type and corresponding method.\r\n\r\n```python\r\n# untested, but should be about right\r\nquery = MyModel.select().where(Model.json['num'].cast('numeric') >= 100)\r\nprint query.count()\r\n```\r\n\r\nIn Peewee 2.x you can:\r\n\r\n```python\r\nfrom playhouse.shortcuts import cast\r\n... | 2017-11-28T08:14:00 | 2017-11-28T15:33:06 | 2017-11-28T15:33:05 | NONE | null | In SQLAlchemy, I could do:
```
session\
.query(Model)\
.filter(Model.json['num'].astext.cast(db.Numeric) >= Decimal(100))\
.count()
```
I want to use the JSON field to store custom attributes in the form of decimal, dates and references to other objects (to do join... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1392/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1392/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1391 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1391/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1391/comments | https://api.github.com/repos/coleifer/peewee/issues/1391/events | https://github.com/coleifer/peewee/issues/1391 | 275,763,157 | MDU6SXNzdWUyNzU3NjMxNTc= | 1,391 | Question: is there a best practice changing schema configuration depending on the model used? | {
"login": "thxv3n0lvl",
"id": 1503456,
"node_id": "MDQ6VXNlcjE1MDM0NTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1503456?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/thxv3n0lvl",
"html_url": "https://github.com/thxv3n0lvl",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"Could you be more specific?",
"I just wanted to switch the schema using class Meta. I went through the docs and achieve it with this:\r\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html#model-options-and-table-metadata"
] | 2017-11-21T15:54:16 | 2017-11-24T22:25:52 | 2017-11-24T22:25:51 | NONE | null | So I would like to know if there's a good way / approach to change schema configuration depending on the model used. I thought that `class Meta` was able to do that, but I can't find anything related to that on the docs, or probably not looking for it properly.
Any advice?
Best Regards! | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1391/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1391/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1390 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1390/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1390/comments | https://api.github.com/repos/coleifer/peewee/issues/1390/events | https://github.com/coleifer/peewee/issues/1390 | 275,568,963 | MDU6SXNzdWUyNzU1Njg5NjM= | 1,390 | Inheritance with ForeignKeyFields | {
"login": "judemille",
"id": 8127111,
"node_id": "MDQ6VXNlcjgxMjcxMTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/8127111?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/judemille",
"html_url": "https://github.com/judemille",
"followers_url": "https://api.github.com/users/ju... | [] | closed | false | null | [] | null | [
"Can you provide an example? I'm not sure I follow about inheriting classes.",
"You can disable backref validation by specifying:\r\n\r\n```python\r\nclass MyModel(Model):\r\n class Meta:\r\n validate_backrefs = False\r\n```\r\n\r\nAlso, so long as you aren't explicitly setting the `related_name`, inher... | 2017-11-21T02:55:46 | 2017-11-27T15:44:34 | 2017-11-27T15:33:50 | NONE | null | When I try to inherit a class with a ForeignKeyField, I get an AttributeError about my related_name already being in use. I want all of the inheriting classes to share the same field in the foreign model so that they can be counted together. Is this possible? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1390/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1390/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1389 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1389/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1389/comments | https://api.github.com/repos/coleifer/peewee/issues/1389/events | https://github.com/coleifer/peewee/pull/1389 | 274,811,269 | MDExOlB1bGxSZXF1ZXN0MTUzMjU3MjE1 | 1,389 | Do not force primary_key value on returning clause | {
"login": "gdraynz",
"id": 5525902,
"node_id": "MDQ6VXNlcjU1MjU5MDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/5525902?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gdraynz",
"html_url": "https://github.com/gdraynz",
"followers_url": "https://api.github.com/users/gdraynz/... | [] | closed | false | null | [] | null | [
"Cheers, thanks!"
] | 2017-11-17T10:00:57 | 2017-11-17T14:54:24 | 2017-11-17T14:54:20 | CONTRIBUTOR | null | Using Postgresql, when calling `.returning(*)` on an `InsertQuery`, the `RETURNING` clause was always set to my single primary_key.
I simply inverted the two possible returning clauses to ensure `.returning()` takes the priority. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1389/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1389/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1389",
"html_url": "https://github.com/coleifer/peewee/pull/1389",
"diff_url": "https://github.com/coleifer/peewee/pull/1389.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1389.patch",
"merged_at": "2017-11-17T14:54:20"
} |
https://api.github.com/repos/coleifer/peewee/issues/1388 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1388/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1388/comments | https://api.github.com/repos/coleifer/peewee/issues/1388/events | https://github.com/coleifer/peewee/issues/1388 | 274,682,733 | MDU6SXNzdWUyNzQ2ODI3MzM= | 1,388 | Help wanted on querying | {
"login": "dashingspidy",
"id": 4521441,
"node_id": "MDQ6VXNlcjQ1MjE0NDE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4521441?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dashingspidy",
"html_url": "https://github.com/dashingspidy",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"This kind of question is not appropriate for the issue tracker. Please post to stackoverflow.\r\n\r\nBecause I'm a nice guy :) you're getting duplicate rows because you're joining on Photo...why are you joining on photo in the above query?"
] | 2017-11-16T22:13:49 | 2017-11-16T22:46:23 | 2017-11-16T22:46:23 | NONE | null | I have User and Photo table and when i join them while querying, it duplicates User based on how many photo is associated with.
```
class User(BaseModel):
id = PrimaryKeyField()
looking_for = CharField()
```
```
class Photo(BaseModel):
id = PrimaryKeyField()
url = CharField()
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1388/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1388/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1387 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1387/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1387/comments | https://api.github.com/repos/coleifer/peewee/issues/1387/events | https://github.com/coleifer/peewee/pull/1387 | 274,308,776 | MDExOlB1bGxSZXF1ZXN0MTUyODg4NDU4 | 1,387 | doc: Fix a typo | {
"login": "bfontaine",
"id": 1334295,
"node_id": "MDQ6VXNlcjEzMzQyOTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1334295?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bfontaine",
"html_url": "https://github.com/bfontaine",
"followers_url": "https://api.github.com/users/bf... | [] | closed | false | null | [] | null | [] | 2017-11-15T21:21:57 | 2017-11-19T16:42:35 | 2017-11-15T22:20:32 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1387/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1387/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1387",
"html_url": "https://github.com/coleifer/peewee/pull/1387",
"diff_url": "https://github.com/coleifer/peewee/pull/1387.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1387.patch",
"merged_at": "2017-11-15T22:20:32"
} | |
https://api.github.com/repos/coleifer/peewee/issues/1386 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1386/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1386/comments | https://api.github.com/repos/coleifer/peewee/issues/1386/events | https://github.com/coleifer/peewee/issues/1386 | 274,259,568 | MDU6SXNzdWUyNzQyNTk1Njg= | 1,386 | create_tables(...,safe=True) fails after migration unless Meta.db_table is defined on model | {
"login": "aurcioli-handy",
"id": 15836389,
"node_id": "MDQ6VXNlcjE1ODM2Mzg5",
"avatar_url": "https://avatars.githubusercontent.com/u/15836389?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aurcioli-handy",
"html_url": "https://github.com/aurcioli-handy",
"followers_url": "https://api.gi... | [] | closed | false | null | [] | null | [
"I'm confused... Peewee normalizes the case of the table name from the model name in the absence of an explicit `db_table`, so the first call to create_tables() in step 1 should be using the same table name as in step 3.",
"This is odd, it appears to be changing the case unpredictably.\r\n\r\nHere is what I am se... | 2017-11-15T18:32:53 | 2017-11-15T19:21:47 | 2017-11-15T19:21:47 | NONE | null | **Expected behavior:**
create_tables([MyModel], safe=True) does not raise an error if table exists
**Observed behavior:**
`peewee.InternalError: (1050, "Table 'MyModel' already exists")`
**How to reproduce**
1. Create a simple model definition and run create_tables()
2. Create and run a migration to add a col... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1386/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1386/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1385 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1385/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1385/comments | https://api.github.com/repos/coleifer/peewee/issues/1385/events | https://github.com/coleifer/peewee/issues/1385 | 274,258,935 | MDU6SXNzdWUyNzQyNTg5MzU= | 1,385 | KeyError when fields specified in select() | {
"login": "jspayne",
"id": 4028489,
"node_id": "MDQ6VXNlcjQwMjg0ODk=",
"avatar_url": "https://avatars.githubusercontent.com/u/4028489?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jspayne",
"html_url": "https://github.com/jspayne",
"followers_url": "https://api.github.com/users/jspayne/... | [] | closed | false | null | [] | null | [
"The issue is you're selecting a column on a joined model, but not selecting anything from Test_File_Options.\r\n\r\nYou probably want to rewrite as:\r\n\r\n```python\r\n(TestFile\r\n .select(TestFile.filename)\r\n .join(Test_File_Options)\r\n .join(TestOption)\r\n .where(TestOption.option == '-G')\r\n .get())\r\n`... | 2017-11-15T18:30:29 | 2017-11-15T18:45:10 | 2017-11-15T18:45:10 | NONE | null | Test_File_Options is a many-many foreign key table with references to TestFile and TestOptions.
```
q1 = Test_File_Options.select(TestFile.file_name).join(TestFile).switch(Test_File_Options).join(TestOption).where(TestOption.option == '-G').distinct().alias('q1a')
```
I can directly run the query generated by the a... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1385/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1385/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1384 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1384/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1384/comments | https://api.github.com/repos/coleifer/peewee/issues/1384/events | https://github.com/coleifer/peewee/issues/1384 | 274,238,189 | MDU6SXNzdWUyNzQyMzgxODk= | 1,384 | Massive overhead when iterating over 1k+ rows in postgres even with server side cursors | {
"login": "ParthGandhi",
"id": 819237,
"node_id": "MDQ6VXNlcjgxOTIzNw==",
"avatar_url": "https://avatars.githubusercontent.com/u/819237?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ParthGandhi",
"html_url": "https://github.com/ParthGandhi",
"followers_url": "https://api.github.com/user... | [] | closed | false | null | [] | null | [
"My sense is that this has to do with using server-side cursors, but I couldn't be more specific. A further consideration is that when you iterate over a large list of rows, Peewee will cache the results in memory to make subsequent iterations fast. If you only need to do a single-pass, you can add \".iterator()\" ... | 2017-11-15T17:21:30 | 2017-11-29T20:17:38 | 2017-11-29T20:17:38 | NONE | null | I'm seeing an inexplicably large overhead when iterating over a postgres table.
I profiled the code, and also did a smoke test with `SQLAlchemy` to make sure it wasn't a slow connection or the underlying driver (`psycopg2`).
Running this against a postgres table of ~1M records but fetching only a tiny fraction o... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1384/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1384/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1383 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1383/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1383/comments | https://api.github.com/repos/coleifer/peewee/issues/1383/events | https://github.com/coleifer/peewee/issues/1383 | 273,613,980 | MDU6SXNzdWUyNzM2MTM5ODA= | 1,383 | Executing multiple statements in one raw query gives Commands out of sync | {
"login": "nuclearspike",
"id": 1151638,
"node_id": "MDQ6VXNlcjExNTE2Mzg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1151638?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nuclearspike",
"html_url": "https://github.com/nuclearspike",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"Nevermind. I fixed it by running it in one transaction as two separate .raw() queries."
] | 2017-11-13T23:22:59 | 2017-11-14T01:00:45 | 2017-11-14T01:00:45 | NONE | null | How do I run a query that has two statements that must be run together?
```
tr = TensorRaw.raw("""
SET @x := 0;
SELECT *
FROM (SELECT (@x:=@x+1) AS x, mt.* FROM tensor_raw mt ORDER BY servertime desc) t
WHERE MOD(x, 5) = 0
limit 100;
""").execute()
```
This th... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1383/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1383/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1382 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1382/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1382/comments | https://api.github.com/repos/coleifer/peewee/issues/1382/events | https://github.com/coleifer/peewee/issues/1382 | 273,584,576 | MDU6SXNzdWUyNzM1ODQ1NzY= | 1,382 | sqliteq: method is not supported during get_or_create | {
"login": "gsemet",
"id": 133498,
"node_id": "MDQ6VXNlcjEzMzQ5OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/133498?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gsemet",
"html_url": "https://github.com/gsemet",
"followers_url": "https://api.github.com/users/gsemet/follow... | [] | closed | false | null | [] | null | [
"Correct. The docs state this:\r\n\r\n> The downside, however, is that you cannot issue write transactions that encompass multiple queries – all writes run in autocommit mode, essentially.\r\n\r\nTo prevent users from shooting themselves in the foot, transaction APIs are disabled.\r\n\r\nThe problem is you're mixin... | 2017-11-13T21:30:12 | 2017-11-14T16:40:46 | 2017-11-14T15:41:45 | NONE | null | `get_or_create` raises an exception when the row does not exist when using sqliteq
```
except cls.DoesNotExist:
try:
params = dict((k, v) for k, v in kwargs.items()
if '__' not in k)
params.update(defaults)
with cls._meta.database.atomic():
return cl... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1382/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1382/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1381 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1381/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1381/comments | https://api.github.com/repos/coleifer/peewee/issues/1381/events | https://github.com/coleifer/peewee/issues/1381 | 273,425,594 | MDU6SXNzdWUyNzM0MjU1OTQ= | 1,381 | Provide an enumeration for valid on_delete values. | {
"login": "conqp",
"id": 3766192,
"node_id": "MDQ6VXNlcjM3NjYxOTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/3766192?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/conqp",
"html_url": "https://github.com/conqp",
"followers_url": "https://api.github.com/users/conqp/follower... | [] | closed | false | null | [] | null | [
"Enum is a python 3 thing, using it in 2.x requires a separate library if I'm not mistaken. Similarly, I prefer not to hard-code the list of supported actions since there may be some variance between options between databases (?)."
] | 2017-11-13T13:15:57 | 2017-11-13T14:42:28 | 2017-11-13T14:42:28 | CONTRIBUTOR | null | Currently, the `on_delete` keyword argument of `ForeignKeyField` takes arbitrary strings.
The valid values are not documented in the [API reference](http://docs.peewee-orm.com/en/latest/peewee/api.html?highlight=cascade#ForeignKeyField) - just one example is given.
Assuming that all [options supported by MySQL](https... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1381/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1381/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1380 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1380/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1380/comments | https://api.github.com/repos/coleifer/peewee/issues/1380/events | https://github.com/coleifer/peewee/issues/1380 | 273,038,741 | MDU6SXNzdWUyNzMwMzg3NDE= | 1,380 | get_or_create causes duplicates with multiprocessing | {
"login": "jspayne",
"id": 4028489,
"node_id": "MDQ6VXNlcjQwMjg0ODk=",
"avatar_url": "https://avatars.githubusercontent.com/u/4028489?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jspayne",
"html_url": "https://github.com/jspayne",
"followers_url": "https://api.github.com/users/jspayne/... | [] | closed | false | null | [] | null | [
"`get_or_create()` is not a silver bullet...race conditions abound.\r\n\r\nYour best bet is to use database constraints (as you are) and do something like select for update or create->get.\r\n\r\n```python\r\nwith db.atomic():\r\n try:\r\n test_file = TestFile.select().where(TestFile.filename == f).for_up... | 2017-11-10T19:43:58 | 2017-11-13T17:10:56 | 2017-11-13T17:10:56 | NONE | null | Name: peewee
Version: 2.10.2
I've tried implementing multiprocessing with peewee in two different ways.
Example 1:
```
import peewee as pw
from playhouse.pool import PooledMySQLDatabase
import multiprocessing as mp
db = PooledMySQLDatabase("options_db", threadlocals=True, user="opts_user", passwd="opt... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1380/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1380/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1379 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1379/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1379/comments | https://api.github.com/repos/coleifer/peewee/issues/1379/events | https://github.com/coleifer/peewee/pull/1379 | 271,823,839 | MDExOlB1bGxSZXF1ZXN0MTUxMTA3NTc0 | 1,379 | Fix Postgres extension's full text search Match | {
"login": "lerry",
"id": 1225368,
"node_id": "MDQ6VXNlcjEyMjUzNjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1225368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lerry",
"html_url": "https://github.com/lerry",
"followers_url": "https://api.github.com/users/lerry/follower... | [] | closed | false | null | [] | null | [] | 2017-11-07T13:03:16 | 2017-11-07T15:32:00 | 2017-11-07T15:32:00 | NONE | null | the field should also be converted to to_tsvector with language | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1379/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1379/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1379",
"html_url": "https://github.com/coleifer/peewee/pull/1379",
"diff_url": "https://github.com/coleifer/peewee/pull/1379.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1379.patch",
"merged_at": "2017-11-07T15:32:00"
} |
https://api.github.com/repos/coleifer/peewee/issues/1378 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1378/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1378/comments | https://api.github.com/repos/coleifer/peewee/issues/1378/events | https://github.com/coleifer/peewee/issues/1378 | 271,765,141 | MDU6SXNzdWUyNzE3NjUxNDE= | 1,378 | Setting MySQL storage engine | {
"login": "tomvlk",
"id": 3877688,
"node_id": "MDQ6VXNlcjM4Nzc2ODg=",
"avatar_url": "https://avatars.githubusercontent.com/u/3877688?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tomvlk",
"html_url": "https://github.com/tomvlk",
"followers_url": "https://api.github.com/users/tomvlk/foll... | [] | closed | false | null | [] | null | [
"https://github.com/coleifer/peewee/issues/178#issuecomment-232955141"
] | 2017-11-07T09:38:14 | 2017-11-15T17:37:27 | 2017-11-15T17:37:27 | NONE | null | I wonder if it's already possible to set the MySQL storage engine for tables in a model or anywhere so it kinda works with ``create_tables`` method.
I ask this because of the limitation when the default storage engine is set to MyISAM and when you are creating tables in a utf8mb4_unicode_ci collation, it will complain... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1378/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1378/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1377 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1377/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1377/comments | https://api.github.com/repos/coleifer/peewee/issues/1377/events | https://github.com/coleifer/peewee/issues/1377 | 271,499,114 | MDU6SXNzdWUyNzE0OTkxMTQ= | 1,377 | prevent related attribute assignement | {
"login": "scilo7",
"id": 2485641,
"node_id": "MDQ6VXNlcjI0ODU2NDE=",
"avatar_url": "https://avatars.githubusercontent.com/u/2485641?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/scilo7",
"html_url": "https://github.com/scilo7",
"followers_url": "https://api.github.com/users/scilo7/foll... | [] | closed | false | null | [] | null | [
"This isn't SQLAlchemy, home-skillet!\r\n\r\nGood suggestion on making read-only :+1: ",
"So, I just prototyped the change and realized I can't enforce making back-references read-only because under some conditions, when resolving a query, Peewee may assign a list to the backref. For example when calling `dict_to... | 2017-11-06T14:45:03 | 2017-11-06T15:13:33 | 2017-11-06T15:13:33 | NONE | null | Coming from sqlalchemy, it's not obvious that related attributes shouldn't be assigned.
```python
class User(Model):
name = CharField()
class Tweet(Model):
text = CharField()
user = ForeignKeyField(User, null=True, related_name='tweets')
u = User(name='bob')
u.save()
u.tweets = [T... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1377/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1377/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1376 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1376/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1376/comments | https://api.github.com/repos/coleifer/peewee/issues/1376/events | https://github.com/coleifer/peewee/issues/1376 | 271,334,490 | MDU6SXNzdWUyNzEzMzQ0OTA= | 1,376 | soundex postgres | {
"login": "ra-esmith",
"id": 24212262,
"node_id": "MDQ6VXNlcjI0MjEyMjYy",
"avatar_url": "https://avatars.githubusercontent.com/u/24212262?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ra-esmith",
"html_url": "https://github.com/ra-esmith",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"I'm not sure exactly what you mean, but Peewee supports arbitrary function calls:\r\n\r\n```\r\nSomeModel.select().where(fn.soundex(SomeModel.column) == fn.soundex(search_string))\r\n```"
] | 2017-11-06T01:25:23 | 2017-11-06T15:09:14 | 2017-11-06T15:09:14 | NONE | null | Hello,
Rather than use contains in my where clause I would like to use postgres soundex. Does peewee support soundex? What would be an example of the syntax.
Thanks,
Evan | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1376/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1376/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1375 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1375/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1375/comments | https://api.github.com/repos/coleifer/peewee/issues/1375/events | https://github.com/coleifer/peewee/issues/1375 | 271,094,627 | MDU6SXNzdWUyNzEwOTQ2Mjc= | 1,375 | RecursionError when querying by postgresql_ext BinaryJSONField in pytest | {
"login": "cejohnson",
"id": 2759726,
"node_id": "MDQ6VXNlcjI3NTk3MjY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2759726?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cejohnson",
"html_url": "https://github.com/cejohnson",
"followers_url": "https://api.github.com/users/ce... | [] | closed | false | null | [] | null | [
"I believe this is a PyTest problem. Peewee uses recursive-descent to convert the AST into SQL. Given that it runs fine outside the py.test suite, I'd suggest you file this with the py.test developers.",
"@coleifer thanks for the quick response. I found a similar open issue there, I'll follow up with the py.test ... | 2017-11-03T19:30:34 | 2017-11-06T18:18:40 | 2017-11-06T17:41:37 | NONE | null | Hello,
I'm using postgresql_ext with peewee, and am getting a RecursionError when attempting to query by a BinaryJSONField key, i.e.
```python
Model.select().where(Model.json['key'] == 'value')
```
This happens if you attempt to reference the field in at least the WHERE or ORDER BY clauses, and probably else... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1375/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1375/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1374 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1374/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1374/comments | https://api.github.com/repos/coleifer/peewee/issues/1374/events | https://github.com/coleifer/peewee/issues/1374 | 270,259,615 | MDU6SXNzdWUyNzAyNTk2MTU= | 1,374 | Join.metadata doesn't seem to respect Join.on enough | {
"login": "maaaks",
"id": 3010238,
"node_id": "MDQ6VXNlcjMwMTAyMzg=",
"avatar_url": "https://avatars.githubusercontent.com/u/3010238?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/maaaks",
"html_url": "https://github.com/maaaks",
"followers_url": "https://api.github.com/users/maaaks/foll... | [] | closed | false | null | [] | null | [
"Before I dig into this specific issue, do you mind giving things a try with 3.0a and letting me know if it resolves the issue?",
"This appears to be working correctly in the 3.0a branch:\r\n\r\n```python\r\nfrom peewee import *\r\n\r\ndb = SqliteDatabase(':memory:')\r\n\r\nclass BaseModel(Model):\r\n class Me... | 2017-11-01T10:16:05 | 2017-11-15T22:28:07 | 2017-11-15T22:28:07 | CONTRIBUTOR | null | Here's what I found in the `Join` code while debugging:
```python
fk_field, is_backref = self.get_foreign_key(src, dest, self.on)
if fk_field is None and self.on is not None:
fk_field, is_backref = self.get_foreign_key(src, dest)
```
I don't understand why Peewee here decides to choose __any__ foreign key... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1374/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1374/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1373 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1373/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1373/comments | https://api.github.com/repos/coleifer/peewee/issues/1373/events | https://github.com/coleifer/peewee/issues/1373 | 269,924,098 | MDU6SXNzdWUyNjk5MjQwOTg= | 1,373 | how to do cross database join | {
"login": "hongweishang",
"id": 6167917,
"node_id": "MDQ6VXNlcjYxNjc5MTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/6167917?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hongweishang",
"html_url": "https://github.com/hongweishang",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"能不能在不同数据库间join并不是peewee能决定的。比如MySQL,同一个服务的不同数据库间是可以join的,但是不同服务就不要想了。\r\n\r\n更明确一点,你定义Model的时候,是用的同一个peewee.Database 实例还是不同的Database实例,这决定了你到底能不能在不同的数据库之间join",
"@yanghg-basefx 数据库用的是MYSQL,MYSQL本身是支持cross db join的, 用raw sql是没有问题的;\r\n两个model分别是不同的database属性(_meta.database)。\r\n看了下peewee源码,它确实不支持cross db join,即使... | 2017-10-31T11:27:22 | 2017-11-03T13:59:22 | 2017-11-03T13:59:22 | NONE | null | dm.A.select(dm.A.id, cm.B.name).join(cm.B, on=(dm.A.type==cm.B.id))
<class 'data_models.TRepFlow'> SELECT `t3`.`id`, `t2`.`name` FROM `t_rep_flow` AS t1 INNER JOIN `t_sys_app` AS t2 ON (`t2`.`id` = `t1`.`itemtype`) []
question: A and B are models. A and B is not in the same db. So, how to do cross db join? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1373/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1373/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1372 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1372/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1372/comments | https://api.github.com/repos/coleifer/peewee/issues/1372/events | https://github.com/coleifer/peewee/issues/1372 | 268,587,724 | MDU6SXNzdWUyNjg1ODc3MjQ= | 1,372 | BoolField for Sqlite does't get mapped to a boolean value | {
"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 | [
"Two reasons for that. One, sqlite has no boolean type. Two, in python true is literally the same as 1 and false is 0.",
"Thanks for the comment. I was aware of that. That's why I thing it would be handy to have uniform type coercion. Original issue I ran into was that marshalling select query results into JSON w... | 2017-10-25T23:58:21 | 2017-10-27T13:59:58 | 2017-10-27T13:59:58 | NONE | null | BoolField for Sqlite does't get mapped to a boolean value. Instead its DB representation (INTEGER) value gets returned. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1372/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1372/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1371 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1371/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1371/comments | https://api.github.com/repos/coleifer/peewee/issues/1371/events | https://github.com/coleifer/peewee/issues/1371 | 268,277,039 | MDU6SXNzdWUyNjgyNzcwMzk= | 1,371 | How to specify an icu tokenizer locale identifier for subclass of sqlite_ext.FTSModel? | {
"login": "galeo",
"id": 1025559,
"node_id": "MDQ6VXNlcjEwMjU1NTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1025559?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/galeo",
"html_url": "https://github.com/galeo",
"followers_url": "https://api.github.com/users/galeo/follower... | [] | closed | false | null | [] | null | [
"It seems that Peewee is quoting the tokenizer (both 2.x and 3.0a), it looks like:\r\n\r\n```sql\r\nCREATE VIRTUAL TABLE \"note\" USING FTS3 (\"content\", tokenize=\"icu en_AU\")\r\n```\r\n\r\nCan you do an experiment for me? Using Peewee (or just the plain old `sqlite3` module):\r\n\r\n```python\r\nfrom playhouse.... | 2017-10-25T06:10:19 | 2017-11-15T17:38:08 | 2017-11-15T17:38:08 | NONE | null | Sqlite's built in icu tokenizer supports locale identifier, for example:
```sql
CREATE VIRTUAL TABLE thai_text USING fts3(text, tokenize=icu th_TH)
```
If tried to set `Meta.extension_options = {'tokenize': 'icu th_TH'}`, it will raise error:
```
peewee.OperationalError: unknown tokenizer: icu th_TH
```
Does it... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1371/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1371/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1370 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1370/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1370/comments | https://api.github.com/repos/coleifer/peewee/issues/1370/events | https://github.com/coleifer/peewee/issues/1370 | 267,881,639 | MDU6SXNzdWUyNjc4ODE2Mzk= | 1,370 | Nested result in JSON format | {
"login": "rogercorrea",
"id": 11555553,
"node_id": "MDQ6VXNlcjExNTU1NTUz",
"avatar_url": "https://avatars.githubusercontent.com/u/11555553?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rogercorrea",
"html_url": "https://github.com/rogercorrea",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"Peewee has a helper called \"model_to_dict\" which can construct (recursively, if you desire) a dictionary containing model data, which can then be serialized as JSON.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/playhouse.html#model_to_dict",
"Thanks for answer, but I did try use backrefs parameter in mod... | 2017-10-24T03:01:51 | 2017-10-24T17:14:08 | 2017-10-24T15:24:37 | NONE | null | Please,
How can I use a query with Peewee to return a JSON format with Nested objects?
Example:
```
[
{
"active": 1,
"id": 1,
"name": "Los Angeles",
"idState": 2,
"TBState": {
"id": 2,
"name": "California"
}
}
]
```
I can it using Sql... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1370/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1370/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1369 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1369/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1369/comments | https://api.github.com/repos/coleifer/peewee/issues/1369/events | https://github.com/coleifer/peewee/issues/1369 | 267,426,891 | MDU6SXNzdWUyNjc0MjY4OTE= | 1,369 | peewee.OperationalError: row value misused | {
"login": "kalimalrazif",
"id": 2915349,
"node_id": "MDQ6VXNlcjI5MTUzNDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/2915349?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kalimalrazif",
"html_url": "https://github.com/kalimalrazif",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"My guess is that the value of `Link` is from a previous call to `get_or_create`, which returns a 2-tuple of `<model instance>, <bool created?>`.\r\n\r\nCan you verify whether the value of `Link` is a tuple?",
"Was that precisely!!! Thanks!!!",
"If you forget that `get_or_create` returns a tuple and you try to ... | 2017-10-22T01:18:53 | 2022-01-18T17:16:57 | 2017-10-24T15:24:48 | NONE | null | Hi, I'm getting this messages when I try to get_or_create a record on db. This is the model on sqlite
```python
class BaseModel(Model):
class Meta:
database = db
class Compania(BaseModel):
name = TextField(null=False)
url = TextField()
country = TextField()
state = TextField()
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1369/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1369/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1368 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1368/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1368/comments | https://api.github.com/repos/coleifer/peewee/issues/1368/events | https://github.com/coleifer/peewee/pull/1368 | 267,281,881 | MDExOlB1bGxSZXF1ZXN0MTQ3ODc4NDgw | 1,368 | Add support for using verbose names as CSV header values | {
"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 | [
"CSV module is no longer included in Peewee as of 3.0.0.",
"@coleifer is there a suggested replacement? This was a great simple way to dump stuff out.",
"The dumping code is just a thin wrapper: https://github.com/coleifer/peewee/blob/stable/playhouse/csv_utils.py\r\n\r\nYou can easily backport it into your cod... | 2017-10-20T19:34:27 | 2018-02-01T00:57:38 | 2018-01-31T12:30:13 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1368/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1368/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1368",
"html_url": "https://github.com/coleifer/peewee/pull/1368",
"diff_url": "https://github.com/coleifer/peewee/pull/1368.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1368.patch",
"merged_at": null
} | |
https://api.github.com/repos/coleifer/peewee/issues/1367 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1367/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1367/comments | https://api.github.com/repos/coleifer/peewee/issues/1367/events | https://github.com/coleifer/peewee/issues/1367 | 266,767,578 | MDU6SXNzdWUyNjY3Njc1Nzg= | 1,367 | joins and default values | {
"login": "LolusKekus",
"id": 17664948,
"node_id": "MDQ6VXNlcjE3NjY0OTQ4",
"avatar_url": "https://avatars.githubusercontent.com/u/17664948?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LolusKekus",
"html_url": "https://github.com/LolusKekus",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"I understand your thinking, but unfortunately I'm worried about the implications of modifying this behavior in the 2.x branch. Perhaps I can introduce such a change in 3.x, though?",
"Fixed in 3.0a. No exception is raised, `None` is simply returned as the field value."
] | 2017-10-19T08:55:13 | 2017-10-25T14:56:13 | 2017-10-25T14:56:13 | NONE | null | Why peewee returns default values for joined tabels when i forgot to select this field?
I have 2 models:
```
class ModelOne(Model):
fieldOne = IntegerField(default=666)
fieldTwo = IntegerField()
class ModelTwo(Model):
modelOne = ForeignKeyField(ModelOne)
someField = IntegerField()
```
For ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1367/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1367/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1366 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1366/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1366/comments | https://api.github.com/repos/coleifer/peewee/issues/1366/events | https://github.com/coleifer/peewee/pull/1366 | 266,025,591 | MDExOlB1bGxSZXF1ZXN0MTQ2OTY2MTYw | 1,366 | Add clear explanations about the implications of SQLite having foreign keys off by default, in combination with default PrimaryKeyField ID reuse. | {
"login": "bryhoyt",
"id": 4769854,
"node_id": "MDQ6VXNlcjQ3Njk4NTQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/4769854?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bryhoyt",
"html_url": "https://github.com/bryhoyt",
"followers_url": "https://api.github.com/users/bryhoyt/... | [] | closed | false | null | [] | null | [
"Very nice, thank you!"
] | 2017-10-17T07:51:46 | 2017-10-17T14:34:01 | 2017-10-17T14:34:01 | CONTRIBUTOR | null | To address the problems raised in #550
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1366/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1366/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1366",
"html_url": "https://github.com/coleifer/peewee/pull/1366",
"diff_url": "https://github.com/coleifer/peewee/pull/1366.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1366.patch",
"merged_at": "2017-10-17T14:34:01"
} |
https://api.github.com/repos/coleifer/peewee/issues/1365 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1365/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1365/comments | https://api.github.com/repos/coleifer/peewee/issues/1365/events | https://github.com/coleifer/peewee/issues/1365 | 265,927,897 | MDU6SXNzdWUyNjU5Mjc4OTc= | 1,365 | how are join keys determined? | {
"login": "ra-esmith",
"id": 24212262,
"node_id": "MDQ6VXNlcjI0MjEyMjYy",
"avatar_url": "https://avatars.githubusercontent.com/u/24212262?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ra-esmith",
"html_url": "https://github.com/ra-esmith",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"I cannot tell you which foreign key to join on, only you would know that. To specify the key, in the join method add an `on` argument:\r\n\r\n```python\r\nSomething.select().join(Other, on=Other.some_field)\r\n```"
] | 2017-10-16T21:50:59 | 2017-10-17T14:38:24 | 2017-10-17T14:38:24 | NONE | null | I am getting the error
17:43:04 web.1 | ValueError: More than one foreign key between <class 'sample_models.X'> and <class 'sample_models.Y'>.
How do I determine which keys to join on?
I think this is the query that is at issue.
In the old peewee I did not specify anyting related to the keys to join on
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1365/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1365/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1364 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1364/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1364/comments | https://api.github.com/repos/coleifer/peewee/issues/1364/events | https://github.com/coleifer/peewee/issues/1364 | 265,879,324 | MDU6SXNzdWUyNjU4NzkzMjQ= | 1,364 | crash on startup with port from 2 to 3a | {
"login": "ra-esmith",
"id": 24212262,
"node_id": "MDQ6VXNlcjI0MjEyMjYy",
"avatar_url": "https://avatars.githubusercontent.com/u/24212262?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ra-esmith",
"html_url": "https://github.com/ra-esmith",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"You need the 3.0a branches of wtf-peewee and flask-peewee, if your project depends on those libraries. Since I haven't merged 3.0a into master yet, you'll need to use the branches. When 3.0a is merged into peewee master, I'll merge the other libraries as well."
] | 2017-10-16T19:02:33 | 2017-10-16T20:08:48 | 2017-10-16T20:08:48 | NONE | null | Thought I would try the 3.0a version
I was running peewee==2.10.1
did a pip uninstall of peewee and then installed peewee 3.0a
And then just ran my code ...
Got some errors right off ... ideas? Is there a list of changes we should make to port up?
For example
"importError: cannot import name PrimaryKeyFiel... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1364/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1364/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1363 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1363/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1363/comments | https://api.github.com/repos/coleifer/peewee/issues/1363/events | https://github.com/coleifer/peewee/issues/1363 | 265,510,748 | MDU6SXNzdWUyNjU1MTA3NDg= | 1,363 | ManyToMany-Field creation throws an IntegrityError "Duplicate entry for key" | {
"login": "greece57",
"id": 9194851,
"node_id": "MDQ6VXNlcjkxOTQ4NTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/9194851?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/greece57",
"html_url": "https://github.com/greece57",
"followers_url": "https://api.github.com/users/greec... | [] | closed | false | null | [] | null | [
"Can't replicate:\r\n\r\n```python\r\nfrom peewee import *\r\nfrom playhouse.fields import ManyToManyField\r\n\r\ndatabase = SqliteDatabase(':memory:')\r\n\r\nclass BaseModel(Model):\r\n class Meta:\r\n database = database\r\n\r\nclass Hashtag(BaseModel):\r\n tag = TextField()\r\n\r\nclass Article(Base... | 2017-10-14T17:57:49 | 2017-10-17T12:33:41 | 2017-10-17T12:33:41 | NONE | null | I don't know where that error is coming from, thats why I want to ask here.
I'm doing the following:
```
class Article(BaseModel):
time = pw.DateTimeField()
# ...
hashtags = ManyToManyField(Hashtag, related_name='articles')
topics = ManyToManyField(Topic, related_name='topics')
text ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1363/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1363/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1362 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1362/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1362/comments | https://api.github.com/repos/coleifer/peewee/issues/1362/events | https://github.com/coleifer/peewee/issues/1362 | 265,473,562 | MDU6SXNzdWUyNjU0NzM1NjI= | 1,362 | An InterfaceError was not catched only in PostgreSQLDatabase | {
"login": "yanghg-basefx",
"id": 29534214,
"node_id": "MDQ6VXNlcjI5NTM0MjE0",
"avatar_url": "https://avatars.githubusercontent.com/u/29534214?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yanghg-basefx",
"html_url": "https://github.com/yanghg-basefx",
"followers_url": "https://api.githu... | [] | closed | false | null | [] | null | [
"Why are you closing the connection in the middle of iterating over a cursor? That makes no sense.",
"This is only a reproducing. The problem is this issue often happened because some network fault so the connection was closed in the middle of iterating. \r\n\r\nIt is only happened between two different city's da... | 2017-10-14T08:01:54 | 2017-10-17T21:53:19 | 2017-10-16T14:57:39 | NONE | null | I have searched this issue, and it looks like #334
I can reproduce this problem by this code:
```python
from a_postgresql_module import MyModel
for instance in MyModel.select():
print instance.id
MyModel._meta.database.close()
```
This issue seems like postgresql will close a cursor automatical... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1362/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1362/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1361 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1361/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1361/comments | https://api.github.com/repos/coleifer/peewee/issues/1361/events | https://github.com/coleifer/peewee/issues/1361 | 264,487,266 | MDU6SXNzdWUyNjQ0ODcyNjY= | 1,361 | DateTimeField get <unicode> instead of <datetime> in special case | {
"login": "icewisb",
"id": 28560844,
"node_id": "MDQ6VXNlcjI4NTYwODQ0",
"avatar_url": "https://avatars.githubusercontent.com/u/28560844?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/icewisb",
"html_url": "https://github.com/icewisb",
"followers_url": "https://api.github.com/users/icewis... | [] | closed | false | null | [] | null | [
"What version of Peewee? What database driver?",
"Closing due to inactivity.",
"My peewee is 2.10.2 in python2, this case only appear when I use three tables. It disappeared when I leave two talbes",
"Database driver is mysqldb.",
"That's rather odd. Is there a reason you're using the call to `.alias()` al... | 2017-10-11T07:46:16 | 2018-10-19T07:23:45 | 2017-11-15T17:38:20 | NONE | null | With use of fn.MAX and join 3 tables and group_by, I can't get DateTimeField with type <datetime> correctly.
```python
from peewee import JOIN, fn
from server.models import SaoShip, SaoMstr, SaoStyle
store = '001'
company = '10011'
m = SaoMstr.alias()
t = SaoStyle.alias()
s = SaoShip.alias()
query = m.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1361/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1361/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1360 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1360/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1360/comments | https://api.github.com/repos/coleifer/peewee/issues/1360/events | https://github.com/coleifer/peewee/issues/1360 | 263,717,974 | MDU6SXNzdWUyNjM3MTc5NzQ= | 1,360 | AttributeError: 'NoneType' object has no attribute 'sqlite_version_info' | {
"login": "avish-3pg",
"id": 22098240,
"node_id": "MDQ6VXNlcjIyMDk4MjQw",
"avatar_url": "https://avatars.githubusercontent.com/u/22098240?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/avish-3pg",
"html_url": "https://github.com/avish-3pg",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Try 8ba62478f7ce4fc3890fad0d1c42e851a382bdd4 ?",
"Closing due to inactivity."
] | 2017-10-08T13:29:34 | 2017-10-16T14:58:16 | 2017-10-16T14:58:16 | NONE | null | @coleifer Still facing the sqlite3 issue, even though we are using peewee==2.10.1. Please advice at the earliest. Thank you.
Error Stack Trace -
'NoneType' object has no attribute 'sqlite_version_info': AttributeError
Traceback (most recent call last):
File "/var/task/handler.py", line 511, in lambda_handler
re... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1360/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1360/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1359 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1359/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1359/comments | https://api.github.com/repos/coleifer/peewee/issues/1359/events | https://github.com/coleifer/peewee/pull/1359 | 263,420,509 | MDExOlB1bGxSZXF1ZXN0MTQ1MTMzODkx | 1,359 | Database URL extension for retrieving endpoint information from AWS RDS | {
"login": "mguillau",
"id": 3710154,
"node_id": "MDQ6VXNlcjM3MTAxNTQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/3710154?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mguillau",
"html_url": "https://github.com/mguillau",
"followers_url": "https://api.github.com/users/mguil... | [] | closed | false | null | [] | null | [
"Because I'm not interested in maintaining this functionality, I'd suggest packaging this as a standalone project.",
"It seems like the schema resolver change would be necessary to build this as an independent package.",
"Thanks for the comments. I can easily re-submit a patch containing only the schema resolut... | 2017-10-06T11:50:48 | 2017-10-09T09:42:20 | 2017-10-06T15:06:43 | NONE | null | This pull-request adds an extension to playhouse's database URL mechanism to handle two new URL schemes, namely rds:// and rdsro:// (for rds "read-only"). These schemes simplify the use of AWS' Relational Database Service (RDS).
Through boto3 (the main python SDK for AWS), RDS can provide the host endpoint (rw or ro... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1359/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1359/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1359",
"html_url": "https://github.com/coleifer/peewee/pull/1359",
"diff_url": "https://github.com/coleifer/peewee/pull/1359.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1359.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1358 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1358/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1358/comments | https://api.github.com/repos/coleifer/peewee/issues/1358/events | https://github.com/coleifer/peewee/issues/1358 | 263,203,680 | MDU6SXNzdWUyNjMyMDM2ODA= | 1,358 | Mapping class inheritance hierarchies | {
"login": "apotapov",
"id": 131698,
"node_id": "MDQ6VXNlcjEzMTY5OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/131698?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/apotapov",
"html_url": "https://github.com/apotapov",
"followers_url": "https://api.github.com/users/apotapo... | [] | closed | false | null | [] | null | [
"I'm not familiar with the SQLAlchemy implementation or behavior, but with Peewee inheriting a class creates a completely separate table with all the columns from the parent plus whatever is defined on the child class. There are no magic foreign-keys or anything like that.",
"Thanks for a quick response.\r\n\r\nS... | 2017-10-05T17:21:32 | 2017-10-13T14:15:46 | 2017-10-05T17:40:37 | NONE | null | Pardon my ignorance, as I'm coming to python web frameworks from Rails-land.
I'm wondering if peewee offers Single Table Inheritance similar to Rails. There seems to be an option for it in SQLAlchemy: http://docs.sqlalchemy.org/en/latest/orm/inheritance.html#single-table-inheritance
If not, what are my options? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1358/reactions",
"total_count": 2,
"+1": 2,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1358/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1357 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1357/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1357/comments | https://api.github.com/repos/coleifer/peewee/issues/1357/events | https://github.com/coleifer/peewee/issues/1357 | 262,560,306 | MDU6SXNzdWUyNjI1NjAzMDY= | 1,357 | More advanced index creation | {
"login": "Necoro",
"id": 68708,
"node_id": "MDQ6VXNlcjY4NzA4",
"avatar_url": "https://avatars.githubusercontent.com/u/68708?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Necoro",
"html_url": "https://github.com/Necoro",
"followers_url": "https://api.github.com/users/Necoro/followers",
... | [] | closed | false | null | [] | null | [
"I love it!",
"When you're declaring an index inside the `Meta` attribute, the Python interpreter hasn't constructed the actual model class yet, so you can't do neat things like this:\r\n\r\n```python\r\nclass Article(Model):\r\n name = TextField()\r\n timestamp = TimestampField()\r\n status = IntegerFie... | 2017-10-03T19:42:23 | 2017-11-29T20:17:53 | 2017-11-29T20:17:53 | CONTRIBUTOR | null | Currently one can only define indexes using a tuple consisting of column names and uniqueness. With this construct it is not possible to create functional or partial indexes, for instance.
While ways exist, it is a) what way is to be preferred and b) most often the declaration of that index will be somewhere else th... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1357/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1357/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1356 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1356/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1356/comments | https://api.github.com/repos/coleifer/peewee/issues/1356/events | https://github.com/coleifer/peewee/issues/1356 | 262,173,607 | MDU6SXNzdWUyNjIxNzM2MDc= | 1,356 | Interface error connections already closed on ubuntu | {
"login": "vctrferreira",
"id": 9720953,
"node_id": "MDQ6VXNlcjk3MjA5NTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/9720953?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vctrferreira",
"html_url": "https://github.com/vctrferreira",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"IDK, some weirdness in tornado? No idea, you might try StackOverflow or track down the original exception?",
"This is the original traceback, you can help me? @coleifer \r\n\r\n```\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/home/a... | 2017-10-02T18:04:27 | 2017-10-02T19:17:15 | 2017-10-02T18:17:34 | NONE | null | This is the traceback
```
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/app/webapp/env/lib/python3.5/site-packages/tornado/web.py", line 1467, in _stack_context_handle_exception
raise_exc_info((type, value, traceback))
File "<string>... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1356/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/1356/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1355 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1355/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1355/comments | https://api.github.com/repos/coleifer/peewee/issues/1355/events | https://github.com/coleifer/peewee/issues/1355 | 262,108,532 | MDU6SXNzdWUyNjIxMDg1MzI= | 1,355 | ArrayField and explicit type casts error | {
"login": "joaodlf",
"id": 3275379,
"node_id": "MDQ6VXNlcjMyNzUzNzk=",
"avatar_url": "https://avatars.githubusercontent.com/u/3275379?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/joaodlf",
"html_url": "https://github.com/joaodlf",
"followers_url": "https://api.github.com/users/joaodlf/... | [] | closed | false | null | [] | null | [
"The fix to this was to update ArrayField(CharField) to ArrayField(TextField), since my fields are of type **text[]**. Doh."
] | 2017-10-02T14:41:10 | 2017-10-02T15:35:03 | 2017-10-02T15:35:03 | NONE | null | Hi, I'm using the latest version of peewee with Python 3.6, here is my code:
```
from playhouse.postgres_ext import *
from config_constants import SQL_HOST, SQL_USER, SQL_PASSWORD, SQL_DATABASE
database = PostgresqlExtDatabase(SQL_DATABASE,
user=SQL_USER,
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1355/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1355/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1354 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1354/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1354/comments | https://api.github.com/repos/coleifer/peewee/issues/1354/events | https://github.com/coleifer/peewee/issues/1354 | 261,177,666 | MDU6SXNzdWUyNjExNzc2NjY= | 1,354 | "ambiguous column name: t1.id" on weird SQL query | {
"login": "franciscod",
"id": 726447,
"node_id": "MDQ6VXNlcjcyNjQ0Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/726447?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/franciscod",
"html_url": "https://github.com/franciscod",
"followers_url": "https://api.github.com/users/f... | [] | closed | false | null | [] | null | [
"You probably need to use a model alias for the self-join on `caraggregate`.\r\n\r\n```python\r\nCarAggregateAlias = CarAggregate.alias()\r\n...\r\n.join(CarAggregateAlias, on=(CarAggregate.previous_self == CarAggregateAlias.id))\r\n```",
"Hey Charles, thanks for helping :)\r\n\r\nI'm using `get_or_create` and do... | 2017-09-28T02:52:09 | 2017-09-29T20:08:36 | 2017-09-29T00:54:20 | CONTRIBUTOR | null | ```
('SELECT
"t1"."id",
"t1"."finished",
"t1"."timestamp",
"t1"."previous_self_id",
"t1"."car_id",
"t1"."best_hotlap_id",
"t1"."laps_total"
FROM
"caraggregate" AS t1
INNER JOIN
"car" AS t2
ON ( "t1"."car_id" = "t2"."id")
INNER JOIN "caraggregate" ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1354/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1354/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1353 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1353/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1353/comments | https://api.github.com/repos/coleifer/peewee/issues/1353/events | https://github.com/coleifer/peewee/issues/1353 | 259,521,735 | MDU6SXNzdWUyNTk1MjE3MzU= | 1,353 | Cannot specify schema with PostgresqlMigrator | {
"login": "irlabs",
"id": 622169,
"node_id": "MDQ6VXNlcjYyMjE2OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/622169?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/irlabs",
"html_url": "https://github.com/irlabs",
"followers_url": "https://api.github.com/users/irlabs/follow... | [] | closed | false | null | [] | null | [
"You're right. You may need to, in the meantime, run something like `db.execute_sql('set search_path to my_schema')` until I can get a fix.",
"Did you try the above suggestion, by chance?",
"> Did you try the above suggestion, by chance?\r\n\r\nNo, I used the psql command line instead.",
"Probably related, bu... | 2017-09-21T14:44:19 | 2018-02-09T15:50:33 | 2018-02-09T15:50:33 | NONE | null | I'm trying to use `playhouse.migrate` to modify the database according to the model changes, but it seems I cannot specify the PostgreSQL schema of the table that I need to alter.
My model looks like this:
```python
db = PostgresqlDatabase(...)
class MyTable(Model):
title = CharField()
class Meta:
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1353/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1353/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1352 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1352/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1352/comments | https://api.github.com/repos/coleifer/peewee/issues/1352/events | https://github.com/coleifer/peewee/pull/1352 | 258,875,037 | MDExOlB1bGxSZXF1ZXN0MTQxODkwMDY3 | 1,352 | Allow releasing of stale connections back to pool. | {
"login": "sebastienvercammen",
"id": 4874269,
"node_id": "MDQ6VXNlcjQ4NzQyNjk=",
"avatar_url": "https://avatars.githubusercontent.com/u/4874269?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sebastienvercammen",
"html_url": "https://github.com/sebastienvercammen",
"followers_url": "http... | [] | closed | false | null | [] | null | [
"I'm not sure how a connection would still be busy, since peewee will block until the query is finished. Furthermore, connections aren't returned to the pool until you call `close()` on them.\r\n\r\nIf you don't wish for connections to be marked stale, you can also modify the `stale_timeout` parameter (which, by de... | 2017-09-19T16:00:01 | 2017-09-19T20:16:27 | 2017-09-19T20:16:18 | NONE | null | Fine-grained control over the connection pool in non-web contexts can become more frustrating with the lightweight implementation because it's not implemented in peewee's core (e.g. after finishing a query, the connection isn't auto-released back to the pool), and in some structures context managers or decorators aren'... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1352/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1352/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1352",
"html_url": "https://github.com/coleifer/peewee/pull/1352",
"diff_url": "https://github.com/coleifer/peewee/pull/1352.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1352.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1351 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1351/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1351/comments | https://api.github.com/repos/coleifer/peewee/issues/1351/events | https://github.com/coleifer/peewee/issues/1351 | 258,003,252 | MDU6SXNzdWUyNTgwMDMyNTI= | 1,351 | order_by didn't work | {
"login": "EverCurse",
"id": 12572050,
"node_id": "MDQ6VXNlcjEyNTcyMDUw",
"avatar_url": "https://avatars.githubusercontent.com/u/12572050?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/EverCurse",
"html_url": "https://github.com/EverCurse",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"it is my fault ,my code logic is error , thanks for peewee"
] | 2017-09-15T11:00:42 | 2017-09-15T11:09:43 | 2017-09-15T11:09:43 | NONE | null | when i use peewee to order my result like this:
`us = Users.select().order_by(Users.id.desc())`
i find desc didn't work, so i use
`us = Users.select().order_by(Users.id.asc())`
the result is same as desc , so why desc didn;t work?
thanks | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1351/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1351/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1350 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1350/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1350/comments | https://api.github.com/repos/coleifer/peewee/issues/1350/events | https://github.com/coleifer/peewee/issues/1350 | 257,961,248 | MDU6SXNzdWUyNTc5NjEyNDg= | 1,350 | How to force not to get primary key on insert action | {
"login": "soyking",
"id": 3882738,
"node_id": "MDQ6VXNlcjM4ODI3Mzg=",
"avatar_url": "https://avatars.githubusercontent.com/u/3882738?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/soyking",
"html_url": "https://github.com/soyking",
"followers_url": "https://api.github.com/users/soyking/... | [] | closed | false | null | [] | null | [
"So...you bring up a good point. In peewee 2.x it's not really possible using the existing APIs.\r\n\r\nIn the 3.x branch, you can now write:\r\n\r\n```python\r\nSomeModel.insert({SomeModel.field: 'value'}).returning(None)\r\n```",
"@coleifer \r\n\r\nThanks for your response. It helps a lot.\r\n\r\nps. Is there a... | 2017-09-15T08:16:52 | 2017-09-21T16:18:58 | 2017-09-21T16:18:58 | NONE | null | I use peewee as PostgreSQL orm. As I saw on [InsertQuery.execute](https://github.com/coleifer/peewee/blob/81091b87c8c4b4d3dc65fc63b985629cd70dfd3a/peewee.py#L3584), when `is_insert_returning` is set, peewee will use `RETURNING` to get primary key. Otherwise it will call `last_insert_id` which is implemented by `SELECT ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1350/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1350/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1349 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1349/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1349/comments | https://api.github.com/repos/coleifer/peewee/issues/1349/events | https://github.com/coleifer/peewee/issues/1349 | 257,688,613 | MDU6SXNzdWUyNTc2ODg2MTM= | 1,349 | Unnecessary parentheses in the produced SQL | {
"login": "tuukkamustonen",
"id": 94327,
"node_id": "MDQ6VXNlcjk0MzI3",
"avatar_url": "https://avatars.githubusercontent.com/u/94327?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tuukkamustonen",
"html_url": "https://github.com/tuukkamustonen",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [
"The parentheses are semantically correct, though to a human they look extraneous. It's completely acceptable."
] | 2017-09-14T11:40:08 | 2017-09-14T13:42:52 | 2017-09-14T13:42:52 | NONE | null | ```python
Foo.select().where((Foo.id == 1) | (Foo.id == 2) | (Foo.id == 3) | (Foo.id == 4))
```
Produces SQL like:
```sql
... WHERE ((((\"t1\".\"id\" = 1) OR (\"t1\".\"id\" = 2)) OR (\"t1\".\"id\" = 3)) OR (\"t1\".\"id\" = 4)) ...
```
And so on. I don't know if the extra parentheses have impact on performa... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1349/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1349/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1348 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1348/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1348/comments | https://api.github.com/repos/coleifer/peewee/issues/1348/events | https://github.com/coleifer/peewee/issues/1348 | 257,030,814 | MDU6SXNzdWUyNTcwMzA4MTQ= | 1,348 | Delete() based on a dictionary instead of an Expression. | {
"login": "thxv3n0lvl",
"id": 1503456,
"node_id": "MDQ6VXNlcjE1MDM0NTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1503456?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/thxv3n0lvl",
"html_url": "https://github.com/thxv3n0lvl",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"You can use:\r\n\r\n```python\r\nAdNetworkModel.delete().filter(**table_fields).execute()\r\n```\r\n\r\nIf you're working on serving advertisements, though, I probably shouldn't help you :)",
"Thanks sir !"
] | 2017-09-12T12:48:17 | 2017-09-12T15:13:34 | 2017-09-12T14:45:28 | NONE | null | I have this dictionary
`table_fields = {'entity_id': 9998777}`
I can pass it to my own implementation of **get_or_create** by doing something like:
```
def get_or_create(table_fields):
try:
return AdNetworkModel.get(**table_fields).id
except AdNetworkModel.DoesNotExist:... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1348/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1348/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1347 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1347/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1347/comments | https://api.github.com/repos/coleifer/peewee/issues/1347/events | https://github.com/coleifer/peewee/pull/1347 | 256,150,927 | MDExOlB1bGxSZXF1ZXN0MTM5OTYyMTMy | 1,347 | Don't mark the column 'dirty' if there is no data change. | {
"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 | [
"The tests have exploded.",
"need more work on this one..."
] | 2017-09-08T06:14:35 | 2017-10-27T09:10:04 | 2017-10-27T09:10:04 | NONE | null | In order to reduce DB updates the columns should be marked if there was actually any data change... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1347/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1347/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1347",
"html_url": "https://github.com/coleifer/peewee/pull/1347",
"diff_url": "https://github.com/coleifer/peewee/pull/1347.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1347.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1346 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1346/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1346/comments | https://api.github.com/repos/coleifer/peewee/issues/1346/events | https://github.com/coleifer/peewee/issues/1346 | 255,062,064 | MDU6SXNzdWUyNTUwNjIwNjQ= | 1,346 | Inserting a list of IntEnum members into ArrayField(IntegerField) fails | {
"login": "DragoonAethis",
"id": 1546665,
"node_id": "MDQ6VXNlcjE1NDY2NjU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1546665?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/DragoonAethis",
"html_url": "https://github.com/DragoonAethis",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"peewee is handing the `IntEnum` members directly to psycopg2, so my sense is that the issue lies there. An alternative would be to subclass ArrayField and override the `db_value()` method, coercing each list item into an `int()`."
] | 2017-09-04T14:44:35 | 2017-09-14T21:04:24 | 2017-09-14T21:04:24 | NONE | null | Trying to use IntEnum members as values in `playhouse.postgres_ext.ArrayField(IntegerField)` will fail, since peewee wants to insert names of those values (for instance `"SomeEnum.example"`) instead of the actual values (eg. `1`).
On PostgreSQL 9.6.4, peewee 2.10.1 and Python 3.6.2, this code:
```python
from enu... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1346/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1346/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1345 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1345/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1345/comments | https://api.github.com/repos/coleifer/peewee/issues/1345/events | https://github.com/coleifer/peewee/issues/1345 | 254,530,451 | MDU6SXNzdWUyNTQ1MzA0NTE= | 1,345 | add truncate_table to doc | {
"login": "toshitanian",
"id": 1647045,
"node_id": "MDQ6VXNlcjE2NDcwNDU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1647045?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/toshitanian",
"html_url": "https://github.com/toshitanian",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"That's true -- I will look at adding similar functionality to the 3.0a branch and will document it there, as Peewee will be moving to the 3.0 branch soon.",
"Well, actually, I think I'm going to omit it from the 3.x branch for now, so will leave as-is. But thank you for letting me know."
] | 2017-09-01T04:02:07 | 2019-04-12T22:20:52 | 2017-09-08T15:53:03 | NONE | null | truncate_table is implemented on peewee, but not in doc. i hope it is written in doc.
https://github.com/coleifer/peewee/pull/862/files
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1345/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1345/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1344 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1344/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1344/comments | https://api.github.com/repos/coleifer/peewee/issues/1344/events | https://github.com/coleifer/peewee/issues/1344 | 253,803,728 | MDU6SXNzdWUyNTM4MDM3Mjg= | 1,344 | pwiz creates incorrect code for composite foreign keys | {
"login": "fredrikchabot",
"id": 4558741,
"node_id": "MDQ6VXNlcjQ1NTg3NDE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4558741?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/fredrikchabot",
"html_url": "https://github.com/fredrikchabot",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"Peewee does not support foreign keys to composite primary keys using any defined APIs.",
"Edited issue to add syntax highlighting and proper formatting."
] | 2017-08-29T21:04:01 | 2017-09-14T20:55:30 | 2017-09-14T20:55:30 | NONE | null | Given this (PostgreSQL):
```sql
CREATE TABLE tablea (
keyparta character varying(4) NOT NULL,
keypartb integer NOT NULL,
whatever character varying(20)
);
CREATE TABLE tableb (
keyparta character varying(4) NOT NULL,
keypartb integer NOT NULL,
keypartc character varying(16) NOT NULL,... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1344/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1344/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1343 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1343/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1343/comments | https://api.github.com/repos/coleifer/peewee/issues/1343/events | https://github.com/coleifer/peewee/issues/1343 | 253,769,968 | MDU6SXNzdWUyNTM3Njk5Njg= | 1,343 | peewee, flask and python3.6 | {
"login": "noxizcm",
"id": 15570550,
"node_id": "MDQ6VXNlcjE1NTcwNTUw",
"avatar_url": "https://avatars.githubusercontent.com/u/15570550?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/noxizcm",
"html_url": "https://github.com/noxizcm",
"followers_url": "https://api.github.com/users/noxizc... | [] | closed | false | null | [] | null | [
"You need the standard library sqlite3 installed at the very least.",
"Is there a way to avoid using sqlite3 all together?\r\nOr is sqlite3 a peer dependency of peewee?\r\n\r\nI'm encountering the same error on AWS Lambda. In my `models.py` I have the following defined:\r\n\r\n```\r\nfrom peewee import *\r\nfrom ... | 2017-08-29T19:04:13 | 2017-10-08T16:22:54 | 2017-09-08T20:39:58 | NONE | null | `sqlite3_lib_version = sqlite3.sqlite_version_info
AttributeError: 'NoneType' object has no attribute 'sqlite_version_info'`
from playhouse/berkeleydb.py
how to fix it? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1343/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1343/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1342 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1342/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1342/comments | https://api.github.com/repos/coleifer/peewee/issues/1342/events | https://github.com/coleifer/peewee/pull/1342 | 253,127,143 | MDExOlB1bGxSZXF1ZXN0MTM3ODE0MjI2 | 1,342 | Add --ssl option to pwiz | {
"login": "mgalvey",
"id": 476468,
"node_id": "MDQ6VXNlcjQ3NjQ2OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/476468?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mgalvey",
"html_url": "https://github.com/mgalvey",
"followers_url": "https://api.github.com/users/mgalvey/fo... | [] | closed | false | null | [] | null | [
"Going to pass on this, but thank you.",
"Is there anything that would make this or a feature like it suitable for inclusion in pwiz, or is this use case just something you're not interested in supporting?",
"In 5...6 years you're the only person who's requested it :)",
"@coleifer I guess I should say that we... | 2017-08-26T22:30:40 | 2019-06-18T09:20:10 | 2017-09-08T20:55:56 | NONE | null | Refs #1336
Tested locally with both supported mysql drivers and didn't run into any problems. DID NOT test that psycopg tries SSL by default, but the docs for the client library that psycopg uses say that it does: https://www.postgresql.org/docs/9.1/static/libpq-ssl.html. From that page:
> The default value for ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1342/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1342/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1342",
"html_url": "https://github.com/coleifer/peewee/pull/1342",
"diff_url": "https://github.com/coleifer/peewee/pull/1342.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1342.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1341 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1341/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1341/comments | https://api.github.com/repos/coleifer/peewee/issues/1341/events | https://github.com/coleifer/peewee/issues/1341 | 253,093,921 | MDU6SXNzdWUyNTMwOTM5MjE= | 1,341 | Filtering by TimestampField in Postgres | {
"login": "Alexeyisme",
"id": 20242028,
"node_id": "MDQ6VXNlcjIwMjQyMDI4",
"avatar_url": "https://avatars.githubusercontent.com/u/20242028?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Alexeyisme",
"html_url": "https://github.com/Alexeyisme",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"Solved. [Docs](http://docs.peewee-orm.com/en/latest/peewee/api.html?highlight=trunc#Database.truncate_date).\r\n```\r\ntoday_events = events.select().where(fn.date_trunc('day', fed_events.created_at) == datetime.date.today())\r\n```"
] | 2017-08-26T13:48:25 | 2017-08-26T14:17:15 | 2017-08-26T14:17:14 | NONE | null | Hello!
I'm trying to filter queryset I got from remote Postgres DB by TimestampField, and can't find out the timestamp format to cast.
I tried:
`today_events = events.select().where(fed_events.created_at > '2017-08-25 00:00:00')`
`today_events = events.filter(fed_events.created_at > '2017-08-25 00:00:00')`
`toda... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1341/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1341/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1340 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1340/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1340/comments | https://api.github.com/repos/coleifer/peewee/issues/1340/events | https://github.com/coleifer/peewee/pull/1340 | 253,071,133 | MDExOlB1bGxSZXF1ZXN0MTM3Nzg5MjAz | 1,340 | Use LooseVersion for version comparisons. | {
"login": "robertwb",
"id": 486017,
"node_id": "MDQ6VXNlcjQ4NjAxNw==",
"avatar_url": "https://avatars.githubusercontent.com/u/486017?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/robertwb",
"html_url": "https://github.com/robertwb",
"followers_url": "https://api.github.com/users/robertw... | [] | closed | false | null | [] | null | [] | 2017-08-26T07:29:53 | 2017-09-08T20:52:22 | 2017-09-08T20:52:22 | CONTRIBUTOR | null | StrictVersion doesn't understand https://www.python.org/dev/peps/pep-0440/ , in particular release candidate numbers. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1340/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1340/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1340",
"html_url": "https://github.com/coleifer/peewee/pull/1340",
"diff_url": "https://github.com/coleifer/peewee/pull/1340.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1340.patch",
"merged_at": "2017-09-08T20:52:22"
} |
https://api.github.com/repos/coleifer/peewee/issues/1339 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1339/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1339/comments | https://api.github.com/repos/coleifer/peewee/issues/1339/events | https://github.com/coleifer/peewee/issues/1339 | 252,832,459 | MDU6SXNzdWUyNTI4MzI0NTk= | 1,339 | full text postgres search crashes with more than one word | {
"login": "wilsonrocks",
"id": 25229549,
"node_id": "MDQ6VXNlcjI1MjI5NTQ5",
"avatar_url": "https://avatars.githubusercontent.com/u/25229549?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wilsonrocks",
"html_url": "https://github.com/wilsonrocks",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"Peewee probably won't ever handle escaping search queries -- that should probably be done by the application as the needs may vary from app to app."
] | 2017-08-25T08:32:35 | 2017-09-08T20:40:37 | 2017-09-08T20:40:37 | NONE | null | This seems to be a postgres thing. I wrote some code to convert "multiple search terms! with punctuation." to "multiple & search & terms & with & punctuation" which doesn't crash it. Would this be useful in peewee, perhaps in the Match function? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1339/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1339/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1338 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1338/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1338/comments | https://api.github.com/repos/coleifer/peewee/issues/1338/events | https://github.com/coleifer/peewee/issues/1338 | 252,541,394 | MDU6SXNzdWUyNTI1NDEzOTQ= | 1,338 | Shouldn't ensure_join unfold aliases? | {
"login": "insolite",
"id": 1101526,
"node_id": "MDQ6VXNlcjExMDE1MjY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1101526?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/insolite",
"html_url": "https://github.com/insolite",
"followers_url": "https://api.github.com/users/insol... | [] | closed | false | null | [] | null | [
"Just realized that `filter` is actually deprecated, so I guess there no plans for it. Anyway `ensure_join` is also used inside `SelectQuery.annotate` so maybe it still makes sense.",
"Hi, interesting I hadn't thought about this issue. You're correct as far as filter being deprecated, but it's still probably wort... | 2017-08-24T09:29:38 | 2017-08-25T04:02:25 | 2017-08-25T04:01:41 | NONE | null | ```python
class Author(peewee.Model):
name = peewee.CharField()
class Book(peewee.Model):
name = peewee.CharField()
author = peewee.ForeignKeyField(Author)
query = (Book
.select(Book.name)
.join(Author.alias(), peewee.JOIN_LEFT_OUTER)
.filter(author__name='someone'))
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1338/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1338/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1337 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1337/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1337/comments | https://api.github.com/repos/coleifer/peewee/issues/1337/events | https://github.com/coleifer/peewee/issues/1337 | 252,091,830 | MDU6SXNzdWUyNTIwOTE4MzA= | 1,337 | Nested Join | {
"login": "juntatalor",
"id": 8134632,
"node_id": "MDQ6VXNlcjgxMzQ2MzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/8134632?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/juntatalor",
"html_url": "https://github.com/juntatalor",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"What?! This is some next-level shit!\r\n\r\nCan you explain what, semantically, you're doing in the above query? Like...use tables with familiar names/concepts, e.g.\r\n\r\n```sql\r\nSELECT *\r\nFROM users AS t1\r\nLEFT OUTER JOIN notes AS t2\r\nINNER JOIN note_tags AS t3\r\n ON (t2.id = t3.note_id) ON (t1.id =... | 2017-08-22T21:15:37 | 2017-08-24T22:34:46 | 2017-08-24T22:34:46 | NONE | null | Cannot find a way to do nested join, like:
SELECT *
FROM t1
LEFT OUTER JOIN t2
INNER JOIN t3 ON (t2.x_id = t3.id)
ON (t1.y_id = t2.id)
This query is much faster than two left joins for my particular task (PostgreSQL). Subquery looks ugly. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1337/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1337/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1336 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1336/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1336/comments | https://api.github.com/repos/coleifer/peewee/issues/1336/events | https://github.com/coleifer/peewee/issues/1336 | 252,034,289 | MDU6SXNzdWUyNTIwMzQyODk= | 1,336 | Suport SSL connections | {
"login": "mgalvey",
"id": 476468,
"node_id": "MDQ6VXNlcjQ3NjQ2OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/476468?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mgalvey",
"html_url": "https://github.com/mgalvey",
"followers_url": "https://api.github.com/users/mgalvey/fo... | [] | closed | false | null | [] | null | [
"Peewee operates at a higher-level than the database drivers, so any SSL support would need to be implemented at the `pymysql`/`psycopg2` layer instead of Peewee.",
"It is implemented in PyMySQL (http://pymysql.readthedocs.io/en/latest/modules/connections.html?highlight=ssl), but I'm not sure how I would make use... | 2017-08-22T17:36:44 | 2019-06-20T01:56:50 | 2017-08-22T22:15:10 | NONE | null | At present, it appears that peewee / pwiz has no support for connecting to MySQL or Postgres using SSL. Such a feature would be useful in environments where the database is configured to only allow encrypted connections.
I'm not as familiar with Postgres, but I know that at least two modes should be available for My... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1336/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1336/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1335 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1335/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1335/comments | https://api.github.com/repos/coleifer/peewee/issues/1335/events | https://github.com/coleifer/peewee/issues/1335 | 251,935,888 | MDU6SXNzdWUyNTE5MzU4ODg= | 1,335 | primary_key=False is not inheritable | {
"login": "maaaks",
"id": 3010238,
"node_id": "MDQ6VXNlcjMwMTAyMzg=",
"avatar_url": "https://avatars.githubusercontent.com/u/3010238?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/maaaks",
"html_url": "https://github.com/maaaks",
"followers_url": "https://api.github.com/users/maaaks/foll... | [] | closed | false | null | [] | null | [
"This is working correctly in 3.0a -- I'm not inclined to change it in the 2.x branch, despite the documentation being somewhat confusing.\r\n\r\n023037adf3d87127969c71bc95e6e6e070590873"
] | 2017-08-22T12:13:03 | 2017-08-24T00:21:28 | 2017-08-24T00:21:28 | CONTRIBUTOR | null | [This table](http://docs.peewee-orm.com/en/latest/peewee/models.html#model-options-and-table-metadata) says that `primary_key` is an inheritable meta field. But it doesn't seem so, at least not when I set `primary_key=False` on a parent model and expect a child class to get the same.
If it's a bug, I think it should... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1335/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1335/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1334 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1334/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1334/comments | https://api.github.com/repos/coleifer/peewee/issues/1334/events | https://github.com/coleifer/peewee/issues/1334 | 251,817,819 | MDU6SXNzdWUyNTE4MTc4MTk= | 1,334 | How much efficiency has been raised? | {
"login": "yanghg-basefx",
"id": 29534214,
"node_id": "MDQ6VXNlcjI5NTM0MjE0",
"avatar_url": "https://avatars.githubusercontent.com/u/29534214?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yanghg-basefx",
"html_url": "https://github.com/yanghg-basefx",
"followers_url": "https://api.githu... | [] | closed | false | null | [] | null | [
"So, the peewee 2.x speedups module should help noticeably with:\r\n\r\n* Iterating over large result sets for simple selects (no joins) or when the return row type is `dict` or `tuple` (`.dicts()` or `.tuples()`).\r\n* Resolving dependencies among a large number of models.\r\n\r\nIt's a pretty narrow range, and ho... | 2017-08-22T02:09:49 | 2017-08-22T04:11:17 | 2017-08-22T02:57:47 | NONE | null | I compiled _speedups.pyx at centos7, then try to fetch a whole table from MySQL database. I'm sure the speedups module was imported successfully, but it spent the same time as normal module. Does it work? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1334/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1334/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1333 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1333/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1333/comments | https://api.github.com/repos/coleifer/peewee/issues/1333/events | https://github.com/coleifer/peewee/issues/1333 | 251,420,977 | MDU6SXNzdWUyNTE0MjA5Nzc= | 1,333 | How to integrate peewee and Flask-login | {
"login": "noxizcm",
"id": 15570550,
"node_id": "MDQ6VXNlcjE1NTcwNTUw",
"avatar_url": "https://avatars.githubusercontent.com/u/15570550?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/noxizcm",
"html_url": "https://github.com/noxizcm",
"followers_url": "https://api.github.com/users/noxizc... | [] | closed | false | null | [] | null | [
"I think you have to read that https://flask-login.readthedocs.io/en/latest/#flask_login.LoginManager.user_loader\r\nAnd implement methods in your User-model that were discussed flask-login.",
"Sorry, please direct this question to a more appropriate forum."
] | 2017-08-19T12:09:11 | 2017-08-22T03:52:33 | 2017-08-22T03:52:32 | NONE | null | D!
i am trying to use peewee and flask-login but wen create and user loader i have this error
` @login_manager.user_loader()
TypeError: user_loader() missing 1 required positional argument: 'callback'`
i knew that peewee have get_id() method but how to use it? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1333/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1333/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1332 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1332/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1332/comments | https://api.github.com/repos/coleifer/peewee/issues/1332/events | https://github.com/coleifer/peewee/issues/1332 | 251,320,576 | MDU6SXNzdWUyNTEzMjA1NzY= | 1,332 | Is it possible to get a count of a grouped field? | {
"login": "iancullinane",
"id": 3598675,
"node_id": "MDQ6VXNlcjM1OTg2NzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/3598675?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/iancullinane",
"html_url": "https://github.com/iancullinane",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"Well, you need to group by both title and field if you're selecting both (unless you use mysql, which allows shenanigans like this).\r\n\r\nIf you have a lot of people, this prints out the surnames and the count associated with each, e.g.:\r\n\r\n```python\r\nquery = Person.select(Person.last_name, fn.COUNT(Person... | 2017-08-18T18:14:31 | 2017-08-18T19:05:06 | 2017-08-18T19:05:06 | NONE | null | I have the following MySQL query:
`select Title, Field, count(*) as 'count' from model group by Title;`
Which returns:
`{ Title: 'Something', Field: 'Something Else', count: '5' } `
Where count is the number of occurrences of Title. I have been banging my head figuring out how to get this through peewee wit... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1332/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1332/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1331 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1331/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1331/comments | https://api.github.com/repos/coleifer/peewee/issues/1331/events | https://github.com/coleifer/peewee/issues/1331 | 250,761,425 | MDU6SXNzdWUyNTA3NjE0MjU= | 1,331 | Why use exec? | {
"login": "thomwiggers",
"id": 974662,
"node_id": "MDQ6VXNlcjk3NDY2Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/974662?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/thomwiggers",
"html_url": "https://github.com/thomwiggers",
"followers_url": "https://api.github.com/user... | [] | closed | false | null | [] | null | [
"because on python 3 `raise tp, value, tb` will raise `SyntaxError`, use `exec` to skip syntax check.",
"Ah, TIL. Thanks"
] | 2017-08-16T21:11:25 | 2017-08-17T09:29:15 | 2017-08-17T09:29:15 | NONE | null | On this line you're using `exec` to define `reraise`. I don't understand why you just don't use `def` directly. Would you mind clearing this up for me?
https://github.com/coleifer/peewee/blob/7beab7c60ca32477fb812eb768adc4ac458e5a57/peewee.py#L144 | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1331/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1331/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1330 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1330/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1330/comments | https://api.github.com/repos/coleifer/peewee/issues/1330/events | https://github.com/coleifer/peewee/issues/1330 | 250,695,285 | MDU6SXNzdWUyNTA2OTUyODU= | 1,330 | Database.is_closed() returns incorrect value sometimes | {
"login": "skewty",
"id": 9087223,
"node_id": "MDQ6VXNlcjkwODcyMjM=",
"avatar_url": "https://avatars.githubusercontent.com/u/9087223?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/skewty",
"html_url": "https://github.com/skewty",
"followers_url": "https://api.github.com/users/skewty/foll... | [] | closed | false | null | [] | null | [
"How would moving that outside the block change things?",
"if I am understanding the code correctly:\r\n\r\nCurrently if the call to `self._close(self._local.conn)` raises an Exception then `with self.exception_wrapper` will `__exit__` and `self._local.closed = True` will never be called.\r\n\r\nBy moving `self._... | 2017-08-16T17:02:23 | 2017-08-17T21:27:07 | 2017-08-17T21:27:07 | NONE | null | I sometimes get this: `psycopg2.InterfaceError: connection already closed` and can't seem to track it down. But I was able to determine that Database.is_closed() returns an incorrect value sometimes.
I looked in peewee.py at the close() method of the Database class and would like to propose a small improvement:
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1330/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1330/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1329 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1329/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1329/comments | https://api.github.com/repos/coleifer/peewee/issues/1329/events | https://github.com/coleifer/peewee/issues/1329 | 250,576,641 | MDU6SXNzdWUyNTA1NzY2NDE= | 1,329 | model_to_dict not working with generic foreign keys | {
"login": "hishamkaram",
"id": 24391550,
"node_id": "MDQ6VXNlcjI0MzkxNTUw",
"avatar_url": "https://avatars.githubusercontent.com/u/24391550?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hishamkaram",
"html_url": "https://github.com/hishamkaram",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"The `model_to_dict` accepts a parameter `extra_attrs` which you can use to do the lookup on the GFK object."
] | 2017-08-16T10:13:26 | 2017-08-16T20:39:01 | 2017-08-16T20:39:01 | NONE | null | I am trying to include tags in object dict to convert this data to json then use this data in api how can i achieve that?(if models_to_dict can include tags in dict)
select query:
`queryset = model.select()`
Tag Model:
```
class Tag(BaseDateTime):
tag = CharField()
object_type = CharField(null=True)... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1329/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1329/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1328 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1328/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1328/comments | https://api.github.com/repos/coleifer/peewee/issues/1328/events | https://github.com/coleifer/peewee/issues/1328 | 250,115,979 | MDU6SXNzdWUyNTAxMTU5Nzk= | 1,328 | 3.0a | {
"login": "ra-esmith",
"id": 24212262,
"node_id": "MDQ6VXNlcjI0MjEyMjYy",
"avatar_url": "https://avatars.githubusercontent.com/u/24212262?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ra-esmith",
"html_url": "https://github.com/ra-esmith",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Ahhh yeah, the new codebase is not compatible with wtfpeewee or flask-peewee at the moment.",
"Hello,\n\nCool. When it is I will try an upgrade again.\n\nThanks!!! Super that you are doing this\n\nLater,\nEvan\n\nCharles Leifer wrote:\n>\n> Ahhh yeah, the new codebase is not compatible with wtfpeewee or \n> fla... | 2017-08-14T18:36:54 | 2018-01-30T15:54:52 | 2017-10-02T20:38:55 | NONE | null | Hello,
Exciting to see an upgrade path. I thought I would try it out.
I removed the 2.10 version of peewee and installed 3.0a
Note, my app runs fine with 2.10.1, and I understand I may need to change some stuff to get to 3.0a.
Just thought I would start the process. Thanks for the great product!
pip uninst... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1328/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1328/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1327 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1327/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1327/comments | https://api.github.com/repos/coleifer/peewee/issues/1327/events | https://github.com/coleifer/peewee/issues/1327 | 249,796,454 | MDU6SXNzdWUyNDk3OTY0NTQ= | 1,327 | insert many and ids | {
"login": "ak4nv",
"id": 73960,
"node_id": "MDQ6VXNlcjczOTYw",
"avatar_url": "https://avatars.githubusercontent.com/u/73960?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ak4nv",
"html_url": "https://github.com/ak4nv",
"followers_url": "https://api.github.com/users/ak4nv/followers",
"f... | [] | closed | false | null | [] | null | [
"Currently if you are using Postgresql you can write:\r\n\r\n```python\r\nquery = User.insert_many([{...}, {...}, {...}]).return_id_list()\r\nids_inserted = query.execute()\r\n```\r\n\r\nIt's admittedly a weird API and not very flexible. In 3.0a it is the default to return the id list when the database supports the... | 2017-08-12T07:57:42 | 2017-08-13T23:47:40 | 2017-08-13T23:47:39 | NONE | null | Hi!
Is it possible to insert many records and get them id list?
Or maybe id of the last inserted. Or get the next identity value?
In one transaction. In postgresql.
Would be awesome! | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1327/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1327/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1326 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1326/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1326/comments | https://api.github.com/repos/coleifer/peewee/issues/1326/events | https://github.com/coleifer/peewee/issues/1326 | 249,771,387 | MDU6SXNzdWUyNDk3NzEzODc= | 1,326 | Potential mistake in docs regarding operator parameter in CompoundSelect | {
"login": "aniketpanjwani",
"id": 16311215,
"node_id": "MDQ6VXNlcjE2MzExMjE1",
"avatar_url": "https://avatars.githubusercontent.com/u/16311215?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aniketpanjwani",
"html_url": "https://github.com/aniketpanjwani",
"followers_url": "https://api.gi... | [] | closed | false | null | [] | null | [
"Wow, no the docs are definitely wrong. I'll update them, thanks."
] | 2017-08-11T23:38:07 | 2017-08-13T23:47:49 | 2017-08-13T23:47:49 | NONE | null | I'm using peewee 2.9.1 with Python 3.5.2 on Linux Mint 18 to access a PostgreSQL 9.6.2 database hosted on AWS RDS.
The [documentation for CompoundSelect](http://docs.peewee-orm.com/en/latest/peewee/api.html#CompoundSelect) states that one should use a Node instance for the operator parameter in a compound query. I t... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1326/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1326/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1325 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1325/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1325/comments | https://api.github.com/repos/coleifer/peewee/issues/1325/events | https://github.com/coleifer/peewee/issues/1325 | 249,037,057 | MDU6SXNzdWUyNDkwMzcwNTc= | 1,325 | execute_sql, unexpected result | {
"login": "pepelisu",
"id": 4609725,
"node_id": "MDQ6VXNlcjQ2MDk3MjU=",
"avatar_url": "https://avatars.githubusercontent.com/u/4609725?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pepelisu",
"html_url": "https://github.com/pepelisu",
"followers_url": "https://api.github.com/users/pepel... | [] | closed | false | null | [] | null | [
"There must be a problem with the query as written. Peewee doesn't do anything to SQL queries passed directly to execute_sql() -- they are passed to the driver, which then executes them. I'd suggest working on the query in the database shell until you get the desired results.",
"You are right, I will keep working... | 2017-08-09T13:49:26 | 2017-08-09T15:17:19 | 2017-08-09T14:59:25 | NONE | null | Hi,
While I was trying to perform a cleaning operation in a database, specifically removing the duplicates in a SQLite database.
Using a piece of code similar to this:
```python
db.execute_sql("DELETE FROM tableName WHERE rowid NOT IN (SELECT MIN(rowid) FROM tableName GROUP BY 'column1','column2','column3')")
```... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1325/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1325/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1324 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1324/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1324/comments | https://api.github.com/repos/coleifer/peewee/issues/1324/events | https://github.com/coleifer/peewee/pull/1324 | 247,430,421 | MDExOlB1bGxSZXF1ZXN0MTMzNzM5Njc1 | 1,324 | fix postgresql use DictCursor save bug | {
"login": "mkxxq",
"id": 6285845,
"node_id": "MDQ6VXNlcjYyODU4NDU=",
"avatar_url": "https://avatars.githubusercontent.com/u/6285845?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mkxxq",
"html_url": "https://github.com/mkxxq",
"followers_url": "https://api.github.com/users/mkxxq/follower... | [] | closed | false | null | [] | null | [
"wtf is this garbage? I can't tell what you changed"
] | 2017-08-02T15:31:30 | 2018-01-31T12:38:22 | 2018-01-31T12:38:22 | NONE | null | Hi:
When peewee in postgresql and use DictCursor that one model with a not char pk use 'save' is error.
test_code is :
```
from psycopg2.extras import RealDictCursor
from peewee import *
test_psql_db = PostgresqlDatabase('peewee_test', host='127.0.0.1', port=5432,
user='postgres... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1324/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1324/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1324",
"html_url": "https://github.com/coleifer/peewee/pull/1324",
"diff_url": "https://github.com/coleifer/peewee/pull/1324.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1324.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1323 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1323/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1323/comments | https://api.github.com/repos/coleifer/peewee/issues/1323/events | https://github.com/coleifer/peewee/issues/1323 | 246,911,850 | MDU6SXNzdWUyNDY5MTE4NTA= | 1,323 | Error when I run:- run_example in the twitter app | {
"login": "Doctor-Foxling",
"id": 30374624,
"node_id": "MDQ6VXNlcjMwMzc0NjI0",
"avatar_url": "https://avatars.githubusercontent.com/u/30374624?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Doctor-Foxling",
"html_url": "https://github.com/Doctor-Foxling",
"followers_url": "https://api.gi... | [] | closed | false | null | [] | null | [
"Without you sharing the full traceback I have no way of helping you. Are you new to python?",
"Here's what I get. I should have shared the traceback yes, but I ran the code as it was without changing anything so I thought something might have gone wrong after one of the commits. Btw, is there a better way of sha... | 2017-07-31T23:18:33 | 2017-08-03T21:43:07 | 2017-08-03T00:00:28 | NONE | null | Hi,
I'm new to peewee and when I run the run_example in the example twitter app I get an error somewhere in the line 131 but can't seem to find what exactly. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1323/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1323/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1322 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1322/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1322/comments | https://api.github.com/repos/coleifer/peewee/issues/1322/events | https://github.com/coleifer/peewee/issues/1322 | 246,707,627 | MDU6SXNzdWUyNDY3MDc2Mjc= | 1,322 | Unwanted 'AS' when constructing HAVING clause | {
"login": "desile",
"id": 7103075,
"node_id": "MDQ6VXNlcjcxMDMwNzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/7103075?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/desile",
"html_url": "https://github.com/desile",
"followers_url": "https://api.github.com/users/desile/foll... | [] | closed | false | null | [] | null | [
"Problem here https://github.com/coleifer/peewee/blob/master/peewee.py#L1741\r\nMethod `_parse_expression` calling `parse_node` , which adds 'AS'\r\n```\r\n if node._alias:\r\n sql = ' '.join((sql, 'AS', node._alias))\r\n```\r\n\r\nWhat is the best way to correct it? Maybe using named argu... | 2017-07-31T10:09:46 | 2017-08-25T04:17:05 | 2017-08-25T04:17:05 | NONE | null | Hi!
When I use my peewee.Func object, which has _alias, in having(...), then Peewee adds keyword 'AS' in clause.
For example:
```
field = fn.Count(SystemUser.id).alias('roles_count')
query = query.having(field == 2)
```
Then I get syntax error:
> ...name" HAVING ((Count("t1"."id") AS roles_count...
I... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1322/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1322/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1321 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1321/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1321/comments | https://api.github.com/repos/coleifer/peewee/issues/1321/events | https://github.com/coleifer/peewee/issues/1321 | 246,454,856 | MDU6SXNzdWUyNDY0NTQ4NTY= | 1,321 | UpdateQuery FROM clause support | {
"login": "rammie",
"id": 554792,
"node_id": "MDQ6VXNlcjU1NDc5Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/554792?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rammie",
"html_url": "https://github.com/rammie",
"followers_url": "https://api.github.com/users/rammie/follow... | [] | closed | false | null | [] | null | [
"Doesn't seem worth the trouble. The subquery would likely be cached if it appears twice. Sorry for the noise.",
"Well, I think it should be added to Peewee. Currently I don't see any ways in Peewee to do what `UPDATE FROM` does — to update one table using a joined table not only in `WHERE` (which could really be... | 2017-07-28T20:44:47 | 2017-10-02T20:33:17 | 2017-10-02T20:33:17 | NONE | null | Turns out postgresql's Update statements support a FROM clause that is useful for doing bulk updates. I don't think this is standard SQL.
I looked through the documentation and couldn't find any examples of it. I perused the generate_update function in peewee and didn't see and SQL('FROM')'s in there so I assume tha... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1321/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1321/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1320 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1320/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1320/comments | https://api.github.com/repos/coleifer/peewee/issues/1320/events | https://github.com/coleifer/peewee/issues/1320 | 244,091,418 | MDU6SXNzdWUyNDQwOTE0MTg= | 1,320 | ForeignKeyField('self',…) not correctly inheriting? | {
"login": "phryk",
"id": 1021513,
"node_id": "MDQ6VXNlcjEwMjE1MTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/1021513?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/phryk",
"html_url": "https://github.com/phryk",
"followers_url": "https://api.github.com/users/phryk/follower... | [] | closed | false | null | [] | null | [
"Interesting... Out of curiosity I tested this on Django, and found it behaves the same as Peewee in this case.\r\n\r\nYou should be able to re-define the foreign key on the child table and I'm going to suggest that should be the proper resolution to this issue. Doing some kind of late-late-binding of the foreign k... | 2017-07-19T15:58:57 | 2017-07-20T13:59:45 | 2017-07-20T13:59:45 | NONE | null | When inheriting from a Model using `ForeignKeyField('self',…)`, the resulting table
references the (possibly inexistent) table of the Model originally defining the key.
I'm not sure whether this is intended behavior but intuitively, I expected the inherited models to also reference themselves, rather than some clas... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1320/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1320/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1319 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1319/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1319/comments | https://api.github.com/repos/coleifer/peewee/issues/1319/events | https://github.com/coleifer/peewee/issues/1319 | 243,017,478 | MDU6SXNzdWUyNDMwMTc0Nzg= | 1,319 | InternalError: (1054, u"Unknown column 't1.pk' in 'field list'") | {
"login": "guangbaowan",
"id": 25094780,
"node_id": "MDQ6VXNlcjI1MDk0Nzgw",
"avatar_url": "https://avatars.githubusercontent.com/u/25094780?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/guangbaowan",
"html_url": "https://github.com/guangbaowan",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"Can you share your definition of MySqlPrimaryKeyAutoIncrementField ? Also, it should be MyModel.select().first() (your ex has missing parentheses after select).",
"@coleifer \r\n.Oh . sorry .(MyModel.select.first(), here is the typo, in my code, I typed the right one )\r\n```\r\nclass MySqlPrimaryKeyAutoIncrem... | 2017-07-14T14:41:11 | 2017-07-14T16:38:19 | 2017-07-14T16:32:56 | NONE | null | Hi, here is my code. I used the connection pool and created the table, when use MyModel.select.first(), but returns 'InternalError: (1054, u"Unknown column 't1.pk' in 'field list'")', am I doing something wrong?
```
from playhouse.db_url import connect
mysql_db = connect('mysql+pool://root:root@127.0.0.1:3306/test?... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1319/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1319/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.