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/1218 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1218/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1218/comments | https://api.github.com/repos/coleifer/peewee/issues/1218/events | https://github.com/coleifer/peewee/issues/1218 | 213,563,274 | MDU6SXNzdWUyMTM1NjMyNzQ= | 1,218 | No sqlite3 causes issue on import of PaginatedQuery | {
"login": "savraj",
"id": 387613,
"node_id": "MDQ6VXNlcjM4NzYxMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/387613?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/savraj",
"html_url": "https://github.com/savraj",
"followers_url": "https://api.github.com/users/savraj/follow... | [] | closed | false | null | [] | null | [
"Aha, thanks! Should be fixed by f68ff7fb30a149fe9df8050b8001a1b4d3636bec",
"This fix didn't work -- the error still happens because an AttributeError is the problem, the fix catches an ImportError.\r\n\r\nIf you look at the file `sqlite_ext.py`, line 54 `from peewee import sqlite3`\r\nThen looking at lines 155-1... | 2017-03-11T22:13:43 | 2017-10-08T16:22:31 | 2017-03-16T03:16:57 | NONE | null | I use MySQL and don't need sqlite3.
`from playhouse.flask_utils import PaginatedQuery`
gives me this error:
```
FTS_VER = sqlite3.sqlite_version_info[:3] >= (3, 7, 4) and 'FTS4' or 'FTS3'
AttributeError: 'NoneType' object has no attribute 'sqlite_version_info'
```
[line that causes error](https://github.com/... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1218/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1218/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1217 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1217/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1217/comments | https://api.github.com/repos/coleifer/peewee/issues/1217/events | https://github.com/coleifer/peewee/issues/1217 | 213,455,933 | MDU6SXNzdWUyMTM0NTU5MzM= | 1,217 | ForeignKey circular suggestion | {
"login": "paulocheque",
"id": 94350,
"node_id": "MDQ6VXNlcjk0MzUw",
"avatar_url": "https://avatars.githubusercontent.com/u/94350?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/paulocheque",
"html_url": "https://github.com/paulocheque",
"followers_url": "https://api.github.com/users/paul... | [] | closed | false | null | [] | null | [] | 2017-03-10T21:25:06 | 2017-03-12T15:06:20 | 2017-03-12T15:06:20 | NONE | null | Hi there, suggestion:
http://docs.peewee-orm.com/en/latest/peewee/models.html?highlight=NameError#circular-foreign-key-dependencies
It could do like Django ORM: ForeignKey('path.to.Model') | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1217/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1217/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1216 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1216/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1216/comments | https://api.github.com/repos/coleifer/peewee/issues/1216/events | https://github.com/coleifer/peewee/issues/1216 | 213,244,462 | MDU6SXNzdWUyMTMyNDQ0NjI= | 1,216 | Test failure in 2.9.0 release | {
"login": "felixonmars",
"id": 1006477,
"node_id": "MDQ6VXNlcjEwMDY0Nzc=",
"avatar_url": "https://avatars.githubusercontent.com/u/1006477?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/felixonmars",
"html_url": "https://github.com/felixonmars",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Yeah, it's fixed."
] | 2017-03-10T04:56:32 | 2017-03-10T21:46:07 | 2017-03-10T21:46:07 | CONTRIBUTOR | null | ```
======================================================================
ERROR: test_create_or_get (playhouse.tests.test_gfk.GFKTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build/python-peewee/src/peewee/playhouse/tests/test_gfk.py",... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1216/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1216/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1215 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1215/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1215/comments | https://api.github.com/repos/coleifer/peewee/issues/1215/events | https://github.com/coleifer/peewee/pull/1215 | 213,135,959 | MDExOlB1bGxSZXF1ZXN0MTA5OTg0ODE1 | 1,215 | Add most recent Python versions in Travis CI | {
"login": "SylvainDe",
"id": 1242285,
"node_id": "MDQ6VXNlcjEyNDIyODU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1242285?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SylvainDe",
"html_url": "https://github.com/SylvainDe",
"followers_url": "https://api.github.com/users/Sy... | [] | closed | false | null | [] | null | [] | 2017-03-09T19:14:05 | 2017-03-23T18:10:59 | 2017-03-23T18:10:59 | NONE | null | Add more recent Python versions including development branches and nightly build.
The motivation came from reading brettcannon's article : https://snarky.ca/how-to-use-your-project-travis-to-help-test-python-itself/ . Trying to activate the newest Python versions on CI jobs is in most case a win-win situation: if ev... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1215/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1215/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1215",
"html_url": "https://github.com/coleifer/peewee/pull/1215",
"diff_url": "https://github.com/coleifer/peewee/pull/1215.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1215.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1214 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1214/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1214/comments | https://api.github.com/repos/coleifer/peewee/issues/1214/events | https://github.com/coleifer/peewee/issues/1214 | 212,901,212 | MDU6SXNzdWUyMTI5MDEyMTI= | 1,214 | Hack: Peewee Tables to Pandas DataFrames | {
"login": "NJDFan",
"id": 8527880,
"node_id": "MDQ6VXNlcjg1Mjc4ODA=",
"avatar_url": "https://avatars.githubusercontent.com/u/8527880?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/NJDFan",
"html_url": "https://github.com/NJDFan",
"followers_url": "https://api.github.com/users/NJDFan/foll... | [] | closed | false | null | [] | null | [
"There is a mechanism to inspect fields, MyModelClass._meta.fields. Check it out -- should be what you need."
] | 2017-03-09T00:37:27 | 2017-03-09T15:37:46 | 2017-03-09T15:37:46 | NONE | null | I find SQL tables excellent for experimental data collection (often multi-day processes) and godawful for examination/analysis. So, I figured out this trick and figured I'd send it to you in case anyone else out there finds it useful. Note: it would definitely be cleaner if there was a mechanism to introspect fields.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1214/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1214/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1213 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1213/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1213/comments | https://api.github.com/repos/coleifer/peewee/issues/1213/events | https://github.com/coleifer/peewee/issues/1213 | 212,876,833 | MDU6SXNzdWUyMTI4NzY4MzM= | 1,213 | Update cache without table name throws error | {
"login": "erichaydel",
"id": 6462853,
"node_id": "MDQ6VXNlcjY0NjI4NTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/6462853?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/erichaydel",
"html_url": "https://github.com/erichaydel",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [] | 2017-03-08T22:30:01 | 2017-03-18T22:04:38 | 2017-03-18T22:04:38 | NONE | null | In line 82 of dataset, https://github.com/coleifer/peewee/blob/master/playhouse/dataset.py#L82, table_names is calculated as a list inline.
However, if no table name is set (want to update all), dependencies is set to None a couple of lines earlier.
This will throw the error "NoneType is not iterable". | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1213/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1213/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1212 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1212/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1212/comments | https://api.github.com/repos/coleifer/peewee/issues/1212/events | https://github.com/coleifer/peewee/issues/1212 | 212,857,060 | MDU6SXNzdWUyMTI4NTcwNjA= | 1,212 | Changelog? | {
"login": "MinchinWeb",
"id": 1548809,
"node_id": "MDQ6VXNlcjE1NDg4MDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1548809?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MinchinWeb",
"html_url": "https://github.com/MinchinWeb",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"https://github.com/coleifer/peewee/blob/master/CHANGELOG.md",
"Thank you!!"
] | 2017-03-08T21:07:59 | 2017-03-09T21:10:31 | 2017-03-08T21:12:57 | NONE | null | I can't seem to find the changelog for Peewee. Can you point me to it?
If one doesn't exist yet, please let this serve as a humble request for one. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1212/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1212/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1211 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1211/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1211/comments | https://api.github.com/repos/coleifer/peewee/issues/1211/events | https://github.com/coleifer/peewee/issues/1211 | 212,814,276 | MDU6SXNzdWUyMTI4MTQyNzY= | 1,211 | playhouse.flask_utils.FlaskDB and testing | {
"login": "gkrnours",
"id": 61116,
"node_id": "MDQ6VXNlcjYxMTE2",
"avatar_url": "https://avatars.githubusercontent.com/u/61116?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gkrnours",
"html_url": "https://github.com/gkrnours",
"followers_url": "https://api.github.com/users/gkrnours/foll... | [] | closed | false | null | [] | null | [
"Welllll... based on your issue description, there's not really anything I can go off of besides that it didn't work for your tests. Can you provide me with something I can reproduce? Some code that exemplifies the issue? What \"not working\" actually means?",
"I wrote a small gist with a small flask app using Fl... | 2017-03-08T18:18:06 | 2017-04-08T13:22:36 | 2017-04-07T23:54:06 | NONE | null | I tried to write some test for a basic app using [playhouse.flask_utils.FlaskDB](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#database-wrapper) and sqlite but I couldn't manage to make it work with [flask.Flask.test_client](http://flask.pocoo.org/docs/0.12/api/#flask.Flask.test_client). This is a tool com... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1211/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1211/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1210 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1210/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1210/comments | https://api.github.com/repos/coleifer/peewee/issues/1210/events | https://github.com/coleifer/peewee/issues/1210 | 212,620,438 | MDU6SXNzdWUyMTI2MjA0Mzg= | 1,210 | PostgresqlExtDatabase last_insert_id w/ autocommit=True issues | {
"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 | [
"It looks like the `id` field is not unique. Since I don't have your model definition, I'm not sure how you've got `id` defined, but that seems to be the issue. If it's the primary key, it needs to be unique.\r\n\r\nThe reason the calls to save() don't work, I'm guessing, is because you're using a non-auto-incremen... | 2017-03-08T02:31:04 | 2017-03-08T19:05:57 | 2017-03-08T18:37:49 | NONE | null | I think I may be fighting the below two issues (possible regression?):
issue #353
issue #356
I just upgraded to peewee 2.90 to ensure it wasn't a regression in the build I was using.
If I use `Model.insert().execute()` for the first Filter
insert then the subsequent code will never work without exception.
I... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1210/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1210/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1209 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1209/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1209/comments | https://api.github.com/repos/coleifer/peewee/issues/1209/events | https://github.com/coleifer/peewee/pull/1209 | 212,306,835 | MDExOlB1bGxSZXF1ZXN0MTA5MzkwMzMy | 1,209 | Enhence migrate add and drop foreign keys in mysql | {
"login": "EenTang",
"id": 16539902,
"node_id": "MDQ6VXNlcjE2NTM5OTAy",
"avatar_url": "https://avatars.githubusercontent.com/u/16539902?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/EenTang",
"html_url": "https://github.com/EenTang",
"followers_url": "https://api.github.com/users/EenTan... | [] | closed | false | null | [] | null | [] | 2017-03-07T01:54:10 | 2018-01-31T12:41:07 | 2018-01-31T12:41:07 | NONE | null | There are some bugs in migrate when add or drop foreign keys in mysql. So I write this to fixed it. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1209/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1209/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1209",
"html_url": "https://github.com/coleifer/peewee/pull/1209",
"diff_url": "https://github.com/coleifer/peewee/pull/1209.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1209.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1208 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1208/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1208/comments | https://api.github.com/repos/coleifer/peewee/issues/1208/events | https://github.com/coleifer/peewee/issues/1208 | 212,038,803 | MDU6SXNzdWUyMTIwMzg4MDM= | 1,208 | bug on rollback? (peewee==2.8.7) | {
"login": "paulocheque",
"id": 94350,
"node_id": "MDQ6VXNlcjk0MzUw",
"avatar_url": "https://avatars.githubusercontent.com/u/94350?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/paulocheque",
"html_url": "https://github.com/paulocheque",
"followers_url": "https://api.github.com/users/paul... | [] | closed | false | null | [] | null | [
"If I'm understanding your \"example\" code, then the following is equivalent:\r\n\r\n```pythondb = SqliteDatabase(':memory:')\r\n\r\nclass Register(Model):\r\n value = IntegerField()\r\n class Meta:\r\n database = db\r\n\r\ndb.create_tables([Register])\r\n\r\nwith db.transaction() as txn:\r\n Regis... | 2017-03-06T06:56:30 | 2017-03-06T20:21:59 | 2017-03-06T15:33:24 | NONE | null | - Python 3.6
- peewee==2.8.7
Hi there, In the example below, two records (indexes 0 and 1) will be saved successfully in the database, although I am calling rollback.
```
db.connect()
with db.transaction() as txn:
for index, row in enumerate(rows):
try:
model = MyModel()
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1208/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1208/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1207 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1207/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1207/comments | https://api.github.com/repos/coleifer/peewee/issues/1207/events | https://github.com/coleifer/peewee/issues/1207 | 212,018,550 | MDU6SXNzdWUyMTIwMTg1NTA= | 1,207 | select without commit? | {
"login": "knightliao",
"id": 3657476,
"node_id": "MDQ6VXNlcjM2NTc0NzY=",
"avatar_url": "https://avatars.githubusercontent.com/u/3657476?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/knightliao",
"html_url": "https://github.com/knightliao",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"Peewee runs in autocommit mode unless you're within the scope of a transaction block, so any COMMIT issued as part of a SELECT query is occurring because a transaction is *not* active. If you're managing transactions outside of Peewee, then you may want to turn autocommit off (by passing `autocommit=False` in to t... | 2017-03-06T03:57:20 | 2017-03-07T06:09:21 | 2017-03-06T15:29:10 | NONE | null | i found that every select sql will do commit at last in peewee.
this may cause transaction.
mybatis is a famous lib, it doesn't do transaction when it finds that select sql.
will peewee implement " select without commit?" function? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1207/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1207/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1206 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1206/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1206/comments | https://api.github.com/repos/coleifer/peewee/issues/1206/events | https://github.com/coleifer/peewee/pull/1206 | 211,996,958 | MDExOlB1bGxSZXF1ZXN0MTA5MTcyNzgy | 1,206 | Add interval field support for Postgres | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"What Python data-type is used by psycopg2 to represent an interval in Postgres? I'd assume a `datetime.timedelta`? I'm good with merging the changes (though please rebase into a single commit and remove the PEP8 changes).",
"Yep uses `timedelta` internally. Should be all handled transparently by `psycopg2` and t... | 2017-03-06T00:06:03 | 2017-03-23T18:21:05 | 2017-03-21T04:51:28 | CONTRIBUTOR | null | I can add/amend the tests if you think this is a good approach.
PS. Sorry looks like my AutoPEP8 got in the way of the changes, I can remove if needs be. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1206/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1206/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1206",
"html_url": "https://github.com/coleifer/peewee/pull/1206",
"diff_url": "https://github.com/coleifer/peewee/pull/1206.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1206.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1205 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1205/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1205/comments | https://api.github.com/repos/coleifer/peewee/issues/1205/events | https://github.com/coleifer/peewee/pull/1205 | 211,981,188 | MDExOlB1bGxSZXF1ZXN0MTA5MTYzODg5 | 1,205 | Make 'create_or_get' correctly support composite unique indexes and keys | {
"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 | [
"Hmm... I received another pull-request with similar changes a while back and passed on it due to the complexity it introduced. My current thinking is that it'd be better to just remove `create_or_get` since it seems to cause confusion and the code one would need to write to work around it is very concise:\r\n\r\n`... | 2017-03-05T20:32:09 | 2017-03-06T15:12:32 | 2017-03-06T15:12:32 | CONTRIBUTOR | null | This fixes #1204 | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1205/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1205/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1205",
"html_url": "https://github.com/coleifer/peewee/pull/1205",
"diff_url": "https://github.com/coleifer/peewee/pull/1205.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1205.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1204 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1204/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1204/comments | https://api.github.com/repos/coleifer/peewee/issues/1204/events | https://github.com/coleifer/peewee/issues/1204 | 211,975,660 | MDU6SXNzdWUyMTE5NzU2NjA= | 1,204 | create_or_get returns wrong instance | {
"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 | [
"Is the create not raising an IntegrityError in the create_or_get case?",
"The problem was a combined unique index. My PR should fix it.",
"Thanks for your work on the PR. As I said in my comment on the PR, the code one needs to write to do a create-or-get is only a few lines long and, in my opinion, does not j... | 2017-03-05T19:23:55 | 2017-03-06T19:37:23 | 2017-03-06T15:13:45 | CONTRIBUTOR | null | ```python
>>> Tag.get(name='etf', prefix='wp')
<Tag (#16) wp:etf>
>>> Tag.create_or_get(name='etf', prefix='wp')
(<Tag (#1) mime:*>, False)
>>> Tag.get_or_create(name='etf', prefix='wp')
(<Tag (#16) wp:etf>, False)
```
See above, should be self explanatory. Going to analyze (and hopefully fix) it now. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1204/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1204/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1203 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1203/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1203/comments | https://api.github.com/repos/coleifer/peewee/issues/1203/events | https://github.com/coleifer/peewee/pull/1203 | 211,905,556 | MDExOlB1bGxSZXF1ZXN0MTA5MTIyMDU5 | 1,203 | SQLite Closure Tables: Allow for many-to-many relations | {
"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 | [
"Cool, I may make some small tweaks here and there, but looks great, thank you!",
"Actually, I've gone ahead and reverted this. It didn't seem to work when I started writing tests for it -- possibly I'm misunderstanding something?",
"Could you give me an example of what was not working as expected?",
"Ach, I ... | 2017-03-04T20:39:55 | 2017-03-05T20:06:18 | 2017-03-05T03:01:11 | CONTRIBUTOR | null | Currently, the ClosureTable only allows for self-joins using the same table. But if you have many-to-many relations between one table using an intermediate table that was not expressible.
With this PR, a self-many-to-many-relation is now supported (as rare as it might be -- I needed it ;)).
I also took the libert... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1203/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1203/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1203",
"html_url": "https://github.com/coleifer/peewee/pull/1203",
"diff_url": "https://github.com/coleifer/peewee/pull/1203.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1203.patch",
"merged_at": "2017-03-05T03:01:11"
} |
https://api.github.com/repos/coleifer/peewee/issues/1202 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1202/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1202/comments | https://api.github.com/repos/coleifer/peewee/issues/1202/events | https://github.com/coleifer/peewee/pull/1202 | 211,902,713 | MDExOlB1bGxSZXF1ZXN0MTA5MTIwNDM4 | 1,202 | Make Model.get(val = None) work the same as Model.select().where(Model.val == None) | {
"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 | [
"Nice, thanks!"
] | 2017-03-04T19:51:37 | 2017-03-05T02:58:54 | 2017-03-05T02:58:51 | CONTRIBUTOR | null | Currently `Model.select().where(val == None)` compiles into a `WHERE val IS NULL` clause. On the other hand `Model.get(val = None)` compiled into `WHERE val = NULL` and, if val is an FK field, tried to join.
With this PR, this is fixed and Model.get behaves just like Model.select().where() | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1202/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1202/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1202",
"html_url": "https://github.com/coleifer/peewee/pull/1202",
"diff_url": "https://github.com/coleifer/peewee/pull/1202.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1202.patch",
"merged_at": "2017-03-05T02:58:51"
} |
https://api.github.com/repos/coleifer/peewee/issues/1201 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1201/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1201/comments | https://api.github.com/repos/coleifer/peewee/issues/1201/events | https://github.com/coleifer/peewee/issues/1201 | 210,640,050 | MDU6SXNzdWUyMTA2NDAwNTA= | 1,201 | After updating to 2.8.8 from 2.8.5, started seeing a bug that occurs on 2.8.7 as well | {
"login": "savraj",
"id": 387613,
"node_id": "MDQ6VXNlcjM4NzYxMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/387613?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/savraj",
"html_url": "https://github.com/savraj",
"followers_url": "https://api.github.com/users/savraj/follow... | [] | closed | false | null | [] | null | [
"I bumped into this too. The commit that causes this is 9e76c999868197a4911fa2fa457c50ab42431ff1, which came about because of #1108.\r\n\r\nThe pull request explains why the commit is necessary and how you can solve your problem, but in short use `our_db.get_conn()` instead of `our_db.connect()`.\r\n\r\nIf this is ... | 2017-02-27T23:28:06 | 2017-03-01T16:03:20 | 2017-03-01T16:03:20 | NONE | null | Hi Charles and team,
First, many thanks for creating an AMAZING ORM -- we depend on it and we love its simplicity.
So the weird bug is, we see a
`OperationalError('Connection already open')`
In our boilerplate Flask connection open/close code (copied from the docs), and it happens only on the first time our s... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1201/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1201/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1200 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1200/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1200/comments | https://api.github.com/repos/coleifer/peewee/issues/1200/events | https://github.com/coleifer/peewee/issues/1200 | 210,344,216 | MDU6SXNzdWUyMTAzNDQyMTY= | 1,200 | ForeignKey: Do not load object if only the pk is accessed | {
"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 think that we shouldn't break the convention that accessing the foreign key will, if necessary, load the related object. It makes the code simpler, too.\r\n\r\nJust compare the IDs if that's all you need:\r\n\r\n```python\r\nif tweet.user_id:\r\n```\r\n\r\nOr\r\n\r\n```python\r\nif tweet.user_id == someUser.id:\... | 2017-02-26T20:11:51 | 2017-02-26T23:29:15 | 2017-02-26T23:29:15 | CONTRIBUTOR | null | Given two models `Tweet` and `User` with the well-known relations: When accessing `tweet.user` Peewee currently always fetches the complete user.
Even in cases like
```python
if tweet.user:
# we have a user, do something
else:
# no user, eh?
```
and
```python
if tweet.user == someUser:
# do som... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1200/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1200/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1199 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1199/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1199/comments | https://api.github.com/repos/coleifer/peewee/issues/1199/events | https://github.com/coleifer/peewee/issues/1199 | 210,246,890 | MDU6SXNzdWUyMTAyNDY4OTA= | 1,199 | db.atomic() does not set transaction_type | {
"login": "jberkel",
"id": 18891,
"node_id": "MDQ6VXNlcjE4ODkx",
"avatar_url": "https://avatars.githubusercontent.com/u/18891?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jberkel",
"html_url": "https://github.com/jberkel",
"followers_url": "https://api.github.com/users/jberkel/follower... | [] | closed | false | null | [] | null | [
"Thanks for the report, pushed 2.8.8."
] | 2017-02-25T17:01:42 | 2017-02-26T23:27:40 | 2017-02-26T23:27:39 | CONTRIBUTOR | null | Regression after updating from 2.8.5 to 2.8.7:
```
File "/Users/jan/projects/lexi/importer/src/main/python/lexi/models/fts.py", line 160, in index
with database.atomic():
File "/Users/jan/projects/lexi/importer/venv-python2/lib/python2.7/site-packages/peewee.py", line 4356, in __enter__
return self.c... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1199/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1199/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1198 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1198/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1198/comments | https://api.github.com/repos/coleifer/peewee/issues/1198/events | https://github.com/coleifer/peewee/issues/1198 | 209,974,012 | MDU6SXNzdWUyMDk5NzQwMTI= | 1,198 | Is there a possibility of model.save() returning 0 | {
"login": "Siva7891",
"id": 4815214,
"node_id": "MDQ6VXNlcjQ4MTUyMTQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/4815214?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Siva7891",
"html_url": "https://github.com/Siva7891",
"followers_url": "https://api.github.com/users/Siva7... | [] | closed | false | null | [] | null | [
"Ummm...that's an interesting question, I guess... I think that you shouldn't need to even check the return value. An exception will be raised if a constraint is violated, for instance. So calls to `save()` should really be assumed to work unless an exception is raised.",
"Thanks for replying much faster. "
] | 2017-02-24T06:56:27 | 2017-02-24T17:29:03 | 2017-02-24T16:28:43 | NONE | null | 1) When we try to insert a new row (i.e., model class's object) using model.save() (or model.save(forceinsert=True), will it ever return 0.? If we had primary key conflict, then we receive an exception. So can we safely assume that model.save() will always insert that object and if any problem, it would raise an except... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1198/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1198/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1197 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1197/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1197/comments | https://api.github.com/repos/coleifer/peewee/issues/1197/events | https://github.com/coleifer/peewee/issues/1197 | 209,147,924 | MDU6SXNzdWUyMDkxNDc5MjQ= | 1,197 | MemoryError when querying database from Process | {
"login": "HaraldNordgren",
"id": 9569897,
"node_id": "MDQ6VXNlcjk1Njk4OTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/9569897?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/HaraldNordgren",
"html_url": "https://github.com/HaraldNordgren",
"followers_url": "https://api.gith... | [] | closed | false | null | [] | null | [
"Possibly related to https://github.com/ghaering/pysqlite/issues/110",
"If you're iterating over a large result set, peewee caches rows in-memory (to make subsequent iterations/indexing operations fast). In the case of a single-shot iteration over a lot of rows, though, this can OOM you.\r\n\r\nTo fix, just make ... | 2017-02-21T13:38:51 | 2017-02-22T14:09:56 | 2017-02-22T13:29:29 | NONE | null | I am trying to create a program with 3 processes that read from the same database. The code was working before I started introducing processes.
I am getting MemoryError when performing a `select()`. I suspect there is something wrong with sharing of resources:
**models.py**
```python
from playhouse.pool impor... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1197/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1197/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1196 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1196/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1196/comments | https://api.github.com/repos/coleifer/peewee/issues/1196/events | https://github.com/coleifer/peewee/pull/1196 | 208,739,212 | MDExOlB1bGxSZXF1ZXN0MTA2OTEyNTkx | 1,196 | Give TypeError if calling 'update', etc. from Model instance instead of from class | {
"login": "HaraldNordgren",
"id": 9569897,
"node_id": "MDQ6VXNlcjk1Njk4OTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/9569897?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/HaraldNordgren",
"html_url": "https://github.com/HaraldNordgren",
"followers_url": "https://api.gith... | [] | closed | false | null | [] | null | [
"It seems that Travis still builds from HEAD of origin/master with the PR commit placed on top, so this also fails.",
"Reverting \"Move cdefs back into extern from block\" and \"Bring back tests\" makes the tests work again.\r\n\r\nAgain, this branch probably should not be merged. But at least my commit is not br... | 2017-02-19T19:18:30 | 2017-02-20T21:12:17 | 2017-02-20T16:24:49 | NONE | null | Same as #1195 but based on the latest master commit with passing tests | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1196/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1196/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1196",
"html_url": "https://github.com/coleifer/peewee/pull/1196",
"diff_url": "https://github.com/coleifer/peewee/pull/1196.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1196.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1195 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1195/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1195/comments | https://api.github.com/repos/coleifer/peewee/issues/1195/events | https://github.com/coleifer/peewee/pull/1195 | 208,736,780 | MDExOlB1bGxSZXF1ZXN0MTA2OTExMzU3 | 1,195 | Give TypeError if calling 'update', etc. from Model instance instead of from class | {
"login": "HaraldNordgren",
"id": 9569897,
"node_id": "MDQ6VXNlcjk1Njk4OTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/9569897?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/HaraldNordgren",
"html_url": "https://github.com/HaraldNordgren",
"followers_url": "https://api.gith... | [] | closed | false | null | [] | null | [
"Related to https://github.com/coleifer/peewee/issues/1192",
"This grosses up the code quite a bit. They already have the classmethod decorator.",
"I agree that it grosses up the code a bit. But it's very useful.\r\n\r\nOh well, it's your repo.\r\n ",
"The grossness isn't a reflection of your coding ability,... | 2017-02-19T18:41:22 | 2018-09-18T13:54:15 | 2017-02-20T16:25:22 | NONE | null | I hit a snag with this that took me hours to debug. Since these methods really only make sense as class methods, I don't think you should to be able to call them from an instance. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1195/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1195/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1195",
"html_url": "https://github.com/coleifer/peewee/pull/1195",
"diff_url": "https://github.com/coleifer/peewee/pull/1195.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1195.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1194 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1194/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1194/comments | https://api.github.com/repos/coleifer/peewee/issues/1194/events | https://github.com/coleifer/peewee/pull/1194 | 208,691,550 | MDExOlB1bGxSZXF1ZXN0MTA2ODg3MTQ0 | 1,194 | Fixed an issue where not having a primary key would cause create queries to crash | {
"login": "divmgl",
"id": 5452298,
"node_id": "MDQ6VXNlcjU0NTIyOTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/5452298?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/divmgl",
"html_url": "https://github.com/divmgl",
"followers_url": "https://api.github.com/users/divmgl/foll... | [] | closed | false | null | [] | null | [] | 2017-02-19T03:37:42 | 2017-02-19T03:42:37 | 2017-02-19T03:42:37 | NONE | null | Fixes #1193
cc @coleifer | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1194/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1194/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1194",
"html_url": "https://github.com/coleifer/peewee/pull/1194",
"diff_url": "https://github.com/coleifer/peewee/pull/1194.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1194.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1193 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1193/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1193/comments | https://api.github.com/repos/coleifer/peewee/issues/1193/events | https://github.com/coleifer/peewee/issues/1193 | 208,686,855 | MDU6SXNzdWUyMDg2ODY4NTU= | 1,193 | Many to many creation results in AttributeError | {
"login": "divmgl",
"id": 5452298,
"node_id": "MDQ6VXNlcjU0NTIyOTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/5452298?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/divmgl",
"html_url": "https://github.com/divmgl",
"followers_url": "https://api.github.com/users/divmgl/foll... | [] | closed | false | null | [] | null | [
"This is definitely not the ideal scenario, but it fixed my errors so I can continue development... \r\n\r\ncc @coleifer ",
"Actually this breaks other functionality... so disregard. \r\n\r\nHad to do this instead:\r\n\r\n```python\r\ndb.execute_sql(\"\"\"\r\n INSERT INTO account_board (account_id, board_id)\r... | 2017-02-19T01:43:23 | 2017-02-20T21:11:00 | 2017-02-20T19:10:17 | NONE | null | Getting an attribute error when saving a model with two foreign key relationships.
```python
class Account(BaseModel):
created_on = DateTimeField(null=False)
username = CharField(null=False, unique=True)
password = CharField(null=False)
salt = CharField(null=False)
name = CharField(null=Fal... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1193/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1193/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1192 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1192/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1192/comments | https://api.github.com/repos/coleifer/peewee/issues/1192/events | https://github.com/coleifer/peewee/issues/1192 | 207,238,316 | MDU6SXNzdWUyMDcyMzgzMTY= | 1,192 | Update() on row affects every row and should be disallowed | {
"login": "HaraldNordgren",
"id": 9569897,
"node_id": "MDQ6VXNlcjk1Njk4OTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/9569897?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/HaraldNordgren",
"html_url": "https://github.com/HaraldNordgren",
"followers_url": "https://api.gith... | [] | closed | false | null | [] | null | [
"And the correct syntax in this case seems to be\r\n\r\n for row in rows:\r\n <do things>\r\n row.job_status = NEW_STATUS\r\n row.save()",
"`update` is a classmethod, and is document as such. An update without a where clause is going to cause problems, obviously, as you found."
] | 2017-02-13T14:47:34 | 2017-02-13T15:21:07 | 2017-02-13T15:21:07 | NONE | null | I used this code to update rows, and it seems that the update() function used in this way updates more than the current row. Possible every row in the model.
Maybe it should be altogether disallowed to avoid mistakes?
```
rows = Model.select().where(
Model.status == SOME_STATUS
)
for row in rows:
<... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1192/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1192/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1191 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1191/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1191/comments | https://api.github.com/repos/coleifer/peewee/issues/1191/events | https://github.com/coleifer/peewee/issues/1191 | 207,176,021 | MDU6SXNzdWUyMDcxNzYwMjE= | 1,191 | TypeError: sequence item 0: expected str instance, BaseModel found | {
"login": "raphael0202",
"id": 9609923,
"node_id": "MDQ6VXNlcjk2MDk5MjM=",
"avatar_url": "https://avatars.githubusercontent.com/u/9609923?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/raphael0202",
"html_url": "https://github.com/raphael0202",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"`.join(User, Bot)` is not valid. The docs are pretty clear on the method: http://docs.peewee-orm.com/en/latest/peewee/api.html#Query.join\r\n\r\nInterestingly, since you're joining the same model twice, you'll need to work around Peewee's concept of the query context. Here's what you're probably going for:\r\n\r\n... | 2017-02-13T10:27:21 | 2017-02-14T07:49:50 | 2017-02-13T16:58:21 | NONE | null | This error can be reproduced with the following script:
```
import peewee
import datetime
db = peewee.SqliteDatabase(database='test.db')
class BaseModel(peewee.Model):
class Meta:
database = db
class User(BaseModel):
username = peewee.CharField(max_length=200, null=True)
class Bo... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1191/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1191/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1190 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1190/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1190/comments | https://api.github.com/repos/coleifer/peewee/issues/1190/events | https://github.com/coleifer/peewee/pull/1190 | 206,918,971 | MDExOlB1bGxSZXF1ZXN0MTA1NzE0OTM4 | 1,190 | SqliteQueueDatabase exception fix for #1189 | {
"login": "krikunts",
"id": 2005786,
"node_id": "MDQ6VXNlcjIwMDU3ODY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2005786?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/krikunts",
"html_url": "https://github.com/krikunts",
"followers_url": "https://api.github.com/users/kriku... | [] | closed | false | null | [] | null | [
"No, `exc` is set in the `else` clause, which runs if no Exception is raised...",
"I was mistaken! In Python 3, the expression: `except <Exception> as <var>` does not keep `<var>` in scope beyond the exception block. So you were correct in raising this issue. It is fixed in `master` now.",
"Great! My bad, I did... | 2017-02-10T22:08:08 | 2017-02-14T08:43:15 | 2017-02-14T01:51:38 | NONE | null | Fixing reference before assignment error #1189 | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1190/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1190/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1190",
"html_url": "https://github.com/coleifer/peewee/pull/1190",
"diff_url": "https://github.com/coleifer/peewee/pull/1190.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1190.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1189 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1189/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1189/comments | https://api.github.com/repos/coleifer/peewee/issues/1189/events | https://github.com/coleifer/peewee/issues/1189 | 206,916,585 | MDU6SXNzdWUyMDY5MTY1ODU= | 1,189 | SqliteQueueDatabase Writer.execute() error | {
"login": "krikunts",
"id": 2005786,
"node_id": "MDQ6VXNlcjIwMDU3ODY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2005786?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/krikunts",
"html_url": "https://github.com/krikunts",
"followers_url": "https://api.github.com/users/kriku... | [] | closed | false | null | [] | null | [
"What exception is underneath the `UnboundLocalError` I wonder? I would've thought that catching Exception would suffice but it looks like whatever error is being raised extends `BaseException` instead?",
"I couldn't replicate. I added a test-case in which invalid SQL is executed via the AsyncCursor and it all wo... | 2017-02-10T21:55:45 | 2017-02-14T01:59:30 | 2017-02-14T01:59:30 | NONE | null | Hello! I read your blogpost about SqliteQueueDatabase and want to try it out, but I have an error using SqliteQueueDatabase
UnboundLocalError: local variable 'exc' referenced before assignment
https://github.com/coleifer/peewee/blob/d99f4a2649ce02da2f67769e381e51264f3c3eac/playhouse/sqliteq.py#L176
If there is exce... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1189/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1189/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1188 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1188/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1188/comments | https://api.github.com/repos/coleifer/peewee/issues/1188/events | https://github.com/coleifer/peewee/issues/1188 | 206,572,129 | MDU6SXNzdWUyMDY1NzIxMjk= | 1,188 | database locked even with minimal concurrency | {
"login": "rayzorben",
"id": 7737834,
"node_id": "MDQ6VXNlcjc3Mzc4MzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/7737834?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rayzorben",
"html_url": "https://github.com/rayzorben",
"followers_url": "https://api.github.com/users/ra... | [] | closed | false | null | [] | null | [
"I wrote a blog post on this subject, http://charlesleifer.com/blog/multi-threaded-sqlite-without-the-operationalerrors/\r\n\r\nBut, tl;dr is that you probably are running up against timeouts while waiting for the write lock...possibly?\r\n\r\nYou can try increasing the timeout, by passing `timeout=10` or more to t... | 2017-02-09T17:22:47 | 2021-06-02T12:47:39 | 2017-02-09T22:17:25 | NONE | null | I am trying to insert multi threaded. I have 4 worker threads that pull data off a queue (producer/consumer model) and does an insert_many on that data.
```python
def run(self):
while True:
try:
r = self.q.get_nowait()
except Empty:
r = None
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1188/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1188/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1187 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1187/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1187/comments | https://api.github.com/repos/coleifer/peewee/issues/1187/events | https://github.com/coleifer/peewee/issues/1187 | 206,420,069 | MDU6SXNzdWUyMDY0MjAwNjk= | 1,187 | SQLite :memory: is not working in threads | {
"login": "charleschen",
"id": 698190,
"node_id": "MDQ6VXNlcjY5ODE5MA==",
"avatar_url": "https://avatars.githubusercontent.com/u/698190?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/charleschen",
"html_url": "https://github.com/charleschen",
"followers_url": "https://api.github.com/user... | [] | closed | false | null | [] | null | [
"In-memory databases only exist for the connection that opened them. Peewee, by default, uses a connection-per-thread, so each thread has it's own connection (and hence its own in-memory database). You can disable this by passing `threadlocals=False` to the db when initializing it. You might also need to pass `chec... | 2017-02-09T06:48:34 | 2018-04-03T12:11:20 | 2017-02-09T14:51:36 | NONE | null | The following doesn't work:
```
import datetime
import threading
import time
import peewee
from playhouse import test_utils
from playhouse import sqlite_ext
db = sqlite_ext.SqliteExtDatabase('werd.sql')
test_db = sqlite_ext.SqliteExtDatabase(':memory:')
class SomeTable(peewee.Model):
create... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1187/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1187/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1186 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1186/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1186/comments | https://api.github.com/repos/coleifer/peewee/issues/1186/events | https://github.com/coleifer/peewee/issues/1186 | 206,036,011 | MDU6SXNzdWUyMDYwMzYwMTE= | 1,186 | autocommit should be True by default | {
"login": "benjsto",
"id": 41104,
"node_id": "MDQ6VXNlcjQxMTA0",
"avatar_url": "https://avatars.githubusercontent.com/u/41104?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/benjsto",
"html_url": "https://github.com/benjsto",
"followers_url": "https://api.github.com/users/benjsto/follower... | [] | closed | false | null | [] | null | [
"`autocommit` refers to the behavior of Peewee, not what the underlying driver may or may not be doing."
] | 2017-02-07T22:27:04 | 2017-02-07T22:35:02 | 2017-02-07T22:35:02 | NONE | null | As documented, and by my reading of the peewee source code, `autocommit` is intended to be True by default. However, that does not line up with what I'm seeing:
Initializing a peewee MySQLDatabase instance:
```
db = MySQLDatabase(settings.get('db_name'),
host=settings.get('db_host'),
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1186/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1186/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1185 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1185/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1185/comments | https://api.github.com/repos/coleifer/peewee/issues/1185/events | https://github.com/coleifer/peewee/issues/1185 | 204,123,176 | MDU6SXNzdWUyMDQxMjMxNzY= | 1,185 | Model to dict for array of models | {
"login": "theobouwman",
"id": 16098190,
"node_id": "MDQ6VXNlcjE2MDk4MTkw",
"avatar_url": "https://avatars.githubusercontent.com/u/16098190?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/theobouwman",
"html_url": "https://github.com/theobouwman",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"Make a for loop. Jesus.",
"Wauw"
] | 2017-01-30T20:39:35 | 2017-01-30T21:21:18 | 2017-01-30T21:17:13 | NONE | null | `model_to_dict` can only convert a single model to a dictionary, right?
But what about an array of models, like this: `User.select().where(User.age > 19)` this will return all `users` above 19 years old. But what when I want to return this array as json? Then I need to loop through every object an make it a dictionary... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1185/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1185/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1184 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1184/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1184/comments | https://api.github.com/repos/coleifer/peewee/issues/1184/events | https://github.com/coleifer/peewee/issues/1184 | 203,800,664 | MDU6SXNzdWUyMDM4MDA2NjQ= | 1,184 | `execute_sql` seems not to respect `db.begin()` | {
"login": "kunalbhagawati",
"id": 8683984,
"node_id": "MDQ6VXNlcjg2ODM5ODQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/8683984?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kunalbhagawati",
"html_url": "https://github.com/kunalbhagawati",
"followers_url": "https://api.gith... | [] | closed | false | null | [] | null | [
"Begin is a no-op on Postgres and MySQL because transaction handling is baked into the Python driver. Don't ask me why this is the case, it just is part of the DB-API 2.0. As you have found out, the way to manually perform a transaction is to turn off autocommit, then execute your queries and call commit manually w... | 2017-01-28T10:40:18 | 2017-01-30T19:25:54 | 2017-01-30T19:25:54 | NONE | null | For the lack of time, I have put this in StackOverflow also. I hope that is okay. If its redundant, i'll remove it from there.
http://stackoverflow.com/questions/41908762/using-transactions-with-peewee-without-using-atomic
We have a file `db.py` where a peewee database is defined:
db = PostgresqlExtDatabase(... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1184/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1184/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1183 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1183/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1183/comments | https://api.github.com/repos/coleifer/peewee/issues/1183/events | https://github.com/coleifer/peewee/issues/1183 | 202,780,897 | MDU6SXNzdWUyMDI3ODA4OTc= | 1,183 | Can we just remove Database.for_update Database.for_update_nowait ? | {
"login": "likang",
"id": 850711,
"node_id": "MDQ6VXNlcjg1MDcxMQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/850711?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/likang",
"html_url": "https://github.com/likang",
"followers_url": "https://api.github.com/users/likang/follow... | [] | closed | false | null | [] | null | [
"These flags are used to indicate features supported by the db. They are used, for example, test_queries.py line 1867."
] | 2017-01-24T10:36:46 | 2017-01-30T21:20:36 | 2017-01-30T21:20:36 | NONE | null | It seems there is no references of them in peewee.py | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1183/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1183/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1182 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1182/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1182/comments | https://api.github.com/repos/coleifer/peewee/issues/1182/events | https://github.com/coleifer/peewee/issues/1182 | 202,034,288 | MDU6SXNzdWUyMDIwMzQyODg= | 1,182 | "Using" is not thread safe. | {
"login": "fangchih",
"id": 1895216,
"node_id": "MDQ6VXNlcjE4OTUyMTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1895216?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/fangchih",
"html_url": "https://github.com/fangchih",
"followers_url": "https://api.github.com/users/fangc... | [] | closed | false | null | [] | null | [
"Would this also happen if i running peewee in a multi-threaded web-server? I'm not familiar with concurrent programming.",
"@chenbo515 I found this case only exists in below scenarios\r\n1) concurrent access to peewee model class. AND\r\n2) wanna use one peewee model class to access multiple databases which ha... | 2017-01-20T02:42:40 | 2017-01-24T02:19:03 | 2017-01-23T21:37:06 | NONE | null | Hi There,
I have a requirement that needs to use one Model to deal with multiple Sqlite db files, and this process may execute concurrently, I did try the "Using" which get from [document]( http://docs.peewee-orm.com/en/latest/peewee/database.html#using-multiple-databases) but found the "Using" is not a thread-safe ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1182/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/1182/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1181 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1181/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1181/comments | https://api.github.com/repos/coleifer/peewee/issues/1181/events | https://github.com/coleifer/peewee/issues/1181 | 202,021,587 | MDU6SXNzdWUyMDIwMjE1ODc= | 1,181 | fn.GROUP_CONCAT should support ORDER BY | {
"login": "mithmatt",
"id": 5906984,
"node_id": "MDQ6VXNlcjU5MDY5ODQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/5906984?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mithmatt",
"html_url": "https://github.com/mithmatt",
"followers_url": "https://api.github.com/users/mithm... | [] | closed | false | null | [] | null | [
"Try this:\r\n\r\n```python\r\nfn.GROUP_CONCAT(Clause(\r\n SQL('Distinct'),\r\n MyModel.test_score,\r\n SQL('ORDER BY'),\r\n MyModel.test_score,\r\n SQL('DESC SEPARATOR \\' \\'')))\r\n```\r\n\r\nNot very clean but that should hopefully help you get the SQL you need."
] | 2017-01-20T01:09:01 | 2017-01-23T21:41:40 | 2017-01-23T21:41:40 | NONE | null | From [MySQL Docs](http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_group-concat), ```GROUP_CONCAT``` supports ```ORDER BY```
```
mysql> SELECT student_name,
-> GROUP_CONCAT(DISTINCT test_score
-> ORDER BY test_score DESC SEPARATOR ' ')
-> FROM student
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1181/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1181/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1180 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1180/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1180/comments | https://api.github.com/repos/coleifer/peewee/issues/1180/events | https://github.com/coleifer/peewee/issues/1180 | 201,600,862 | MDU6SXNzdWUyMDE2MDA4NjI= | 1,180 | Postgresql FOR SHARE support | {
"login": "kapucko",
"id": 2729306,
"node_id": "MDQ6VXNlcjI3MjkzMDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2729306?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kapucko",
"html_url": "https://github.com/kapucko",
"followers_url": "https://api.github.com/users/kapucko/... | [] | closed | false | null | [] | null | [
"Added in 7f6f578f6f06e865ea5f3823c163d39aa6ff2a96\r\n\r\n```python\r\nSomeModel.select().with_lock('SHARE')\r\n```"
] | 2017-01-18T15:12:18 | 2017-01-30T21:32:47 | 2017-01-30T21:32:47 | NONE | null | Hi,
I'm looking for support of FOR SHARE locking level in postgres (https://www.postgresql.org/docs/9.4/static/explicit-locking.html). I have found just this: http://docs.peewee-orm.com/en/latest/peewee/api.html#SelectQuery.for_update which generates FOR UPDATE.
Is there any way I can implement this as an extension... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1180/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1180/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1179 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1179/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1179/comments | https://api.github.com/repos/coleifer/peewee/issues/1179/events | https://github.com/coleifer/peewee/issues/1179 | 201,546,904 | MDU6SXNzdWUyMDE1NDY5MDQ= | 1,179 | how can use sub-table search? | {
"login": "noogel",
"id": 8756485,
"node_id": "MDQ6VXNlcjg3NTY0ODU=",
"avatar_url": "https://avatars.githubusercontent.com/u/8756485?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/noogel",
"html_url": "https://github.com/noogel",
"followers_url": "https://api.github.com/users/noogel/foll... | [] | closed | false | null | [] | null | [
"This is not a feature of peewee."
] | 2017-01-18T11:25:31 | 2017-01-18T22:35:08 | 2017-01-18T22:35:08 | NONE | null | I have many of the same tables, just different table names.
like:
book_001
book_002
...
...
book_100
How to write a Model class according to different conditions of the table data.
E.g:
Book.get_model('001').select().execute() => select * from book_001
Book.get_model('002').select().execute() => select *... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1179/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1179/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1178 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1178/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1178/comments | https://api.github.com/repos/coleifer/peewee/issues/1178/events | https://github.com/coleifer/peewee/issues/1178 | 201,529,821 | MDU6SXNzdWUyMDE1Mjk4MjE= | 1,178 | Subquery problems with peewee Cython | {
"login": "danygielow",
"id": 184562,
"node_id": "MDQ6VXNlcjE4NDU2Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/184562?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/danygielow",
"html_url": "https://github.com/danygielow",
"followers_url": "https://api.github.com/users/d... | [] | closed | false | null | [] | null | [
"Are you dead set on using `SQL('*')`? The \"peewee\" way would be to write:\r\n\r\n```python\r\nsub = sub.alias('sub')\r\nquery = A.select(sub.c.a, sub.c.b).from_(sub)\r\n```",
"OK, you might be right. But there is still a discrepency in functionality between the Cython speedups and non-speedup code.\r\n\r\nI cl... | 2017-01-18T10:12:50 | 2017-01-24T09:54:14 | 2017-01-24T09:54:14 | NONE | null | I have encountered an error with subqueries and the usage of `SQL('*')` when peewee is built with Cython extensions. Without Cython, the behavior is the same as before.
TestCase:
```python
def test_subselect(self):
with test_database(self.mysql_test_db, [A]):
A.create(a=1, b=3)
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1178/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1178/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1177 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1177/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1177/comments | https://api.github.com/repos/coleifer/peewee/issues/1177/events | https://github.com/coleifer/peewee/issues/1177 | 201,424,757 | MDU6SXNzdWUyMDE0MjQ3NTc= | 1,177 | Slow on iterating over simple query | {
"login": "GMaxera",
"id": 3726196,
"node_id": "MDQ6VXNlcjM3MjYxOTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/3726196?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/GMaxera",
"html_url": "https://github.com/GMaxera",
"followers_url": "https://api.github.com/users/GMaxera/... | [] | closed | false | null | [] | null | [
"It's Python...",
"@coleifer, Please elaborate. \r\n\r\nI'm using peewee in cases where I am required to query 1 million or more rows.\r\n```python\r\nquery = table.select()\r\ndata = list(query.dicts())\r\n```\r\n\r\nThis process takes over 30s and when there are where clauses, it may take up to 1~2min.\r\n\r\nA... | 2017-01-17T22:30:11 | 2018-06-27T14:17:41 | 2017-01-23T21:42:32 | NONE | null | I have this code:
```python
tweetInsights = Gnip_Tweet_Insights \
.select() \
.where(
(Gnip_Tweet_Insights.client_account_id==clientAccountId) &
(Gnip_Tweet_Insights.occurred_at==insight.occurred_at) &
(Gnip_Tweet_Insights.by_echomany==insight.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1177/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/1177/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1176 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1176/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1176/comments | https://api.github.com/repos/coleifer/peewee/issues/1176/events | https://github.com/coleifer/peewee/pull/1176 | 201,356,019 | MDExOlB1bGxSZXF1ZXN0MTAxOTExNjU5 | 1,176 | Add full support for Postgres window functions | {
"login": "alin23",
"id": 3819725,
"node_id": "MDQ6VXNlcjM4MTk3MjU=",
"avatar_url": "https://avatars.githubusercontent.com/u/3819725?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alin23",
"html_url": "https://github.com/alin23",
"followers_url": "https://api.github.com/users/alin23/foll... | [] | closed | false | null | [] | null | [] | 2017-01-17T17:38:57 | 2017-02-06T20:43:56 | 2017-02-06T20:43:56 | NONE | null | * Add support for frame_clause
```
frame_clause can be one of
{ RANGE | ROWS } frame_start
{ RANGE | ROWS } BETWEEN frame_start AND frame_end
where frame_start and frame_end can be one of
UNBOUNDED PRECEDING
value PRECEDING
CURRENT ROW
value FOLLOWING
UNBOUNDED FOLL... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1176/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1176/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1176",
"html_url": "https://github.com/coleifer/peewee/pull/1176",
"diff_url": "https://github.com/coleifer/peewee/pull/1176.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1176.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1175 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1175/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1175/comments | https://api.github.com/repos/coleifer/peewee/issues/1175/events | https://github.com/coleifer/peewee/issues/1175 | 201,291,192 | MDU6SXNzdWUyMDEyOTExOTI= | 1,175 | Database default | {
"login": "theobouwman",
"id": 16098190,
"node_id": "MDQ6VXNlcjE2MDk4MTkw",
"avatar_url": "https://avatars.githubusercontent.com/u/16098190?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/theobouwman",
"html_url": "https://github.com/theobouwman",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"Yes, you can specify arbitrary stuff in the `constraints` field parameter:\r\n\r\n```python\r\ntimestamp = DateTimeField(constraints=[SQL('DEFAULT CURRENT_TIMESTAMP')])\r\n```\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html?#default-field-values"
] | 2017-01-17T13:56:05 | 2017-01-23T21:44:23 | 2017-01-23T21:44:23 | NONE | null | Is it possible to add a default which is done by the database server.
Like `DEFAULT CURRENT_TIMESTAMP` for a MySQL datetime field?
I would like to make a PR if it's not available. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1175/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1175/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1174 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1174/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1174/comments | https://api.github.com/repos/coleifer/peewee/issues/1174/events | https://github.com/coleifer/peewee/issues/1174 | 201,110,650 | MDU6SXNzdWUyMDExMTA2NTA= | 1,174 | Hug framework support | {
"login": "0gk",
"id": 15966259,
"node_id": "MDQ6VXNlcjE1OTY2MjU5",
"avatar_url": "https://avatars.githubusercontent.com/u/15966259?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/0gk",
"html_url": "https://github.com/0gk",
"followers_url": "https://api.github.com/users/0gk/followers",
... | [] | closed | false | null | [] | null | [
"I'd accept a PR with docs.",
"Maybe something like this:\r\n\r\n```\r\n@hug.request_middleware()\r\ndef preProcessing(request, response):\r\n db.connect()\r\n\r\n@hug.response_middleware()\r\ndef afterProcessing(request, response, resource):\r\n db.close()\r\n```"
] | 2017-01-16T20:20:20 | 2018-09-29T15:16:20 | 2017-01-23T21:42:52 | NONE | null | Please, add section about Hug support. I try to use instructions for Falcon, but it don't work. May be Hug just have no hooks or smth like? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1174/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1174/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1173 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1173/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1173/comments | https://api.github.com/repos/coleifer/peewee/issues/1173/events | https://github.com/coleifer/peewee/pull/1173 | 200,589,838 | MDExOlB1bGxSZXF1ZXN0MTAxNDE4MTAy | 1,173 | Fixed setting of compound parentheses, fixes #1168 | {
"login": "danygielow",
"id": 184562,
"node_id": "MDQ6VXNlcjE4NDU2Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/184562?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/danygielow",
"html_url": "https://github.com/danygielow",
"followers_url": "https://api.github.com/users/d... | [] | closed | false | null | [] | null | [
"I fixed this using slightly more compact code, hope it's more readable now."
] | 2017-01-13T09:58:23 | 2017-01-13T22:27:28 | 2017-01-13T22:27:28 | NONE | null | This PR fixes the issue in #1168 by only wrapping non-compound queries in parentheses.
Changed the corresponding test as well. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1173/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1173/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1173",
"html_url": "https://github.com/coleifer/peewee/pull/1173",
"diff_url": "https://github.com/coleifer/peewee/pull/1173.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1173.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1172 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1172/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1172/comments | https://api.github.com/repos/coleifer/peewee/issues/1172/events | https://github.com/coleifer/peewee/issues/1172 | 200,575,641 | MDU6SXNzdWUyMDA1NzU2NDE= | 1,172 | why there is no pskel? | {
"login": "axiaoxin",
"id": 2876405,
"node_id": "MDQ6VXNlcjI4NzY0MDU=",
"avatar_url": "https://avatars.githubusercontent.com/u/2876405?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/axiaoxin",
"html_url": "https://github.com/axiaoxin",
"followers_url": "https://api.github.com/users/axiao... | [] | closed | false | null | [] | null | [
"It's only included in the git repo.",
"Actually `pskel` is declared usign the `script=[]` parameter of `setup.py` installation script, which it fails on many occasions to properly install things.\r\n\r\nIt would work out of the box in all python environments if it was converted into console entry-point:\r\nhttp:... | 2017-01-13T08:43:51 | 2017-10-10T15:39:36 | 2017-01-13T17:43:24 | NONE | null | I read the doc: <http://docs.peewee-orm.com/en/latest/peewee/database.html#generating-skeleton-code>, I test using pskel to generate the skeleton code, but I found the pskel is not exists in my local
under the site-packages, peewee's install-files.txt is:
```
..\peewee.py
..\pwiz.py
..\playhouse\apsw_ext.py
.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1172/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1172/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1171 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1171/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1171/comments | https://api.github.com/repos/coleifer/peewee/issues/1171/events | https://github.com/coleifer/peewee/pull/1171 | 200,222,783 | MDExOlB1bGxSZXF1ZXN0MTAxMTU3Mjg4 | 1,171 | Fix "derived" in api.rst. | {
"login": "cassidykelly",
"id": 10568266,
"node_id": "MDQ6VXNlcjEwNTY4MjY2",
"avatar_url": "https://avatars.githubusercontent.com/u/10568266?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cassidykelly",
"html_url": "https://github.com/cassidykelly",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [] | 2017-01-11T22:11:15 | 2017-01-12T00:08:07 | 2017-01-12T00:08:07 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1171/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1171/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1171",
"html_url": "https://github.com/coleifer/peewee/pull/1171",
"diff_url": "https://github.com/coleifer/peewee/pull/1171.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1171.patch",
"merged_at": "2017-01-12T00:08:07"
} | |
https://api.github.com/repos/coleifer/peewee/issues/1170 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1170/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1170/comments | https://api.github.com/repos/coleifer/peewee/issues/1170/events | https://github.com/coleifer/peewee/issues/1170 | 200,185,022 | MDU6SXNzdWUyMDAxODUwMjI= | 1,170 | Add view support to pwiz model generator | {
"login": "toddhay",
"id": 1015217,
"node_id": "MDQ6VXNlcjEwMTUyMTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/1015217?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/toddhay",
"html_url": "https://github.com/toddhay",
"followers_url": "https://api.github.com/users/toddhay/... | [] | closed | false | null | [] | null | [
"I do not have any plans for supporting this."
] | 2017-01-11T19:28:10 | 2017-01-13T22:28:07 | 2017-01-13T22:28:07 | NONE | null | Please add the ability to migrate database views to a model using the pwiz model generator capability. We're currently using postgresql and sqlite so those would be our initial database type requests.
Thanks for the great peewee library, we use it heavily in our software development. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1170/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/1170/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1169 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1169/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1169/comments | https://api.github.com/repos/coleifer/peewee/issues/1169/events | https://github.com/coleifer/peewee/issues/1169 | 199,861,485 | MDU6SXNzdWUxOTk4NjE0ODU= | 1,169 | Validation for choices in the application layer | {
"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 | [
"It can be validated in the application layer -- *your* application!",
"Heh, we already do that! Was wondering if there was any interest upstream.\r\n\r\nThanks!"
] | 2017-01-10T16:04:40 | 2017-01-11T16:53:30 | 2017-01-11T16:52:19 | NONE | null | I get why you don't validate for `choices` in the db layer.
Any reason it can't be implemented at the application layer? For backwards compatibility validated choices can be a new attribute called `allowed`/`validated_choices`?
The behavior i'm thinking of is to throw a `ValueError` on saving a field if its not ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1169/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1169/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1168 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1168/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1168/comments | https://api.github.com/repos/coleifer/peewee/issues/1168/events | https://github.com/coleifer/peewee/issues/1168 | 199,537,643 | MDU6SXNzdWUxOTk1Mzc2NDM= | 1,168 | UNION with 3 or more queries leads to invalid SQL syntax (MySQL) | {
"login": "danygielow",
"id": 184562,
"node_id": "MDQ6VXNlcjE4NDU2Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/184562?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/danygielow",
"html_url": "https://github.com/danygielow",
"followers_url": "https://api.github.com/users/d... | [] | closed | false | null | [] | null | [
"Fixed in d339c03. Thanks for the patch!"
] | 2017-01-09T12:09:40 | 2017-01-13T22:27:47 | 2017-01-13T22:27:47 | NONE | null | With the MysqlDatabase a UNION with 3 or more queries leads to a wrong syntax by wrapping individual UNION pairs in parentheses.
I don't know if other databases are affected as well, SQLiteDatabase seems to work.
Test Case:
```python
class A(Model):
id = PrimaryKeyField()
b = IntegerField()
class... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1168/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1168/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1167 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1167/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1167/comments | https://api.github.com/repos/coleifer/peewee/issues/1167/events | https://github.com/coleifer/peewee/issues/1167 | 199,389,080 | MDU6SXNzdWUxOTkzODkwODA= | 1,167 | Prefetch prefetches all foreign keys. | {
"login": "tkukushkin",
"id": 1482516,
"node_id": "MDQ6VXNlcjE0ODI1MTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1482516?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tkukushkin",
"html_url": "https://github.com/tkukushkin",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"Unfortunately, prefetch cannot be lazy by definition. I'd suggest just writing the queries you need explicitly."
] | 2017-01-07T22:29:33 | 2017-01-11T16:54:01 | 2017-01-11T16:54:01 | NONE | null | I need to prefetch by only specific foreign key, but it prefetches by all.
Maybe need to add possibility to specify field for prefetch instead of join_model?
Also prefetch don't preserves by query methods like `Query.where` and it is not lazy. Maybe good to do query method like `Query.prefetch(self, *refs)` where `... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1167/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1167/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1166 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1166/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1166/comments | https://api.github.com/repos/coleifer/peewee/issues/1166/events | https://github.com/coleifer/peewee/pull/1166 | 199,309,414 | MDExOlB1bGxSZXF1ZXN0MTAwNTM5MDI1 | 1,166 | Added missing word | {
"login": "egoberdon",
"id": 4079351,
"node_id": "MDQ6VXNlcjQwNzkzNTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4079351?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/egoberdon",
"html_url": "https://github.com/egoberdon",
"followers_url": "https://api.github.com/users/eg... | [] | closed | false | null | [] | null | [] | 2017-01-06T22:46:05 | 2017-01-09T21:26:20 | 2017-01-09T21:26:20 | CONTRIBUTOR | null | Added a missing word | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1166/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1166/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1166",
"html_url": "https://github.com/coleifer/peewee/pull/1166",
"diff_url": "https://github.com/coleifer/peewee/pull/1166.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1166.patch",
"merged_at": "2017-01-09T21:26:20"
} |
https://api.github.com/repos/coleifer/peewee/issues/1165 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1165/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1165/comments | https://api.github.com/repos/coleifer/peewee/issues/1165/events | https://github.com/coleifer/peewee/issues/1165 | 199,277,394 | MDU6SXNzdWUxOTkyNzczOTQ= | 1,165 | Sqlite closure calls cannot reference each other | {
"login": "Naatan",
"id": 278649,
"node_id": "MDQ6VXNlcjI3ODY0OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/278649?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Naatan",
"html_url": "https://github.com/Naatan",
"followers_url": "https://api.github.com/users/Naatan/follow... | [] | closed | false | null | [] | null | [
"Anyone? I've been digging on this for a while myself now, but there is so much abstraction it's hard to figure out how to properly fix this.",
"Looking at this now, sorry for the delays!",
"Fixed -- Peewee was trying to be too clever by resolving the JOIN-ed closure table to a model instance and patching it to... | 2017-01-06T20:10:26 | 2017-01-30T21:53:30 | 2017-01-30T21:52:58 | NONE | null | When you do a call to `descendants` or `ancestors` the returned model holds an id value that that is the Closure model, this makes it impossible to use this data in followup queries.
Here's some code that illustrates the problem:
```
from peewee import *
from playhouse.apsw_ext import *
from playhouse.sqlite_e... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1165/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1165/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1164 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1164/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1164/comments | https://api.github.com/repos/coleifer/peewee/issues/1164/events | https://github.com/coleifer/peewee/pull/1164 | 199,036,171 | MDExOlB1bGxSZXF1ZXN0MTAwMzQ3MTAz | 1,164 | Allow recursive extra_attrs in model_to_dict. | {
"login": "cassidykelly",
"id": 10568266,
"node_id": "MDQ6VXNlcjEwNTY4MjY2",
"avatar_url": "https://avatars.githubusercontent.com/u/10568266?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cassidykelly",
"html_url": "https://github.com/cassidykelly",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"Going to pass on this."
] | 2017-01-05T19:18:05 | 2017-01-11T16:55:02 | 2017-01-11T16:55:02 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1164/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1164/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1164",
"html_url": "https://github.com/coleifer/peewee/pull/1164",
"diff_url": "https://github.com/coleifer/peewee/pull/1164.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1164.patch",
"merged_at": null
} | |
https://api.github.com/repos/coleifer/peewee/issues/1163 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1163/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1163/comments | https://api.github.com/repos/coleifer/peewee/issues/1163/events | https://github.com/coleifer/peewee/issues/1163 | 199,014,459 | MDU6SXNzdWUxOTkwMTQ0NTk= | 1,163 | Dicts not resolving join column name conflicts properly | {
"login": "jontonsoup",
"id": 845636,
"node_id": "MDQ6VXNlcjg0NTYzNg==",
"avatar_url": "https://avatars.githubusercontent.com/u/845636?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jontonsoup",
"html_url": "https://github.com/jontonsoup",
"followers_url": "https://api.github.com/users/j... | [] | closed | false | null | [] | null | [
"How would it be automatically resolved? What would happen? How would Peewee pick one?\r\n\r\nThe answer you've come up with -- specifying an alias -- is the right approach.",
"I'm not sure why you couldn't automatically prepend the name of the model infront of the column name and return both in cases where there... | 2017-01-05T17:36:05 | 2017-01-09T21:56:23 | 2017-01-09T21:25:17 | NONE | null | Say I want to join three tables and two of the tables have the same column.
```
class Order(Model):
status = Text....
class Betcycle(Model):
status = Text....
```
```
rt_orders = list(Order.select(Order, RtPick, Betcycle).join(
RtPick).join(Betcycle).where(Order.status == "SETTLED").dicts())
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1163/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/1163/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1162 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1162/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1162/comments | https://api.github.com/repos/coleifer/peewee/issues/1162/events | https://github.com/coleifer/peewee/issues/1162 | 198,975,689 | MDU6SXNzdWUxOTg5NzU2ODk= | 1,162 | Cascade delete is not working as expected | {
"login": "aellwein",
"id": 3179781,
"node_id": "MDQ6VXNlcjMxNzk3ODE=",
"avatar_url": "https://avatars.githubusercontent.com/u/3179781?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aellwein",
"html_url": "https://github.com/aellwein",
"followers_url": "https://api.github.com/users/aellw... | [] | closed | false | null | [] | null | [
"Looks like sqlite by default has foreign key support turned off:\r\n\r\nhttp://stackoverflow.com/a/13641365/724251\r\n\r\nNeed to add something like:\r\n\r\n```python\r\nTweet.raw(\"PRAGMA foreign_keys=ON\").execute()\r\n```\r\n\r\nMight be a nicer way included somewhere in the peewee docs.",
"@alexlatchford \r\... | 2017-01-05T15:01:28 | 2017-01-09T21:25:58 | 2017-01-09T21:25:58 | NONE | null | Hi Charles,
i created a table which is related to another table by a ForeignKeyField and on='CASCADE' policy in Sqlite.
It seems like if i delete a record from the parent table, the children are not deleted.
Here is a test that proves that behavior:
https://gist.github.com/aellwein/9e814769196e5524e94199163aa4a0b... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1162/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1162/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1161 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1161/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1161/comments | https://api.github.com/repos/coleifer/peewee/issues/1161/events | https://github.com/coleifer/peewee/issues/1161 | 198,857,436 | MDU6SXNzdWUxOTg4NTc0MzY= | 1,161 | [Feature extension] Add in language option for postgres Match expressions | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"Added in df65b09722bb14b884f89235e09709c4f398a7aa - thanks for your patience. Language is now an optional extra parameter to the `match` and `Match` functions.\r\n\r\n```python\r\nEntity.select().where(Match(Entity.display_name, prefix, 'english'))\r\n# or\r\nEntity.select().where(Entity.display_name.match(prefix,... | 2017-01-05T01:53:59 | 2017-01-30T21:59:36 | 2017-01-30T21:57:19 | CONTRIBUTOR | null | Hey Charles,
I've got a table I've just added fulltext search to, I've added a GIN index to speed up the query but looks like the `Match` expression in the `playhouse.postgres_ext` library isn't extensible enough to be able to make use of the index unfortunately.
Table structure (simplified for brevity):
``` b... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1161/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1161/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1160 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1160/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1160/comments | https://api.github.com/repos/coleifer/peewee/issues/1160/events | https://github.com/coleifer/peewee/issues/1160 | 198,652,615 | MDU6SXNzdWUxOTg2NTI2MTU= | 1,160 | Add a new features for sql output. | {
"login": "b0123456789",
"id": 21169660,
"node_id": "MDQ6VXNlcjIxMTY5NjYw",
"avatar_url": "https://avatars.githubusercontent.com/u/21169660?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/b0123456789",
"html_url": "https://github.com/b0123456789",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [] | 2017-01-04T08:22:33 | 2017-01-09T21:23:12 | 2017-01-09T21:23:12 | NONE | null | I use sql function to get a sql output,but i found that it display this **"('SELECT `t1`.`al_id`, `t1`.`al_uid` FROM `wyx_account_live` AS t1 WHERE ((`t1`.`al_id` > %s) AND (`t1`.`al_platform_type` = %s)) ORDER BY `t1`.`al_id` LIMIT 1', [31, 1])"**.but i hope it output this **"SELECT `t1`.`al_id`, `t1`.`al_uid` FROM `w... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1160/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1160/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1159 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1159/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1159/comments | https://api.github.com/repos/coleifer/peewee/issues/1159/events | https://github.com/coleifer/peewee/issues/1159 | 198,388,213 | MDU6SXNzdWUxOTgzODgyMTM= | 1,159 | create_or_get() uses AND instead of OR | {
"login": "tarashypka",
"id": 15344666,
"node_id": "MDQ6VXNlcjE1MzQ0NjY2",
"avatar_url": "https://avatars.githubusercontent.com/u/15344666?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tarashypka",
"html_url": "https://github.com/tarashypka",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"Looks like the 'get' part in 'create_or_get' uses 'AND' because at that point you would be trying to get a specific record, not a record that looks like the supplied parameters.\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/querying.html#create-or-get\r\n\r\nThe same is true for 'get_or_create', you want that... | 2017-01-02T22:49:52 | 2017-01-03T21:17:52 | 2017-01-03T21:17:52 | NONE | null | Currently, instead of
```
next_with_id, new = ProductCategory.create_or_get(**as_dict(next))
next.id = next_with_id.id
next = next.parent if new else None
```
I am doing
```
try:
with db.atomic():
next.save()
next = next.parent
except IntegrityError:
next = ProductCategory.get(
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1159/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1159/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1158 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1158/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1158/comments | https://api.github.com/repos/coleifer/peewee/issues/1158/events | https://github.com/coleifer/peewee/issues/1158 | 198,025,671 | MDU6SXNzdWUxOTgwMjU2NzE= | 1,158 | Join Query Scopes | {
"login": "jontonsoup",
"id": 845636,
"node_id": "MDQ6VXNlcjg0NTYzNg==",
"avatar_url": "https://avatars.githubusercontent.com/u/845636?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jontonsoup",
"html_url": "https://github.com/jontonsoup",
"followers_url": "https://api.github.com/users/j... | [] | closed | false | null | [] | null | [
"As you said, your issue is a circular import. That's not really an issue peewee is designed to solve. In OO terms you probably need to add a third class that can read both modules and then route your access through that.",
"@coleifer Thanks for taking a look at this!\r\n\r\nAre you familiar with active record? W... | 2016-12-29T15:39:03 | 2016-12-29T23:04:35 | 2016-12-29T22:13:22 | NONE | null | Hi!
I'm trying to put a where statement in a model class and use that in a relation as a scope.
```
class Pizza(Model):
brand = ... blah blah
@classmethod
def where_cheddar(cls):
return cls.toppings.where(Topping.type == "CHEDDAR") #HERE IS AN ERROR / CIRCULAR IMPORT
class Topp... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1158/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/1158/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1157 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1157/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1157/comments | https://api.github.com/repos/coleifer/peewee/issues/1157/events | https://github.com/coleifer/peewee/issues/1157 | 197,552,011 | MDU6SXNzdWUxOTc1NTIwMTE= | 1,157 | multi-table join fail | {
"login": "argpass",
"id": 16532113,
"node_id": "MDQ6VXNlcjE2NTMyMTEz",
"avatar_url": "https://avatars.githubusercontent.com/u/16532113?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/argpass",
"html_url": "https://github.com/argpass",
"followers_url": "https://api.github.com/users/argpas... | [] | closed | false | null | [] | null | [
"Peewee uses a concept called the \"query context\" when building joins. The model being selected, or the last model that was joined, is considered the context. A subsequent call to \".join()\" will be from the query context to the model indicated by the call to join().\r\n\r\nI think you just need to add the appro... | 2016-12-26T07:47:24 | 2016-12-27T16:43:40 | 2016-12-27T16:43:40 | NONE | null | The `Car`:

The `Device`:

The `CarTerminal`:
 than if I generate the sql query myself and run it with db.execute_sql.
I can provide more details if needed, but if the reason i... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1156/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1156/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1155 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1155/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1155/comments | https://api.github.com/repos/coleifer/peewee/issues/1155/events | https://github.com/coleifer/peewee/issues/1155 | 197,371,482 | MDU6SXNzdWUxOTczNzE0ODI= | 1,155 | Error while Connecting using a Database URL | {
"login": "sonam0211",
"id": 20140482,
"node_id": "MDQ6VXNlcjIwMTQwNDgy",
"avatar_url": "https://avatars.githubusercontent.com/u/20140482?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sonam0211",
"html_url": "https://github.com/sonam0211",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Could it have something to do with your connect statement?\r\n\r\n db = connect(os.environ.get('DATABASE_URL' or 'sqlite:///notes.db'))\r\n\r\nShould be:\r\n\r\n db = connect(os.environ.get('DATABASE_URL') or 'sqlite:///notes.db')",
"@CorverDevelopment has it."
] | 2016-12-23T13:43:17 | 2016-12-23T19:06:21 | 2016-12-23T19:06:21 | NONE | null | app.py
```
app = Flask(__name__)
bootstrap = Bootstrap(app)
def setup_db():
create_model_tables([User, Notepad], fail_silently=True)
if __name__ == '__main__':
setup_db()
app.secret_key = 'super_secret_key'
app.run(debug=True)
```
Model.py
```
import os
from peewee import Model, ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1155/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1155/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1154 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1154/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1154/comments | https://api.github.com/repos/coleifer/peewee/issues/1154/events | https://github.com/coleifer/peewee/pull/1154 | 197,085,923 | MDExOlB1bGxSZXF1ZXN0OTkwNDI1MDY= | 1,154 | Small sentence correction | {
"login": "LuckyURE",
"id": 1676008,
"node_id": "MDQ6VXNlcjE2NzYwMDg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1676008?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LuckyURE",
"html_url": "https://github.com/LuckyURE",
"followers_url": "https://api.github.com/users/Lucky... | [] | closed | false | null | [] | null | [
"Thank you!"
] | 2016-12-22T03:18:10 | 2016-12-23T19:12:10 | 2016-12-23T19:12:07 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1154/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1154/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1154",
"html_url": "https://github.com/coleifer/peewee/pull/1154",
"diff_url": "https://github.com/coleifer/peewee/pull/1154.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1154.patch",
"merged_at": "2016-12-23T19:12:07"
} | |
https://api.github.com/repos/coleifer/peewee/issues/1153 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1153/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1153/comments | https://api.github.com/repos/coleifer/peewee/issues/1153/events | https://github.com/coleifer/peewee/pull/1153 | 196,813,431 | MDExOlB1bGxSZXF1ZXN0OTg4NDkxOTk= | 1,153 | Add support for ON CONFLICT DO NOTHING in Postgres. | {
"login": "cassidykelly",
"id": 10568266,
"node_id": "MDQ6VXNlcjEwNTY4MjY2",
"avatar_url": "https://avatars.githubusercontent.com/u/10568266?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cassidykelly",
"html_url": "https://github.com/cassidykelly",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"Will this get merged? Any obvious show-stoppers?",
"Full support for ON CONFLICT is pretty complex. Take a look at this: https://www.postgresql.org/docs/9.5/static/sql-insert.html",
"This feels like a stop-gap implementation. I'd prefer t be comprehensive in implementing this feature, so I'm closing this."
] | 2016-12-21T00:06:06 | 2017-05-23T04:00:51 | 2017-05-23T04:00:51 | CONTRIBUTOR | null | I saw in the documentation there is a plan to add support for Postgres 9.5's ON CONFLICT DO UPDATE (i.e. upsert), but I didn't see any mention of ON CONFLICT DO NOTHING. This is one simple way to support the latter, although it does not support adding a **_conflict_target_**. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1153/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1153/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1153",
"html_url": "https://github.com/coleifer/peewee/pull/1153",
"diff_url": "https://github.com/coleifer/peewee/pull/1153.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1153.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1152 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1152/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1152/comments | https://api.github.com/repos/coleifer/peewee/issues/1152/events | https://github.com/coleifer/peewee/pull/1152 | 196,602,612 | MDExOlB1bGxSZXF1ZXN0OTg2OTc3ODI= | 1,152 | Update playhouse.rst | {
"login": "alprotasov",
"id": 7497700,
"node_id": "MDQ6VXNlcjc0OTc3MDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/7497700?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alprotasov",
"html_url": "https://github.com/alprotasov",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [] | 2016-12-20T07:16:27 | 2017-01-09T21:19:56 | 2017-01-09T21:19:56 | CONTRIBUTOR | null | Misspelling in extension | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1152/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1152/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1152",
"html_url": "https://github.com/coleifer/peewee/pull/1152",
"diff_url": "https://github.com/coleifer/peewee/pull/1152.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1152.patch",
"merged_at": "2017-01-09T21:19:56"
} |
https://api.github.com/repos/coleifer/peewee/issues/1151 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1151/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1151/comments | https://api.github.com/repos/coleifer/peewee/issues/1151/events | https://github.com/coleifer/peewee/issues/1151 | 196,415,184 | MDU6SXNzdWUxOTY0MTUxODQ= | 1,151 | There is no ID field in my table why select will default with it | {
"login": "amosnothing",
"id": 24653016,
"node_id": "MDQ6VXNlcjI0NjUzMDE2",
"avatar_url": "https://avatars.githubusercontent.com/u/24653016?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/amosnothing",
"html_url": "https://github.com/amosnothing",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [] | 2016-12-19T13:36:57 | 2016-12-20T02:55:09 | 2016-12-20T02:55:09 | NONE | null | # my code
class user_account(Model):
user_no = BigIntegerField()
amount = DecimalField()
frozen_amount = DecimalField()
create_time = DateTimeField()
creator = CharField()
edit_time = DateTimeField()
editor = CharField()
is_del = BooleanField()
version = CharField()
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1151/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1151/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1150 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1150/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1150/comments | https://api.github.com/repos/coleifer/peewee/issues/1150/events | https://github.com/coleifer/peewee/issues/1150 | 196,167,048 | MDU6SXNzdWUxOTYxNjcwNDg= | 1,150 | Float gets autoconverted into integer in query | {
"login": "Budovi",
"id": 23473432,
"node_id": "MDQ6VXNlcjIzNDczNDMy",
"avatar_url": "https://avatars.githubusercontent.com/u/23473432?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Budovi",
"html_url": "https://github.com/Budovi",
"followers_url": "https://api.github.com/users/Budovi/fo... | [] | closed | false | null | [] | null | [
"Nice catch.",
"There have been issues raised in the past due to the opposite being the case -- Peewee was *not* converting the value on the right-hand-side to the appropriate data-type. The fix is pretty simple:\r\n\r\n```python\r\nfrom peewee import Passthrough\r\n\r\nTable.select().where(Table.foo * Passthroug... | 2016-12-16T22:21:20 | 2016-12-23T19:11:01 | 2016-12-23T19:11:01 | NONE | null | The following code:
```python
import peeweee
db = peewee.SqliteDatabase(None)
class Table(peewee.Model):
id = peewee.PrimaryKeyField()
foo = peewee.IntegerField()
bar = peewee.IntegerField()
class Meta:
database = db
db.init("test.db")
db.connect()
db.create_tables([Table])
Ta... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1150/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1150/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1149 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1149/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1149/comments | https://api.github.com/repos/coleifer/peewee/issues/1149/events | https://github.com/coleifer/peewee/issues/1149 | 195,984,254 | MDU6SXNzdWUxOTU5ODQyNTQ= | 1,149 | MySQLDatabase object has no attribute '_meta' | {
"login": "ambross",
"id": 19628961,
"node_id": "MDQ6VXNlcjE5NjI4OTYx",
"avatar_url": "https://avatars.githubusercontent.com/u/19628961?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ambross",
"html_url": "https://github.com/ambross",
"followers_url": "https://api.github.com/users/ambros... | [] | closed | false | null | [] | null | [
"Hello should subclass Model, not your database instance."
] | 2016-12-16T05:32:39 | 2016-12-16T15:18:01 | 2016-12-16T15:18:01 | NONE | null | This is my simple code
```
from peewee import *
db = MySQLDatabase('peeweetest',host='localhost',port=3306,user='root',passwd='****')
class Hello(db):
name = CharField()
age = CharField()
class Meta:
database = db
db.connect()
db.create_table(Hello,safe=True)
```
When I run this I get
```
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1149/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1149/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1148 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1148/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1148/comments | https://api.github.com/repos/coleifer/peewee/issues/1148/events | https://github.com/coleifer/peewee/issues/1148 | 195,932,995 | MDU6SXNzdWUxOTU5MzI5OTU= | 1,148 | Schema migrations don't create indexes | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"The code to add an index is tested, so I believe adding an index explicitly should work. You can check the `test_add_index` test-case in `test_migrate.py`.",
"Call Model.create_table(). ",
"Or, oddly, database.create_tables([Model]). The database.create_table method will only create the table, though, whereas ... | 2016-12-15T22:27:49 | 2017-02-27T18:57:29 | 2016-12-30T22:06:36 | CONTRIBUTOR | null | If you're doing a migration and add a column with `index=True` or `unique=True` it doesn't automatically create an index. Even trying to perform a `migrator.add_index()` in the same `migrate()` block fails.
I'm doing this with the Postgres backend. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1148/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1148/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1147 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1147/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1147/comments | https://api.github.com/repos/coleifer/peewee/issues/1147/events | https://github.com/coleifer/peewee/issues/1147 | 195,645,181 | MDU6SXNzdWUxOTU2NDUxODE= | 1,147 | Where is ClosureTable? | {
"login": "Naatan",
"id": 278649,
"node_id": "MDQ6VXNlcjI3ODY0OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/278649?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Naatan",
"html_url": "https://github.com/Naatan",
"followers_url": "https://api.github.com/users/Naatan/follow... | [] | closed | false | null | [] | null | [
"I found the problem, seems ClosureTable does not get defined when using apsw_ext. I'll close this and refile if I find I can't use it from sqlite_ext."
] | 2016-12-14T21:03:52 | 2016-12-14T21:09:53 | 2016-12-14T21:09:45 | NONE | null | See docs:
http://docs.peewee-orm.com/en/latest/peewee/playhouse.html?highlight=apsw#ClosureTable
ClosureTable is not defined. Using it produces an "is not defined" error. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1147/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1147/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1146 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1146/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1146/comments | https://api.github.com/repos/coleifer/peewee/issues/1146/events | https://github.com/coleifer/peewee/issues/1146 | 195,023,258 | MDU6SXNzdWUxOTUwMjMyNTg= | 1,146 | Documentation on Extensions? | {
"login": "Naatan",
"id": 278649,
"node_id": "MDQ6VXNlcjI3ODY0OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/278649?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Naatan",
"html_url": "https://github.com/Naatan",
"followers_url": "https://api.github.com/users/Naatan/follow... | [] | closed | false | null | [] | null | [
"Nevermind, it's there. The header style was throwing me off."
] | 2016-12-12T16:42:24 | 2016-12-12T17:19:51 | 2016-12-12T17:19:50 | NONE | null | I'm interested in SQLITE FTS4, FTS5 and closure tables. Peewee [states to have some form of support for them](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html?highlight=closure#sqlite-ext). However, that's the only mention I see. Are there no docs on what this support actually entails and how I use it? How wo... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1146/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1146/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1145 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1145/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1145/comments | https://api.github.com/repos/coleifer/peewee/issues/1145/events | https://github.com/coleifer/peewee/pull/1145 | 194,868,310 | MDExOlB1bGxSZXF1ZXN0OTc0ODAwMjk= | 1,145 | Remove join predicate requirement for cross joins. | {
"login": "cassidykelly",
"id": 10568266,
"node_id": "MDQ6VXNlcjEwNTY4MjY2",
"avatar_url": "https://avatars.githubusercontent.com/u/10568266?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cassidykelly",
"html_url": "https://github.com/cassidykelly",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"Nice, thanks for the fix."
] | 2016-12-12T00:16:57 | 2016-12-12T22:12:18 | 2016-12-12T22:12:14 | CONTRIBUTOR | null | I was able to run cross join queries after making this change. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1145/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1145/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1145",
"html_url": "https://github.com/coleifer/peewee/pull/1145",
"diff_url": "https://github.com/coleifer/peewee/pull/1145.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1145.patch",
"merged_at": "2016-12-12T22:12:14"
} |
https://api.github.com/repos/coleifer/peewee/issues/1144 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1144/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1144/comments | https://api.github.com/repos/coleifer/peewee/issues/1144/events | https://github.com/coleifer/peewee/issues/1144 | 194,304,023 | MDU6SXNzdWUxOTQzMDQwMjM= | 1,144 | Misunderstanding somethng or weird behaviour ? | {
"login": "stuaxo",
"id": 179677,
"node_id": "MDQ6VXNlcjE3OTY3Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/179677?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stuaxo",
"html_url": "https://github.com/stuaxo",
"followers_url": "https://api.github.com/users/stuaxo/follow... | [] | closed | false | null | [] | null | [
"Worse - if I use\r\n\r\n```\r\nr.filename = filename\r\nr.save()\r\n```\r\nData in other tables seem to get saved, with default values overwriting the proper values.\r\n\r\n(I switched from save() because of this initial problem)... now I've tested going back, it has this other bug.",
"Hi,\r\n I'm going to clo... | 2016-12-08T10:49:18 | 2016-12-12T11:10:37 | 2016-12-09T17:50:05 | NONE | null | I've got a connection to a sqlite db and a table like this one :
```
class Resource(Model):
# [snipped other fields]
filename = CharField(null=True)
```
If I do
```
resources = models.Resource.select().where(models.Resource.filename == None)
for r in resources:
r.update(filename=filename)
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1144/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1144/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1143 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1143/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1143/comments | https://api.github.com/repos/coleifer/peewee/issues/1143/events | https://github.com/coleifer/peewee/issues/1143 | 194,251,196 | MDU6SXNzdWUxOTQyNTExOTY= | 1,143 | About connection pool | {
"login": "521xueweihan",
"id": 8255800,
"node_id": "MDQ6VXNlcjgyNTU4MDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/8255800?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/521xueweihan",
"html_url": "https://github.com/521xueweihan",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"Connections must be closed by the application writer. It is a good practice to ensure that your connections are opened and closed in a sensible way."
] | 2016-12-08T05:35:09 | 2016-12-11T21:19:23 | 2016-12-11T21:19:23 | NONE | null | Hi coleifer,
First peewee is awesome, It is very useful. Thank you.
There I consult for something about `connection pool`. when I use the peewee connection pool, I meet some problem: `Exceeded maximum connections.` and `Error 2006: “MySQL server has gone away”`, so I read document and peewee source code solve th... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1143/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1143/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1142 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1142/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1142/comments | https://api.github.com/repos/coleifer/peewee/issues/1142/events | https://github.com/coleifer/peewee/issues/1142 | 194,148,725 | MDU6SXNzdWUxOTQxNDg3MjU= | 1,142 | Handle change from default null to not null | {
"login": "c0ldcalamari",
"id": 11208820,
"node_id": "MDQ6VXNlcjExMjA4ODIw",
"avatar_url": "https://avatars.githubusercontent.com/u/11208820?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/c0ldcalamari",
"html_url": "https://github.com/c0ldcalamari",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [] | 2016-12-07T19:44:00 | 2016-12-07T19:44:45 | 2016-12-07T19:44:45 | NONE | null | Handle change from default null to not null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1142/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1142/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1141 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1141/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1141/comments | https://api.github.com/repos/coleifer/peewee/issues/1141/events | https://github.com/coleifer/peewee/issues/1141 | 193,399,836 | MDU6SXNzdWUxOTMzOTk4MzY= | 1,141 | No PasswordField in playhouse.fields | {
"login": "Morriaty-The-Murderer",
"id": 12904434,
"node_id": "MDQ6VXNlcjEyOTA0NDM0",
"avatar_url": "https://avatars.githubusercontent.com/u/12904434?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Morriaty-The-Murderer",
"html_url": "https://github.com/Morriaty-The-Murderer",
"followers_... | [] | closed | false | null | [] | null | [
"Sorry for ignoring this tip\r\n>Note\r\n>This field requires bcrypt, which can be installed by running pip install bcrypt."
] | 2016-12-05T02:49:42 | 2016-12-05T02:58:54 | 2016-12-05T02:58:54 | NONE | null | Hi
I got an error when trying to import PasswordField. Then I checked this
```python
>>> from playhouse import fields
>>> fields.P
fields.PY2 fields.PickledField( fields.PrimaryKeyField( fields.Proxy(
fields.Param( fields.PostgresqlDatabase( fields.ProgrammingError( ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1141/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1141/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1140 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1140/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1140/comments | https://api.github.com/repos/coleifer/peewee/issues/1140/events | https://github.com/coleifer/peewee/issues/1140 | 193,348,989 | MDU6SXNzdWUxOTMzNDg5ODk= | 1,140 | Model.get_or_none | {
"login": "razodactyl",
"id": 1160532,
"node_id": "MDQ6VXNlcjExNjA1MzI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1160532?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/razodactyl",
"html_url": "https://github.com/razodactyl",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"I'm currently using this on my 'BaseModel' implementation which is a subclass of 'db.Model' which came from the FlaskDB helper.\r\n\r\n```\r\nclass BaseModel(db.Model):\r\n @classmethod\r\n def get_or_none(cls, *query, **kwargs):\r\n try:\r\n return cls.get(*query)\r\n except cls.Doe... | 2016-12-04T12:46:09 | 2016-12-11T21:17:30 | 2016-12-11T21:17:30 | NONE | null | I think the only place I found this behaviour was in the Dataset utility.
Usually, to get a row you would use Model.get.
However, if the row doesn't exist, a DoesNotExist is thrown.
I propose a 'get_or_none' function to return None instead of throwing an error, in this way, you can simply query a record and have... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1140/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1140/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1139 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1139/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1139/comments | https://api.github.com/repos/coleifer/peewee/issues/1139/events | https://github.com/coleifer/peewee/pull/1139 | 193,293,341 | MDExOlB1bGxSZXF1ZXN0OTY0MDA2NDI= | 1,139 | Fixed renaming unique foreign key in MySQL | {
"login": "dext0r",
"id": 3103856,
"node_id": "MDQ6VXNlcjMxMDM4NTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/3103856?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dext0r",
"html_url": "https://github.com/dext0r",
"followers_url": "https://api.github.com/users/dext0r/foll... | [] | closed | false | null | [] | null | [
"gametight, thanks!"
] | 2016-12-03T15:25:00 | 2016-12-11T21:28:10 | 2016-12-11T21:28:10 | CONTRIBUTOR | null | When i trying to rename unique foreign key in MySQL, i got error:
`peewee.OperationalError: (1091, "Can't DROP '...'; check that column/key exists")`
Here is a demo code:
```python
# coding: utf8
import logging
from peewee import MySQLDatabase, Model, ForeignKeyField, IntegerField
from playhouse.migrate imp... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1139/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1139/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1139",
"html_url": "https://github.com/coleifer/peewee/pull/1139",
"diff_url": "https://github.com/coleifer/peewee/pull/1139.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1139.patch",
"merged_at": "2016-12-11T21:28:10"
} |
https://api.github.com/repos/coleifer/peewee/issues/1138 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1138/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1138/comments | https://api.github.com/repos/coleifer/peewee/issues/1138/events | https://github.com/coleifer/peewee/issues/1138 | 193,201,609 | MDU6SXNzdWUxOTMyMDE2MDk= | 1,138 | peewee connection pooling returns broken connections from the pool | {
"login": "c0ldcalamari",
"id": 11208820,
"node_id": "MDQ6VXNlcjExMjA4ODIw",
"avatar_url": "https://avatars.githubusercontent.com/u/11208820?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/c0ldcalamari",
"html_url": "https://github.com/c0ldcalamari",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"Merged 082f13bf6b3a740c07bf35dafaf699e236b097e1"
] | 2016-12-02T19:46:06 | 2017-01-30T22:12:20 | 2017-01-30T22:12:20 | NONE | null | If you execute some bad SQL like `select * from not_a_table;` postgres will leave you in a [CONNECTION_BAD](https://www.postgresql.org/docs/9.1/static/libpq-status.html) state. Requiring you to rollback or reset the connection before continuing. Peewee intentionally leaves this up to the user to handle (either throug... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1138/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1138/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1137 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1137/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1137/comments | https://api.github.com/repos/coleifer/peewee/issues/1137/events | https://github.com/coleifer/peewee/pull/1137 | 193,201,207 | MDExOlB1bGxSZXF1ZXN0OTYzNDA1ODc= | 1,137 | fix bad pg connections before returning to pool | {
"login": "c0ldcalamari",
"id": 11208820,
"node_id": "MDQ6VXNlcjExMjA4ODIw",
"avatar_url": "https://avatars.githubusercontent.com/u/11208820?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/c0ldcalamari",
"html_url": "https://github.com/c0ldcalamari",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"This is fantastic, thank you. I will merge, but I'd like to tighten up the API first. Thanks again.",
"I've made some small cleanups/changes to the APIs but this feature is now merged. Thanks again.\r\n\r\n082f13bf6b3a740c07bf35dafaf699e236b097e1"
] | 2016-12-02T19:44:20 | 2017-01-30T22:11:58 | 2017-01-30T22:11:58 | NONE | null | For https://github.com/coleifer/peewee/issues/1138
Thanks! | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1137/reactions",
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 1,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1137/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1137",
"html_url": "https://github.com/coleifer/peewee/pull/1137",
"diff_url": "https://github.com/coleifer/peewee/pull/1137.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1137.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1136 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1136/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1136/comments | https://api.github.com/repos/coleifer/peewee/issues/1136/events | https://github.com/coleifer/peewee/issues/1136 | 193,170,342 | MDU6SXNzdWUxOTMxNzAzNDI= | 1,136 | Remove `*` imports in doc | {
"login": "maxnoe",
"id": 5488440,
"node_id": "MDQ6VXNlcjU0ODg0NDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/5488440?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/maxnoe",
"html_url": "https://github.com/maxnoe",
"followers_url": "https://api.github.com/users/maxnoe/foll... | [] | closed | false | null | [] | null | [
"Yeah, I hear that. I guess, as the author, I'm always aware of that stuff but I can see how it would be super confusing in the docs. I'll update them as I find the time.",
"Well, I looked into this a bit. The `import *` are actually necessary in some places because extension modules typically will shadow peewee ... | 2016-12-02T17:17:30 | 2016-12-30T21:54:56 | 2016-12-30T21:54:56 | NONE | null | The one thing that often tends to annoy me when reading the docs is the use of `from peewee import *` or `from playhouse.migrate import *`.
One never really knows where stuff comes from. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1136/reactions",
"total_count": 3,
"+1": 3,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1136/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1135 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1135/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1135/comments | https://api.github.com/repos/coleifer/peewee/issues/1135/events | https://github.com/coleifer/peewee/issues/1135 | 192,666,006 | MDU6SXNzdWUxOTI2NjYwMDY= | 1,135 | Possibility to exclude certain columns from default selection | {
"login": "maxnoe",
"id": 5488440,
"node_id": "MDQ6VXNlcjU0ODg0NDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/5488440?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/maxnoe",
"html_url": "https://github.com/maxnoe",
"followers_url": "https://api.github.com/users/maxnoe/foll... | [] | closed | false | null | [] | null | [
"Just write a custom method."
] | 2016-11-30T20:08:54 | 2016-12-11T21:24:47 | 2016-12-11T21:24:47 | NONE | null | The default for `peewees` `select()` is to request all columns.
Could it be possible to exclude columns from this selection?
E.g. something like:
```python
class MyModel(Model):
x = FloatField()
data = BlobField()
class Meta:
database = database
exclude_from_default_select... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1135/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1135/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1134 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1134/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1134/comments | https://api.github.com/repos/coleifer/peewee/issues/1134/events | https://github.com/coleifer/peewee/pull/1134 | 190,485,525 | MDExOlB1bGxSZXF1ZXN0OTQ0NzU4ODI= | 1,134 | Fixed db_field for DateTimeTz in postgres_ext | {
"login": "kammala",
"id": 4599701,
"node_id": "MDQ6VXNlcjQ1OTk3MDE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4599701?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kammala",
"html_url": "https://github.com/kammala",
"followers_url": "https://api.github.com/users/kammala/... | [] | closed | false | null | [] | null | [] | 2016-11-19T08:55:04 | 2016-11-19T17:01:00 | 2016-11-19T17:01:00 | CONTRIBUTOR | null | cause since 9.6 `datetime_tz` is not supported. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1134/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1134/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1134",
"html_url": "https://github.com/coleifer/peewee/pull/1134",
"diff_url": "https://github.com/coleifer/peewee/pull/1134.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1134.patch",
"merged_at": "2016-11-19T17:01:00"
} |
https://api.github.com/repos/coleifer/peewee/issues/1133 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1133/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1133/comments | https://api.github.com/repos/coleifer/peewee/issues/1133/events | https://github.com/coleifer/peewee/issues/1133 | 190,249,810 | MDU6SXNzdWUxOTAyNDk4MTA= | 1,133 | DecimalField field does not attempt to coerce/convert values | {
"login": "talawahtech",
"id": 2263809,
"node_id": "MDQ6VXNlcjIyNjM4MDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/2263809?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/talawahtech",
"html_url": "https://github.com/talawahtech",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"If `auto_round` is set to `True` then peewee will call `str()` on the value before passing it into the `Decimal` constructor. Otherwise, peewee passes the value back to the database as-is.\n\nOn the other side, when loading values from the db into python, Peewee will convert the value to a string then pass it in t... | 2016-11-18T06:59:46 | 2016-11-22T10:40:08 | 2016-11-22T10:40:08 | NONE | null | I have noticed that unlike most other numeric fields, DecimalField does not attempt to coerce/convert values (e.g. strings) before inserting them into the database.
Is there a specific reason for this or is it just an oversight. Seems like it would to be consistent with the behavior of IntegerField and FloatField | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1133/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1133/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1132 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1132/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1132/comments | https://api.github.com/repos/coleifer/peewee/issues/1132/events | https://github.com/coleifer/peewee/issues/1132 | 190,248,099 | MDU6SXNzdWUxOTAyNDgwOTk= | 1,132 | Max recursion depth exceeded - JSON Type query w/ Postgresql | {
"login": "wmturner",
"id": 10918018,
"node_id": "MDQ6VXNlcjEwOTE4MDE4",
"avatar_url": "https://avatars.githubusercontent.com/u/10918018?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wmturner",
"html_url": "https://github.com/wmturner",
"followers_url": "https://api.github.com/users/wmt... | [] | closed | false | null | [] | null | [
"The problem appears to be that you're using `PostgresqlDatabase` as opposed to `PostgresqlExtDatabase`. The former does not know how to parse JSON things into SQL, while the latter does. I admit the error message could be more helpful, but that's the issue. If you switch your DB initialization you'll be set.\n",
... | 2016-11-18T06:46:25 | 2016-11-22T03:51:05 | 2016-11-18T19:02:04 | NONE | null | Hello,
I'm just getting started with peewee and am using Postgresql with a few JSON type columns. When trying to query on one of the elements in the JSON document I get a maximum recursion level exceeded error.
The code I have so far is here: https://gist.github.com/wmturner/7288bbf715d81df916cb6b561057e490
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1132/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1132/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1131 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1131/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1131/comments | https://api.github.com/repos/coleifer/peewee/issues/1131/events | https://github.com/coleifer/peewee/issues/1131 | 189,704,659 | MDU6SXNzdWUxODk3MDQ2NTk= | 1,131 | Math operators in query | {
"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 | [
"What errors do you receive? \nWhat SQL is composed?\n",
"Well, `fn.current_date` should be written as: `fn.current_date()`, unless that's some magical name in which case you should just write `SQL('current_date')`.\n\nMath operators work as you'd expect, so theoretically your query would work provided your datab... | 2016-11-16T13:32:19 | 2016-11-18T00:44:53 | 2016-11-17T17:54:46 | NONE | null | Hi!
I have a `peewee.DateTimeField`in my model. And I need calculate duration between date in this field and current date in days.
```python
from peewee import DatetTimeField, fn
from playhouse.shortcuts import cast
from config import db
from datetime import datetime
class Table(db.Model):
ts = DateTimeFi... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1131/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1131/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1130 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1130/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1130/comments | https://api.github.com/repos/coleifer/peewee/issues/1130/events | https://github.com/coleifer/peewee/issues/1130 | 188,955,614 | MDU6SXNzdWUxODg5NTU2MTQ= | 1,130 | Not able to query in ForeignKeyField | {
"login": "rahul3103",
"id": 10813252,
"node_id": "MDQ6VXNlcjEwODEzMjUy",
"avatar_url": "https://avatars.githubusercontent.com/u/10813252?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rahul3103",
"html_url": "https://github.com/rahul3103",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"You're close, you would write it as:\n\n``` python\nMenuItem.select().join(Restaurant).where(Restaurant.name == name)\n\nMenuItem.select().where(MenuItem.restaurant == restaurant_id)\n```\n",
"Thanks\n"
] | 2016-11-13T06:40:22 | 2016-11-14T05:12:16 | 2016-11-13T21:58:27 | NONE | null | My `model.py`
```python
from peewee import Model, CharField
from playhouse.sqlite_ext import ForeignKeyField
from playhouse.pool import SqliteExtDatabase
import settings
db = SqliteExtDatabase(settings.DB_NAME)
class BaseModel(Model):
"""A base model tha... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1130/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1130/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1129 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1129/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1129/comments | https://api.github.com/repos/coleifer/peewee/issues/1129/events | https://github.com/coleifer/peewee/issues/1129 | 188,796,879 | MDU6SXNzdWUxODg3OTY4Nzk= | 1,129 | Extending PooledDatabase to optionally wait before throwing the "Exceeded maximum connections" exception | {
"login": "decoratorz",
"id": 8288881,
"node_id": "MDQ6VXNlcjgyODg4ODE=",
"avatar_url": "https://avatars.githubusercontent.com/u/8288881?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/decoratorz",
"html_url": "https://github.com/decoratorz",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"Well, theoretically you could implement this yourself by putting some kind of polling around the connect method. I think it'd require some re-architecting to get this working more generally. I'll think about it.\n",
"I've added this feature. You can now specify a `timeout` when instantiating a subclass of `Poole... | 2016-11-11T16:25:57 | 2016-12-30T22:23:53 | 2016-12-30T22:23:18 | NONE | null | We need to extend the Peewee's pool implementation with the timeout option which would allow to wait some time for connection when a pool is full instead of always throwing an exception immediately. The aim is to do it "the right way" and have this change merged upstream.
Problem is, it's hard to do locally in pla... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1129/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1129/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1128 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1128/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1128/comments | https://api.github.com/repos/coleifer/peewee/issues/1128/events | https://github.com/coleifer/peewee/issues/1128 | 188,696,832 | MDU6SXNzdWUxODg2OTY4MzI= | 1,128 | How can I omit creation of a field but still have it in my model? | {
"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 | [
"Maybe there is an easier way to do what I want, by somehow cheating in `MyModel.create()`, but I don't understand how.\n",
"Just added \"undeclared\" option, which was useful to me for a similar thing in SQLite regarding the \"rowid\" field. Commit: eebbed7a5e1c6b3318bcbe6525ea80d900ee1f12\n"
] | 2016-11-11T06:51:41 | 2016-11-11T21:45:40 | 2016-11-11T21:45:40 | CONTRIBUTOR | null | I'm using PostgreSQL. In one of my models I try to declare field named `tableoid`. This is a special field in PostgreSQL which is created automatically. So this always works:
```sql
select foo.tableoid from foo;
```
But the field cannot be created manually:
```sql
create table foo (tableoid int);
-- ERROR:... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1128/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1128/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1127 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1127/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1127/comments | https://api.github.com/repos/coleifer/peewee/issues/1127/events | https://github.com/coleifer/peewee/issues/1127 | 188,630,656 | MDU6SXNzdWUxODg2MzA2NTY= | 1,127 | Postgres serial column but not primary key | {
"login": "chuckhacker",
"id": 143290,
"node_id": "MDQ6VXNlcjE0MzI5MA==",
"avatar_url": "https://avatars.githubusercontent.com/u/143290?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/chuckhacker",
"html_url": "https://github.com/chuckhacker",
"followers_url": "https://api.github.com/user... | [] | closed | false | null | [] | null | [
"Adding a custom field is extremely easy: http://docs.peewee-orm.com/en/latest/peewee/models.html#creating-a-custom-field\n\nI think that's probably what you'll want to do, add a `SerialField`.\n",
"Thanks, that's very helpful (although a trivial, common built-in type like `serial` should have already a `SerialFi... | 2016-11-10T22:02:59 | 2017-02-02T19:33:12 | 2016-11-11T06:12:47 | NONE | null | `PrimaryKeyField` maps to the Postgres `serial` type, but it appears that there are indeed extra semantics forcing it to be a primary key (after all, one would guess that would be the case, given the name _PrimaryKey_Field).
Since I already have another field that is a primary key (but is not a serial, yeah, I know.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1127/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1127/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1126 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1126/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1126/comments | https://api.github.com/repos/coleifer/peewee/issues/1126/events | https://github.com/coleifer/peewee/pull/1126 | 188,501,046 | MDExOlB1bGxSZXF1ZXN0OTMxNDUwNzM= | 1,126 | Make pskel script installable under usr/bin/ | {
"login": "stratakis",
"id": 14812606,
"node_id": "MDQ6VXNlcjE0ODEyNjA2",
"avatar_url": "https://avatars.githubusercontent.com/u/14812606?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stratakis",
"html_url": "https://github.com/stratakis",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Thanks!\n"
] | 2016-11-10T12:53:11 | 2016-11-10T17:33:55 | 2016-11-10T17:33:51 | CONTRIBUTOR | null | Currently since pskel script does not have the .py extension, nothing happens when invoking setup.py install with that script. It just exists at the sources. The simplest way to make this script get installed is by adding it at the scripts sections in setup.py, thus making it installable under usr/bin/. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1126/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1126/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1126",
"html_url": "https://github.com/coleifer/peewee/pull/1126",
"diff_url": "https://github.com/coleifer/peewee/pull/1126.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1126.patch",
"merged_at": "2016-11-10T17:33:51"
} |
https://api.github.com/repos/coleifer/peewee/issues/1125 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1125/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1125/comments | https://api.github.com/repos/coleifer/peewee/issues/1125/events | https://github.com/coleifer/peewee/issues/1125 | 188,414,553 | MDU6SXNzdWUxODg0MTQ1NTM= | 1,125 | aggregate_rows() [+ switch()] + get() don't play nicely | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"PS. I know this is likely to cause performance issues when used on large datasets but the joins I'm looking to make are not huge 2-3 rows in each so figured I'd try this syntax to bundle up the network calls into a single query :)\n",
"This is documented, in [\"Using aggregate_rows\"](http://docs.peewee-orm.com/... | 2016-11-10T03:53:38 | 2016-11-13T22:31:16 | 2016-11-13T22:31:16 | CONTRIBUTOR | null | Not sure if this is a documented feature, but I'd love to use it if it was! Essentially prefetch for `get()` :D
If you're trying to aggregate multiple joins and backtracking using the `switch()` this results in some unexpected behaviour.
```python
from peewee import *
db = SqliteDatabase(":memory:")
db.conne... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1125/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1125/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1124 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1124/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1124/comments | https://api.github.com/repos/coleifer/peewee/issues/1124/events | https://github.com/coleifer/peewee/issues/1124 | 188,408,027 | MDU6SXNzdWUxODg0MDgwMjc= | 1,124 | the field can't named 'model'? | {
"login": "msean",
"id": 13687394,
"node_id": "MDQ6VXNlcjEzNjg3Mzk0",
"avatar_url": "https://avatars.githubusercontent.com/u/13687394?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/msean",
"html_url": "https://github.com/msean",
"followers_url": "https://api.github.com/users/msean/follow... | [] | closed | false | null | [] | null | [] | 2016-11-10T02:53:16 | 2016-11-10T02:58:55 | 2016-11-10T02:58:55 | NONE | null | In Test Model,It set a field named 'model':
`class Test(peewee.Model):
model = peewee.CharField(max_length=64, null=True)
class Meta:
database = DATABASE
db_table = 'test'
schema = 'opr'
`
It happened error :
`File "/home/mwh/py3workplace/workplace/ad_tornado/handlers/opr.py"... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1124/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1124/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1123 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1123/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1123/comments | https://api.github.com/repos/coleifer/peewee/issues/1123/events | https://github.com/coleifer/peewee/issues/1123 | 188,408,016 | MDU6SXNzdWUxODg0MDgwMTY= | 1,123 | the field can't named 'model'? | {
"login": "msean",
"id": 13687394,
"node_id": "MDQ6VXNlcjEzNjg3Mzk0",
"avatar_url": "https://avatars.githubusercontent.com/u/13687394?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/msean",
"html_url": "https://github.com/msean",
"followers_url": "https://api.github.com/users/msean/follow... | [] | closed | false | null | [] | null | [
"Please take the 10seconds and format your code...\n",
"In My Test Model,It set a field named 'model':\n\n```\nimport peewee\nclass Test(peewee.Model):\n model = peewee.CharField(max_length=64, null=True)\n class Meta:\n database = DATABASE\n db_table = 'test'\n schema = 'opr'\n```\n\n... | 2016-11-10T02:53:07 | 2016-11-10T17:39:44 | 2016-11-10T17:38:25 | NONE | null | In Test Model,It set a field named 'model':
class Test(peewee.Model):
model = peewee.CharField(max_length=64, null=True)
class Meta:
database = DATABASE
db_table = "test"
schema = "opr"
It happened error :
`File "/home/mwh/py3workplace/workplace/ad_to... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1123/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1123/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1122 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1122/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1122/comments | https://api.github.com/repos/coleifer/peewee/issues/1122/events | https://github.com/coleifer/peewee/pull/1122 | 188,288,362 | MDExOlB1bGxSZXF1ZXN0OTI5OTMwOTQ= | 1,122 | Fix pskel print statement for python3 compatibility | {
"login": "stratakis",
"id": 14812606,
"node_id": "MDQ6VXNlcjE0ODEyNjA2",
"avatar_url": "https://avatars.githubusercontent.com/u/14812606?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stratakis",
"html_url": "https://github.com/stratakis",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Whoops! Thank you.\n"
] | 2016-11-09T16:21:47 | 2016-11-09T16:42:19 | 2016-11-09T16:42:15 | CONTRIBUTOR | null | Invoking pskel under python3 produces an error due to the usage of print statement without parenthesis. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1122/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1122/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1122",
"html_url": "https://github.com/coleifer/peewee/pull/1122",
"diff_url": "https://github.com/coleifer/peewee/pull/1122.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1122.patch",
"merged_at": "2016-11-09T16:42:15"
} |
https://api.github.com/repos/coleifer/peewee/issues/1121 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1121/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1121/comments | https://api.github.com/repos/coleifer/peewee/issues/1121/events | https://github.com/coleifer/peewee/issues/1121 | 187,903,128 | MDU6SXNzdWUxODc5MDMxMjg= | 1,121 | Issue using FlaskDB and create_tables | {
"login": "bwghughes",
"id": 7694,
"node_id": "MDQ6VXNlcjc2OTQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/7694?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bwghughes",
"html_url": "https://github.com/bwghughes",
"followers_url": "https://api.github.com/users/bwghughes/fo... | [] | closed | false | null | [] | null | [
"Subclassing `db_wrapper.model` obviates the need for a Meta: database definition. Furthermore, your \"Meta\" database should always be the un-wrapped Peewee db.\n\nThis is sufficient, though -- just remove the \"Meta\":\n\n```\nclass JobCodeEntry(db_wrapper.Model):\n date = DateField(default=date.today)\n co... | 2016-11-08T05:07:12 | 2016-11-08T10:56:32 | 2016-11-08T06:18:27 | NONE | null | With the following code:
```python
import os
from datetime import date
from flask import Flask, request, render_template
from flask.views import MethodView
from peewee import *
from playhouse.flask_utils import FlaskDB
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1121/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1121/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1120 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1120/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1120/comments | https://api.github.com/repos/coleifer/peewee/issues/1120/events | https://github.com/coleifer/peewee/issues/1120 | 187,771,472 | MDU6SXNzdWUxODc3NzE0NzI= | 1,120 | Document (optional) requirements | {
"login": "vkrizan",
"id": 7695766,
"node_id": "MDQ6VXNlcjc2OTU3NjY=",
"avatar_url": "https://avatars.githubusercontent.com/u/7695766?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vkrizan",
"html_url": "https://github.com/vkrizan",
"followers_url": "https://api.github.com/users/vkrizan/... | [] | closed | false | null | [] | null | [
"Certainly, thanks for the nudge.\n"
] | 2016-11-07T17:14:44 | 2016-11-08T02:05:17 | 2016-11-08T02:05:17 | NONE | null | Please document (optional) requirements in one document (or file). This will help first-timers and help when packaging (RPM, deb).
Requirements for playhouse extensions (so far I've identified these):
```
Cython # optional for speedups
simplejson # optional for playhouse.kv and playhouse.sqlite_ext (json is... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1120/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1120/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1119 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1119/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1119/comments | https://api.github.com/repos/coleifer/peewee/issues/1119/events | https://github.com/coleifer/peewee/issues/1119 | 187,522,097 | MDU6SXNzdWUxODc1MjIwOTc= | 1,119 | Set PostgreSQL schema in atomic | {
"login": "shanavar",
"id": 1556149,
"node_id": "MDQ6VXNlcjE1NTYxNDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1556149?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/shanavar",
"html_url": "https://github.com/shanavar",
"followers_url": "https://api.github.com/users/shana... | [] | closed | false | null | [] | null | [
"Yes, you can simply set `MyModel._meta.schema`. I'm not sure what it means to run a transaction against one schema...or how that works. I guess I thought a table lived in one schema, so the idea of switching it's schema to do a transaction should imply you're working with an entirely different table??\n",
"Yes. ... | 2016-11-05T20:46:29 | 2016-11-07T13:13:44 | 2016-11-07T13:13:43 | NONE | null | Hey everybody,
so I got a problem regarding schema selection with peewee and PostgreSQL. I use peewee almost exclusively in transaction mode with `atomic`. While the schema is set to `none` in the meta of the class, I would want to set a specific schema in the `atomic` block. All queries in the atomic block should n... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1119/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1119/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.