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/314 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/314/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/314/comments | https://api.github.com/repos/coleifer/peewee/issues/314/events | https://github.com/coleifer/peewee/pull/314 | 28,606,035 | MDExOlB1bGxSZXF1ZXN0MTMxMDQ2NDY= | 314 | Default logger handler if none is specified | {
"login": "bndr",
"id": 1145456,
"node_id": "MDQ6VXNlcjExNDU0NTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1145456?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bndr",
"html_url": "https://github.com/bndr",
"followers_url": "https://api.github.com/users/bndr/followers",
... | [] | closed | false | null | [] | null | [
"Works for me, thanks!\n"
] | 2014-03-03T08:41:39 | 2014-06-24T04:48:28 | 2014-03-03T15:02:55 | CONTRIBUTOR | null | This should stop showing warnings: "No handlers could be found for logger "peewee"" if no handler is specified.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/314/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/314/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/314",
"html_url": "https://github.com/coleifer/peewee/pull/314",
"diff_url": "https://github.com/coleifer/peewee/pull/314.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/314.patch",
"merged_at": "2014-03-03T15:02:55"
} |
https://api.github.com/repos/coleifer/peewee/issues/313 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/313/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/313/comments | https://api.github.com/repos/coleifer/peewee/issues/313/events | https://github.com/coleifer/peewee/issues/313 | 28,448,577 | MDU6SXNzdWUyODQ0ODU3Nw== | 313 | Playhouse GFK issue with IN statement | {
"login": "thibaultmeyer",
"id": 1005086,
"node_id": "MDQ6VXNlcjEwMDUwODY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1005086?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/thibaultmeyer",
"html_url": "https://github.com/thibaultmeyer",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"Thanks, looking.\n",
"The attribute error shouldn't occur, but I will also add that unfortunately you cannot query GFK's like that.\n\nYour query:\n\n``` python\nTag.select().where(Tag.object << Photo.select().where(Photo.published==True))\n```\n\nTo accomplish what you're going for, you'll want to:\n\n``` pytho... | 2014-02-27T19:49:35 | 2016-01-21T15:32:06 | 2016-01-20T17:09:46 | NONE | null | Hi,
i have an issue with the Generic FK (playhouse) when I apply the MySQL IN statement.
``` python
class Tag(Model):
tag = CharField()
object_type = CharField(null=True)
object_id = IntegerField(null=True)
object = GFKField('object_type', 'object_id')
class Blog(Model):
tags = ReverseGFK(Tag, '... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/313/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/313/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/312 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/312/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/312/comments | https://api.github.com/repos/coleifer/peewee/issues/312/events | https://github.com/coleifer/peewee/pull/312 | 28,090,405 | MDExOlB1bGxSZXF1ZXN0MTI4MjA1MjI= | 312 | Added a debug feature for the Database class | {
"login": "pydeveloper94",
"id": 6692874,
"node_id": "MDQ6VXNlcjY2OTI4NzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/6692874?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pydeveloper94",
"html_url": "https://github.com/pydeveloper94",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"I'm not sure I understand these changes.\n",
"http://peewee.readthedocs.org/en/latest/peewee/cookbook.html#logging-queries\n",
"The developer is not able to choose whether or not they want to disable the logger providing debug output. You gave a solution here, https://github.com/coleifer/peewee/issues/254, to ... | 2014-02-22T06:08:21 | 2014-07-01T00:04:31 | 2014-02-23T13:22:12 | NONE | null | I changed the Database class so that you can choose to enable logging. For example,
```
db = SqliteDatabase('data.sqlite3', debug=True)
```
will enable the logger to log messages onto the console while the python interpreter is running.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/312/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/312/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/312",
"html_url": "https://github.com/coleifer/peewee/pull/312",
"diff_url": "https://github.com/coleifer/peewee/pull/312.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/312.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/311 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/311/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/311/comments | https://api.github.com/repos/coleifer/peewee/issues/311/events | https://github.com/coleifer/peewee/issues/311 | 27,742,392 | MDU6SXNzdWUyNzc0MjM5Mg== | 311 | Bulk loading | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [
"http://peewee.readthedocs.org/en/latest/peewee/cookbook.html#bulk-inserts\n",
"Hey, did you ever finish the page for bulk inserts? I'm having very poor performance inserting bulk data with `atomic` and `insert_many` on my model?\n",
"http://docs.peewee-orm.com/en/latest/peewee/querying.html#bulk-inserts\n\nWha... | 2014-02-17T19:05:42 | 2016-06-01T15:26:28 | 2014-02-20T17:26:36 | OWNER | null | Bulk loading performance improvements, see Maxime's post on mailing list.
```
$ python AAA.py
How many lines to insert ?50000
One Big Query
('Done in ',0.3364,'seconds')
Many queries, no transaction
('Done in ',453.3142,'seconds')
Many queries, using transaction
('Done in ',9.6940,'seconds')
```
``` python
#!/usr/bin... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/311/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/311/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/310 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/310/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/310/comments | https://api.github.com/repos/coleifer/peewee/issues/310/events | https://github.com/coleifer/peewee/issues/310 | 27,666,937 | MDU6SXNzdWUyNzY2NjkzNw== | 310 | pwiz breaks with a table named `servers` on mysql | {
"login": "g3rv4",
"id": 6250774,
"node_id": "MDQ6VXNlcjYyNTA3NzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/6250774?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/g3rv4",
"html_url": "https://github.com/g3rv4",
"followers_url": "https://api.github.com/users/g3rv4/follower... | [] | closed | false | null | [] | null | [
"Are you sure the problem is the foreign key to `servers`? Can you create a test-case?\n",
"I'd love to. Do you have an example of a test case? I'm just getting started with python\n",
"I don't see `servers` listed in mysql's reserved words list: https://dev.mysql.com/doc/refman/5.5/en/reserved-words.html\n",
... | 2014-02-16T09:11:01 | 2014-02-19T14:31:10 | 2014-02-19T14:31:10 | NONE | null | If you have a table named `servers` on mysql (and a FK to it), pwiz fails with
```
Traceback (most recent call last):
File "env/bin/pwiz.py", line 540, in <module>
print_models(options.engine, database, tables, **connect)
File "env/bin/pwiz.py", line 444, in print_models
models, table_to_model, table_fks, ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/310/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/310/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/309 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/309/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/309/comments | https://api.github.com/repos/coleifer/peewee/issues/309/events | https://github.com/coleifer/peewee/issues/309 | 27,497,074 | MDU6SXNzdWUyNzQ5NzA3NA== | 309 | How to reference specific field with ForeignKeyField | {
"login": "wcbeard",
"id": 379413,
"node_id": "MDQ6VXNlcjM3OTQxMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/379413?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wcbeard",
"html_url": "https://github.com/wcbeard",
"followers_url": "https://api.github.com/users/wcbeard/fo... | [] | closed | false | null | [] | null | [
"I've got a commit or two towards making this work, almost there.\n",
"Added. http://peewee.readthedocs.org/en/latest/peewee/api.html#ForeignKeyField\n"
] | 2014-02-13T06:21:20 | 2014-02-18T21:22:03 | 2014-02-18T21:22:03 | NONE | null | I'm trying to find a way to use a `ForeignKeyField` that refers to a specific field of another model, rather than the entire model itself. I believe in Django's ORM it's the [`to_field`](https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.to_field) attribute.
Looking at the [source cod... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/309/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/309/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/308 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/308/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/308/comments | https://api.github.com/repos/coleifer/peewee/issues/308/events | https://github.com/coleifer/peewee/pull/308 | 27,414,293 | MDExOlB1bGxSZXF1ZXN0MTI0NTEzNTI= | 308 | refactored _parse to run isinstance less. | {
"login": "danthedeckie",
"id": 1070206,
"node_id": "MDQ6VXNlcjEwNzAyMDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1070206?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/danthedeckie",
"html_url": "https://github.com/danthedeckie",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"I had shied away from this previously because I didn't want to tangle up `Node` objects with their SQL representations, but this has actually caused some pain when wanting to add new Node types (i.e. the `unknown` grossness). Maybe this is a good path forward, I certainly have been aware that the recent refactorin... | 2014-02-12T07:13:19 | 2014-07-06T01:50:20 | 2014-04-22T14:23:28 | NONE | null | I was importing some data, and found it running slower than I thought it should. I profiled, and found that the `_parse` function was taking the longest, and that `isinstance` was getting called 259579 times, which was taking a good chunk of it. I've (very naively) refactored the `QueryCompiler._parse_node` function t... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/308/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/308/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/308",
"html_url": "https://github.com/coleifer/peewee/pull/308",
"diff_url": "https://github.com/coleifer/peewee/pull/308.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/308.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/307 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/307/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/307/comments | https://api.github.com/repos/coleifer/peewee/issues/307/events | https://github.com/coleifer/peewee/issues/307 | 27,410,336 | MDU6SXNzdWUyNzQxMDMzNg== | 307 | request: reflect major changes in the source code tarball in the ChangeLog | {
"login": "pitchforks",
"id": 4378791,
"node_id": "MDQ6VXNlcjQzNzg3OTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4378791?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pitchforks",
"html_url": "https://github.com/pitchforks",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"This was an oversight on my part. I re-pushed the 2.2.1 release so hopefully that fixes things. Thank you for bringing this to my attention.\n"
] | 2014-02-12T05:06:26 | 2014-02-12T16:30:22 | 2014-02-12T16:30:22 | NONE | null | I have noticed that the source code tarball for 2.2.1 is much smaller. Apparently it's because 2.2.1 doesn't ship docs in HTML form anymore. There wasn't anything in the ChangeLog about it so I've only noticed it when my build script failed and I had a closer look at what's going on.
This is a low priority request, si... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/307/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/307/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/306 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/306/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/306/comments | https://api.github.com/repos/coleifer/peewee/issues/306/events | https://github.com/coleifer/peewee/pull/306 | 27,359,768 | MDExOlB1bGxSZXF1ZXN0MTI0MjEzNTE= | 306 | fix the on_update on a foreign key | {
"login": "matrixise",
"id": 38737,
"node_id": "MDQ6VXNlcjM4NzM3",
"avatar_url": "https://avatars.githubusercontent.com/u/38737?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/matrixise",
"html_url": "https://github.com/matrixise",
"followers_url": "https://api.github.com/users/matrixise/... | [] | closed | false | null | [] | null | [
"Whoops, thanks!\n"
] | 2014-02-11T16:10:04 | 2014-06-26T21:10:31 | 2014-02-11T16:12:19 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/306/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/306/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/306",
"html_url": "https://github.com/coleifer/peewee/pull/306",
"diff_url": "https://github.com/coleifer/peewee/pull/306.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/306.patch",
"merged_at": "2014-02-11T16:12:19"
} | |
https://api.github.com/repos/coleifer/peewee/issues/305 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/305/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/305/comments | https://api.github.com/repos/coleifer/peewee/issues/305/events | https://github.com/coleifer/peewee/issues/305 | 27,192,618 | MDU6SXNzdWUyNzE5MjYxOA== | 305 | Metaclass conflict | {
"login": "soasme",
"id": 369081,
"node_id": "MDQ6VXNlcjM2OTA4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/369081?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/soasme",
"html_url": "https://github.com/soasme",
"followers_url": "https://api.github.com/users/soasme/follow... | [] | closed | false | null | [] | null | [
"it's more of a python problem rather than a peewee one.\n\nI think letting `UserMeta` inherit `BaseModel` should resolve this issue\n"
] | 2014-02-08T03:56:54 | 2014-02-08T10:26:46 | 2014-02-08T10:26:46 | CONTRIBUTOR | null | Are there any suggestions to solve the metaclass conflict problem?
``` python
from peewee import Model, SqliteDatabase, CharField
db = SqliteDatabase('/tmp/conflict.db')
class UserMeta(type):
def __new__(mcs, name, bases, dct):
return super(UserMeta, mcs).__new__(mcs, name, bases, dct)
class User(Model... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/305/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/305/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/304 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/304/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/304/comments | https://api.github.com/repos/coleifer/peewee/issues/304/events | https://github.com/coleifer/peewee/pull/304 | 27,096,630 | MDExOlB1bGxSZXF1ZXN0MTIyOTMxMDE= | 304 | Fixes index creation problems with schema | {
"login": "giohappy",
"id": 571129,
"node_id": "MDQ6VXNlcjU3MTEyOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/571129?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giohappy",
"html_url": "https://github.com/giohappy",
"followers_url": "https://api.github.com/users/giohapp... | [] | closed | false | null | [] | null | [
"Thanks!\n"
] | 2014-02-06T23:33:45 | 2014-06-16T14:18:43 | 2014-02-06T23:58:48 | CONTRIBUTOR | null | Fixes https://github.com/coleifer/peewee/issues/303
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/304/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/304/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/304",
"html_url": "https://github.com/coleifer/peewee/pull/304",
"diff_url": "https://github.com/coleifer/peewee/pull/304.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/304.patch",
"merged_at": "2014-02-06T23:58:48"
} |
https://api.github.com/repos/coleifer/peewee/issues/303 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/303/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/303/comments | https://api.github.com/repos/coleifer/peewee/issues/303/events | https://github.com/coleifer/peewee/issues/303 | 27,093,328 | MDU6SXNzdWUyNzA5MzMyOA== | 303 | CREATE INDEX on ForeignKey crashes during table creation | {
"login": "giohappy",
"id": 571129,
"node_id": "MDQ6VXNlcjU3MTEyOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/571129?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giohappy",
"html_url": "https://github.com/giohappy",
"followers_url": "https://api.github.com/users/giohapp... | [] | closed | false | null | [] | null | [
"Fix https://github.com/coleifer/peewee/pull/304\n"
] | 2014-02-06T22:46:36 | 2014-02-06T23:58:48 | 2014-02-06T23:58:48 | CONTRIBUTOR | null | When doing MyModel.create_table(), MyModel containing a ForeignKeyField, the creation of the related index doesn't work, because it complains that the relation is missing (MyModel's table)
I've also notices that the CREATE INDEX sql misses the table schema. I've tried fixing it at line https://github.com/coleifer/peew... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/303/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/303/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/302 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/302/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/302/comments | https://api.github.com/repos/coleifer/peewee/issues/302/events | https://github.com/coleifer/peewee/issues/302 | 26,837,044 | MDU6SXNzdWUyNjgzNzA0NA== | 302 | Update/Refresh Field List | {
"login": "bndr",
"id": 1145456,
"node_id": "MDQ6VXNlcjExNDU0NTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1145456?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bndr",
"html_url": "https://github.com/bndr",
"followers_url": "https://api.github.com/users/bndr/followers",
... | [] | closed | false | null | [] | null | [
"This would be a great feature but if you take a look at some of the existing schema migration tools you might be surprised how tricky this is.\n\nCurrently peewee has a helper in `playhouse.migrate` but i've only tested it with postgres. Schema migrations in sqlite are tricky because it only supports adding column... | 2014-02-03T21:04:23 | 2014-02-03T22:05:27 | 2014-02-03T22:05:27 | CONTRIBUTOR | null | Hi!
I would like to suggest implementing some sort of refresh_table method, which will add/delete Fields of the Model.
For example I have a model:
```
class Pets(Model):
name = CharField()
```
Then I do `Pets.create_table()` now I have the relevant table in my database, after some time (usually during developmen... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/302/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/302/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/301 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/301/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/301/comments | https://api.github.com/repos/coleifer/peewee/issues/301/events | https://github.com/coleifer/peewee/issues/301 | 26,823,309 | MDU6SXNzdWUyNjgyMzMwOQ== | 301 | How to check | {
"login": "kramer65",
"id": 596581,
"node_id": "MDQ6VXNlcjU5NjU4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/596581?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kramer65",
"html_url": "https://github.com/kramer65",
"followers_url": "https://api.github.com/users/kramer6... | [] | closed | false | null | [] | null | [
"This isn't really appropriate for GH issues. Try the [peewee mailing list](groups.google.com/group/peewee-orm) or irc (freenode #peewee).\n",
"Since you're stuck, though, you might try something like this:\n\n``` python\n\n(User\n .select()\n .where(fn.Exists(\n Message.select().where(Message.user == User.id... | 2014-02-03T18:08:33 | 2014-02-03T19:16:01 | 2014-02-03T18:48:47 | NONE | null | I'm trying to write a query which should return all names of Users which have at least one message associated with them. My models look like this:
```
class User(db.Model):
name = CharField()
class Message(db.Model):
user = ForeignKeyField(User, related_name='messages')
text = TextField()
```
and I curre... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/301/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/301/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/300 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/300/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/300/comments | https://api.github.com/repos/coleifer/peewee/issues/300/events | https://github.com/coleifer/peewee/issues/300 | 26,743,303 | MDU6SXNzdWUyNjc0MzMwMw== | 300 | pwiz foreign key regex for sqlite | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [] | 2014-02-01T17:43:32 | 2014-02-02T15:51:42 | 2014-02-02T15:51:42 | OWNER | null | Recent changes to the definition of foreign keys has caused pwiz to break when introspecting peewee-created sqlite tables.
Here is the table definition from peewee 2.1.6:
``` sql
CREATE TABLE "fkpk" (
"col_types_id" INTEGER NOT NULL PRIMARY KEY REFERENCES "coltypes" ("f11")
);
```
Here it is for 2.2.0, broken:
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/300/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/300/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/299 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/299/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/299/comments | https://api.github.com/repos/coleifer/peewee/issues/299/events | https://github.com/coleifer/peewee/pull/299 | 26,664,365 | MDExOlB1bGxSZXF1ZXN0MTIwNzEwMDQ= | 299 | readthedocs.org theme | {
"login": "bahrunnur",
"id": 2069852,
"node_id": "MDQ6VXNlcjIwNjk4NTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/2069852?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bahrunnur",
"html_url": "https://github.com/bahrunnur",
"followers_url": "https://api.github.com/users/ba... | [] | closed | false | null | [] | null | [
"I think I'm going to pass on merging, thank you though.\n"
] | 2014-01-31T09:06:36 | 2014-06-23T01:00:46 | 2014-01-31T13:42:16 | NONE | null | I like the new theme on readthedocs.org, so I intregate it with local build docs
and adding a little .gitignore for convenient
what do you think?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/299/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/299/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/299",
"html_url": "https://github.com/coleifer/peewee/pull/299",
"diff_url": "https://github.com/coleifer/peewee/pull/299.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/299.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/298 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/298/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/298/comments | https://api.github.com/repos/coleifer/peewee/issues/298/events | https://github.com/coleifer/peewee/issues/298 | 26,580,090 | MDU6SXNzdWUyNjU4MDA5MA== | 298 | Cascade doesn't seem to exist anymore? | {
"login": "b1naryth1ef",
"id": 599433,
"node_id": "MDQ6VXNlcjU5OTQzMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/599433?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/b1naryth1ef",
"html_url": "https://github.com/b1naryth1ef",
"followers_url": "https://api.github.com/user... | [] | closed | false | null | [] | null | [
"Well you're right, that arg is replaced with `on_delete` and `on_update`. I need to push a documentation update. Neither is responsible for dropping a table with the cascade option. I think you're right that, while I see the code for this the important part is unreachable. I'll have two fixes coming.\n",
"This ... | 2014-01-30T07:55:36 | 2014-01-30T10:43:43 | 2014-01-30T10:43:43 | NONE | null | I'm trying to figure out if I'm going crazy, or if the docs are out of date. Having any ForeignKeyField with cascade=True, errors out with the following:
Code:
``` python
ForeignKeyField(Category, cascade=True)
```
Throws:
``` python
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/298/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/298/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/297 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/297/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/297/comments | https://api.github.com/repos/coleifer/peewee/issues/297/events | https://github.com/coleifer/peewee/pull/297 | 26,565,485 | MDExOlB1bGxSZXF1ZXN0MTIwMTc1NDY= | 297 | Add version information | {
"login": "c4urself",
"id": 391030,
"node_id": "MDQ6VXNlcjM5MTAzMA==",
"avatar_url": "https://avatars.githubusercontent.com/u/391030?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/c4urself",
"html_url": "https://github.com/c4urself",
"followers_url": "https://api.github.com/users/c4ursel... | [] | closed | false | null | [] | null | [
"OMG, this change is so amazing; please have my babies.\n",
"`__version__` is better than `VERSION`, I think.\n",
"**version** added. Thanks for bringing this up!\n",
":thumbsup: thanks!\n"
] | 2014-01-30T00:15:35 | 2014-06-27T18:15:18 | 2014-01-30T10:30:44 | NONE | null | This is super useful for debugging purposes, seeing as peewee is just one big file it's nice to open it and see the VERSION information.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/297/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/297/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/297",
"html_url": "https://github.com/coleifer/peewee/pull/297",
"diff_url": "https://github.com/coleifer/peewee/pull/297.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/297.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/296 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/296/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/296/comments | https://api.github.com/repos/coleifer/peewee/issues/296/events | https://github.com/coleifer/peewee/issues/296 | 26,565,299 | MDU6SXNzdWUyNjU2NTI5OQ== | 296 | How to select a field with DB function? | {
"login": "giohappy",
"id": 571129,
"node_id": "MDQ6VXNlcjU3MTEyOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/571129?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giohappy",
"html_url": "https://github.com/giohappy",
"followers_url": "https://api.github.com/users/giohapp... | [] | closed | false | null | [] | null | [
"Ok, I found it out:\n\nMyModel.select(fn.ST_AsText(MyModel.geom).alias('point'))\n"
] | 2014-01-30T00:11:15 | 2014-01-30T00:42:14 | 2014-01-30T00:41:48 | CONTRIBUTOR | null | This is the inverse of https://github.com/coleifer/peewee/issues/292
In this case I need to obtain a field with a DB function.
Eg
SELECT ST_AsText(geom)
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/296/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/296/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/295 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/295/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/295/comments | https://api.github.com/repos/coleifer/peewee/issues/295/events | https://github.com/coleifer/peewee/issues/295 | 26,552,739 | MDU6SXNzdWUyNjU1MjczOQ== | 295 | Git database driver | {
"login": "grimnight",
"id": 1737541,
"node_id": "MDQ6VXNlcjE3Mzc1NDE=",
"avatar_url": "https://avatars.githubusercontent.com/u/1737541?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/grimnight",
"html_url": "https://github.com/grimnight",
"followers_url": "https://api.github.com/users/gr... | [] | closed | false | null | [] | null | [
"I don't see any reason not to just use Git-ORM.\n\nIf someone wanted to build a dp-api 2.0 driver for git, then something like that would be possible with peewee, but until then just stuck w/git-orm. Cool project, btw, hadn't heard of it.\n"
] | 2014-01-29T20:55:10 | 2014-01-29T21:19:55 | 2014-01-29T21:19:55 | NONE | null | Is it possible to add [Git-ORM](https://pypi.python.org/pypi/git-orm) like functionality to peewee using database drivers?
Since peewee has such a collection of [addons](http://peewee.readthedocs.org/en/latest/peewee/playhouse.html), I was wondering if that was possible.
[Git-ORM](https://pypi.python.org/pypi/git-orm) ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/295/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/295/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/294 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/294/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/294/comments | https://api.github.com/repos/coleifer/peewee/issues/294/events | https://github.com/coleifer/peewee/pull/294 | 26,543,568 | MDExOlB1bGxSZXF1ZXN0MTIwMDQzOTI= | 294 | fixed tipo (_meta -> meta) | {
"login": "giohappy",
"id": 571129,
"node_id": "MDQ6VXNlcjU3MTEyOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/571129?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giohappy",
"html_url": "https://github.com/giohappy",
"followers_url": "https://api.github.com/users/giohapp... | [] | closed | false | null | [] | null | [] | 2014-01-29T18:55:17 | 2014-06-25T23:09:50 | 2014-01-29T19:19:09 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/294/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/294/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/294",
"html_url": "https://github.com/coleifer/peewee/pull/294",
"diff_url": "https://github.com/coleifer/peewee/pull/294.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/294.patch",
"merged_at": "2014-01-29T19:19:09"
} | |
https://api.github.com/repos/coleifer/peewee/issues/293 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/293/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/293/comments | https://api.github.com/repos/coleifer/peewee/issues/293/events | https://github.com/coleifer/peewee/pull/293 | 26,508,619 | MDExOlB1bGxSZXF1ZXN0MTE5ODM5ODA= | 293 | Added an itemselector for hstore fields | {
"login": "zdxerr",
"id": 368272,
"node_id": "MDQ6VXNlcjM2ODI3Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/368272?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zdxerr",
"html_url": "https://github.com/zdxerr",
"followers_url": "https://api.github.com/users/zdxerr/follow... | [] | closed | false | null | [] | null | [
"Nice!! Thank you. Also thank you for the test case.\n"
] | 2014-01-29T09:52:02 | 2014-07-06T01:50:28 | 2014-01-29T14:16:31 | CONTRIBUTOR | null | I added an itemgetter to the hstore field, which returns an expression the selects the corresponding key from the hstore. Now you can do stuff like:
```
Test.select(Test.data['key'])
```
and
```
OP_MATCH = 'match'
def match(left, right):
return Expression(left, OP_MATCH, Param(right))
PostgresqlExtDatabase.reg... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/293/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/293/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/293",
"html_url": "https://github.com/coleifer/peewee/pull/293",
"diff_url": "https://github.com/coleifer/peewee/pull/293.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/293.patch",
"merged_at": "2014-01-29T14:16:31"
} |
https://api.github.com/repos/coleifer/peewee/issues/292 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/292/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/292/comments | https://api.github.com/repos/coleifer/peewee/issues/292/events | https://github.com/coleifer/peewee/issues/292 | 26,484,968 | MDU6SXNzdWUyNjQ4NDk2OA== | 292 | How to define a field wich requires to call DB function? | {
"login": "giohappy",
"id": 571129,
"node_id": "MDQ6VXNlcjU3MTEyOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/571129?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giohappy",
"html_url": "https://github.com/giohappy",
"followers_url": "https://api.github.com/users/giohapp... | [] | closed | false | null | [] | null | [
"Yeah that's a bit tricky, but it should be possible. Did you try something like:\n\n``` python\nclass PointField(Field):\n db_field = 'point' # Assuming you would hook this up to a field type registered w/the db.\n\n def db_value(self, value):\n if value:\n return fn.St_PointFromText(value... | 2014-01-28T23:06:27 | 2014-01-30T00:16:18 | 2014-01-29T18:57:34 | CONTRIBUTOR | null | I would need to manage GIS data creation, given the DB support it (eg PostGIS for Postgresql, MySQL a bit by default, Spatialite for Sqlite).
The minimal requirement is to define a field which can wrap the value with a DB function.
Eg, to save a point with PostGIS, I could call "St_PointFromText(string_value)", and "... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/292/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/292/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/291 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/291/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/291/comments | https://api.github.com/repos/coleifer/peewee/issues/291/events | https://github.com/coleifer/peewee/pull/291 | 26,406,568 | MDExOlB1bGxSZXF1ZXN0MTE5Mjc1ODY= | 291 | Added db schema support | {
"login": "giohappy",
"id": 571129,
"node_id": "MDQ6VXNlcjU3MTEyOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/571129?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giohappy",
"html_url": "https://github.com/giohappy",
"followers_url": "https://api.github.com/users/giohapp... | [] | closed | false | null | [] | null | [
"I opted for a slightly different refactoring which you can see in cfc7c3db6987cfe1ad087d645477bd1cb8c864e8 and 7a831badaa43347fa717718c9669f617bb5949e4. The end result should be the same as what you have here.\n\nI also chose `schema` instead of `db_schema`. `db_table` is a holdover from Django, but going forward ... | 2014-01-28T00:11:56 | 2014-06-16T14:18:53 | 2014-01-29T02:45:43 | CONTRIBUTOR | null | Added db_schema do Model meta options. I've refactored Entity to skip empty strings (e.g. when db_schema is empty or None)
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/291/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/291/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/291",
"html_url": "https://github.com/coleifer/peewee/pull/291",
"diff_url": "https://github.com/coleifer/peewee/pull/291.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/291.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/290 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/290/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/290/comments | https://api.github.com/repos/coleifer/peewee/issues/290/events | https://github.com/coleifer/peewee/issues/290 | 26,213,312 | MDU6SXNzdWUyNjIxMzMxMg== | 290 | Sub-select in from clause | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [
{
"id": 191751,
"node_id": "MDU6TGFiZWwxOTE3NTE=",
"url": "https://api.github.com/repos/coleifer/peewee/labels/Feature",
"name": "Feature",
"color": "02e10c",
"default": false,
"description": null
}
] | closed | false | null | [] | null | [
"peewee's APIs are geared towards selecting from a table. `Model.select()` implies that you are selecting from the table represented by `Model` and want to be returned `Model` instances (excepting special cases like `.scalar()`, `.aggregate()`, `.tuples()`, `.dicts()`).\n\nI haven't really put much effort into maki... | 2014-01-24T01:20:14 | 2014-01-27T15:17:13 | 2014-01-27T15:17:13 | OWNER | null | I'm using peewee2.1 with python3.3 and an sqlite3.7 database.
I want to perform certain SELECT queries in which:
I first select some aggregate (count, sum), grouping by some id column; then
I then select from the results of (1), aggregating over its aggregate. For example, I want in some cases to count the number of ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/290/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/290/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/289 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/289/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/289/comments | https://api.github.com/repos/coleifer/peewee/issues/289/events | https://github.com/coleifer/peewee/issues/289 | 25,959,277 | MDU6SXNzdWUyNTk1OTI3Nw== | 289 | simple functional way to create models | {
"login": "leliel12",
"id": 299010,
"node_id": "MDQ6VXNlcjI5OTAxMA==",
"avatar_url": "https://avatars.githubusercontent.com/u/299010?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/leliel12",
"html_url": "https://github.com/leliel12",
"followers_url": "https://api.github.com/users/leliel1... | [] | closed | false | null | [] | null | [
"Thanks for your interest in peewee and for sharing your code. I'm not sure this belongs as a github issue, as I use this to track bugs and new features, as opposed to snippets.\n"
] | 2014-01-21T01:42:54 | 2014-01-21T01:58:14 | 2014-01-21T01:58:10 | NONE | null | I actually working on tool for generate "dimension tables" for pentaho. I write this simple snippet for create models in more functional way.
``` python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from peewee import *
def create_model(model_name, supercls=(Model,), meta={}, **fields):
"""Create a model in func... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/289/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/289/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/288 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/288/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/288/comments | https://api.github.com/repos/coleifer/peewee/issues/288/events | https://github.com/coleifer/peewee/issues/288 | 25,894,886 | MDU6SXNzdWUyNTg5NDg4Ng== | 288 | Use of super on old style class `Model` | {
"login": "soasme",
"id": 369081,
"node_id": "MDQ6VXNlcjM2OTA4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/369081?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/soasme",
"html_url": "https://github.com/soasme",
"followers_url": "https://api.github.com/users/soasme/follow... | [] | closed | false | null | [] | null | [
"I thought `Model` _was_ a new-style class?\n",
"Oops, it seems that pyflake does not have enough intelligence to recognize these styles:\n\n``` python\ndef with_metaclass(meta, base=object):\n return meta(\"NewBase\", (base,), {})\n\nclass BaseModel(type):\n def __new__(cls, name, bases, attrs):\n r... | 2014-01-20T02:16:22 | 2014-01-20T03:21:07 | 2014-01-20T03:21:07 | CONTRIBUTOR | null | I got an pyflake error on overriding `Model#save` method:
> [E1002, MyModel.save] Use of super on an old style class
Here is the example:
``` python
# -*- coding: utf-8 -*-
from peewee import Model
class MyModel(Model):
def save(self, *args, **kw):
return super(MyModel, self).save(*args, **kw)
a = MyM... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/288/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/288/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/287 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/287/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/287/comments | https://api.github.com/repos/coleifer/peewee/issues/287/events | https://github.com/coleifer/peewee/issues/287 | 25,736,072 | MDU6SXNzdWUyNTczNjA3Mg== | 287 | postgresql: invalid last insert id when setting id manually | {
"login": "appetito",
"id": 557573,
"node_id": "MDQ6VXNlcjU1NzU3Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/557573?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/appetito",
"html_url": "https://github.com/appetito",
"followers_url": "https://api.github.com/users/appetit... | [] | closed | false | null | [] | null | [
"> may be we must use \"INSERT **\\* RETURNING id\"?\n\nThat is a postgres feature, unfortunately it won't work for Sqlite or MySQL... Setting an auto-incrementing ID manually is frowned on, but if you are bulk-loading data or for some reason need to control the ids, see these docs for some tips:\n\nhttp://peewee.r... | 2014-01-16T16:14:38 | 2014-01-16T16:20:14 | 2014-01-16T16:20:14 | NONE | null | ```
In [17]: cat = Category.create(name='a')
In [18]: cat.id
Out[18]: 1L
In [19]: cat = Category.create(name='b')
In [21]: cat.id
Out[21]: 2L
In [22]: cat = Category.create(name='c', id=100)
In [23]: cat.id
Out[23]: 2L
=========
select * from categories;
id | parent_id | name
-----+-----------+------
1 | ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/287/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/287/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/286 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/286/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/286/comments | https://api.github.com/repos/coleifer/peewee/issues/286/events | https://github.com/coleifer/peewee/pull/286 | 25,727,372 | MDExOlB1bGxSZXF1ZXN0MTE1NzkyMDQ= | 286 | fix #281 | {
"login": "appetito",
"id": 557573,
"node_id": "MDQ6VXNlcjU1NzU3Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/557573?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/appetito",
"html_url": "https://github.com/appetito",
"followers_url": "https://api.github.com/users/appetit... | [] | closed | false | null | [] | null | [
"Fixed in 3b8048d. Nice work debugging, thanks for the fix!\n"
] | 2014-01-16T14:16:09 | 2014-06-25T06:45:21 | 2014-01-16T16:04:50 | NONE | null | my try to fix #281
i am debug this script on my database and see that column order in the `columns` and in the `curs.description` does not match.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/286/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/286/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/286",
"html_url": "https://github.com/coleifer/peewee/pull/286",
"diff_url": "https://github.com/coleifer/peewee/pull/286.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/286.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/285 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/285/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/285/comments | https://api.github.com/repos/coleifer/peewee/issues/285/events | https://github.com/coleifer/peewee/pull/285 | 25,703,589 | MDExOlB1bGxSZXF1ZXN0MTE1NjU5Mjg= | 285 | Docs for `is_dirty` and `dirty_fields`. | {
"login": "soasme",
"id": 369081,
"node_id": "MDQ6VXNlcjM2OTA4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/369081?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/soasme",
"html_url": "https://github.com/soasme",
"followers_url": "https://api.github.com/users/soasme/follow... | [] | closed | false | null | [] | null | [] | 2014-01-16T05:02:38 | 2014-06-23T15:14:36 | 2014-01-16T16:34:13 | CONTRIBUTOR | null | Some trivial docs.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/285/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/285/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/285",
"html_url": "https://github.com/coleifer/peewee/pull/285",
"diff_url": "https://github.com/coleifer/peewee/pull/285.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/285.patch",
"merged_at": "2014-01-16T16:34:13"
} |
https://api.github.com/repos/coleifer/peewee/issues/284 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/284/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/284/comments | https://api.github.com/repos/coleifer/peewee/issues/284/events | https://github.com/coleifer/peewee/pull/284 | 25,702,436 | MDExOlB1bGxSZXF1ZXN0MTE1NjUzMDY= | 284 | Model should be prepared after creation. | {
"login": "soasme",
"id": 369081,
"node_id": "MDQ6VXNlcjM2OTA4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/369081?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/soasme",
"html_url": "https://github.com/soasme",
"followers_url": "https://api.github.com/users/soasme/follow... | [] | closed | false | null | [] | null | [
"Good point, thanks!\n"
] | 2014-01-16T04:16:10 | 2014-07-06T01:50:35 | 2014-01-16T04:20:25 | CONTRIBUTOR | null | It's weird that prepared just happened after select query.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/284/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/284/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/284",
"html_url": "https://github.com/coleifer/peewee/pull/284",
"diff_url": "https://github.com/coleifer/peewee/pull/284.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/284.patch",
"merged_at": "2014-01-16T04:20:25"
} |
https://api.github.com/repos/coleifer/peewee/issues/283 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/283/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/283/comments | https://api.github.com/repos/coleifer/peewee/issues/283/events | https://github.com/coleifer/peewee/pull/283 | 25,701,432 | MDExOlB1bGxSZXF1ZXN0MTE1NjQ4MDU= | 283 | Dirty Flag | {
"login": "soasme",
"id": 369081,
"node_id": "MDQ6VXNlcjM2OTA4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/369081?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/soasme",
"html_url": "https://github.com/soasme",
"followers_url": "https://api.github.com/users/soasme/follow... | [] | closed | false | null | [] | null | [
"Nice, thanks for this.\n"
] | 2014-01-16T03:43:45 | 2014-06-29T11:07:49 | 2014-01-16T04:21:41 | CONTRIBUTOR | null | Update all fields on saving will increase probability of `lost update`.
Such as:
TransactionA do not update username field
TransactionB update username field
TransactionB save
TransactionA save.
then we will lost username modification in TransactionB.
But if we just update necessary fields without username in Trans... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/283/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/283/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/283",
"html_url": "https://github.com/coleifer/peewee/pull/283",
"diff_url": "https://github.com/coleifer/peewee/pull/283.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/283.patch",
"merged_at": "2014-01-16T04:21:41"
} |
https://api.github.com/repos/coleifer/peewee/issues/282 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/282/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/282/comments | https://api.github.com/repos/coleifer/peewee/issues/282/events | https://github.com/coleifer/peewee/issues/282 | 25,588,301 | MDU6SXNzdWUyNTU4ODMwMQ== | 282 | Support postgres column type 'json' | {
"login": "extesy",
"id": 65872,
"node_id": "MDQ6VXNlcjY1ODcy",
"avatar_url": "https://avatars.githubusercontent.com/u/65872?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/extesy",
"html_url": "https://github.com/extesy",
"followers_url": "https://api.github.com/users/extesy/followers",
... | [] | closed | false | null | [] | null | [
"@extesy -- peewee does not currently come with a JSON field type (if it did, it would be part of `playhouse.postgres_ext`). It sounds like you may have started an implementation of one, otherwise I'm not sure how you have been using the field? Additionally, are you registering a json adapter or using any psycopg... | 2014-01-14T17:01:38 | 2014-01-15T04:50:17 | 2014-01-15T04:50:17 | NONE | null | Currently there is a problem with this column type because psycopg always unpacks json column data into a dict during load, and packs it during save (see _json.py file from psycopg2).
When peewee tries to interpret this dict as text, this causes python to serialize it, and this serialization makes it json-incompatible... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/282/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/282/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/281 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/281/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/281/comments | https://api.github.com/repos/coleifer/peewee/issues/281/events | https://github.com/coleifer/peewee/issues/281 | 25,522,759 | MDU6SXNzdWUyNTUyMjc1OQ== | 281 | pwiz.py and postgres - invalid field types | {
"login": "appetito",
"id": 557573,
"node_id": "MDQ6VXNlcjU1NzU3Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/557573?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/appetito",
"html_url": "https://github.com/appetito",
"followers_url": "https://api.github.com/users/appetit... | [] | closed | false | null | [] | null | [
"I tested this by hand. I typed in some models to recreate your schema (what pwiz _should_ have generated), then created the tables and ran pwiz against them.\n\n``` python\n# Models I typed in by hand:\nclass Category(BaseModel):\n name = CharField(max_length=500)\n parent = ForeignKeyField('self', null=Tru... | 2014-01-13T19:46:07 | 2014-01-16T14:16:09 | 2014-01-15T14:02:20 | NONE | null | ## Db schema is:
```
Table "public.categories"
Column | Type | Modifiers
-----------+------------------------+---------------------------------------------------------
id | integer | not null d... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/281/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/281/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/280 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/280/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/280/comments | https://api.github.com/repos/coleifer/peewee/issues/280/events | https://github.com/coleifer/peewee/issues/280 | 25,469,481 | MDU6SXNzdWUyNTQ2OTQ4MQ== | 280 | Foreign key attribute access in join | {
"login": "bndr",
"id": 1145456,
"node_id": "MDQ6VXNlcjExNDU0NTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1145456?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bndr",
"html_url": "https://github.com/bndr",
"followers_url": "https://api.github.com/users/bndr/followers",
... | [] | closed | false | null | [] | null | [
"When you access the `lat` and `lon` attrs, you need to do so from the `Place` model. You need to wrap your comparisons in parens because of operator precedence. Lastly, the usage of the `math` module won't work at all the way you're trying to use it. You will need to use database functions.\n\nI did not test th... | 2014-01-12T20:45:24 | 2014-01-13T19:43:55 | 2014-01-13T15:31:57 | CONTRIBUTOR | null | Hi!
So I've run in to a bit of a problem.
I have models:
```
class Trip(AbstractModel):
date = DateTimeField()
from_place = ForeignKeyField(Place, related_name="place_from")
to_place = ForeignKeyField(Place, related_name="place_to")
```
```
class Place(AbstractModel):
name = CharField(unique... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/280/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/280/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/279 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/279/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/279/comments | https://api.github.com/repos/coleifer/peewee/issues/279/events | https://github.com/coleifer/peewee/issues/279 | 25,437,787 | MDU6SXNzdWUyNTQzNzc4Nw== | 279 | Slow queries | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [
"You have multiple O(n) queries lurking in that loop. Every foreign key resolution (`row.test.name`, `row.component.n`) triggers as query.\n\nYou can accomplish this in O(1) queries (tested locally using sqlite). Try this:\n\n``` python\nrows = (\n Execution\n .select(\n Execution,\n Test,\n ... | 2014-01-11T04:58:51 | 2014-01-13T20:36:36 | 2014-01-13T20:36:36 | OWNER | null | Hi I have following issue with fetching data from MySQL.
My app is based on initial peewee example (https://github.com/coleifer/peewee/blob/master/example/app.py).
My db model (shorten):
``` python
db.py
---------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from peewee import *
from peewe... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/279/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/279/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/278 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/278/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/278/comments | https://api.github.com/repos/coleifer/peewee/issues/278/events | https://github.com/coleifer/peewee/pull/278 | 24,993,729 | MDExOlB1bGxSZXF1ZXN0MTExOTU4OTg= | 278 | Use wraps decorator so we don't lose the identity of the decorated function | {
"login": "lucasmarshall",
"id": 885074,
"node_id": "MDQ6VXNlcjg4NTA3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/885074?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lucasmarshall",
"html_url": "https://github.com/lucasmarshall",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"Thanks!\n",
"Sure thing.\n"
] | 2014-01-02T23:24:19 | 2014-07-06T01:50:38 | 2014-01-02T23:24:53 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/278/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/278/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/278",
"html_url": "https://github.com/coleifer/peewee/pull/278",
"diff_url": "https://github.com/coleifer/peewee/pull/278.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/278.patch",
"merged_at": "2014-01-02T23:24:53"
} | |
https://api.github.com/repos/coleifer/peewee/issues/277 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/277/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/277/comments | https://api.github.com/repos/coleifer/peewee/issues/277/events | https://github.com/coleifer/peewee/issues/277 | 24,913,702 | MDU6SXNzdWUyNDkxMzcwMg== | 277 | where() calls are not chainable with update() | {
"login": "grantcox",
"id": 186808,
"node_id": "MDQ6VXNlcjE4NjgwOA==",
"avatar_url": "https://avatars.githubusercontent.com/u/186808?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/grantcox",
"html_url": "https://github.com/grantcox",
"followers_url": "https://api.github.com/users/grantco... | [] | closed | false | null | [] | null | [
"Thank you so much for bringing this to my attention, you are absolutely right.\n"
] | 2013-12-31T07:21:23 | 2013-12-31T14:41:59 | 2013-12-31T14:41:59 | NONE | null | The documentation (http://peewee.readthedocs.org/en/latest/peewee/api.html#Query.where) states that "where() calls are chainable. Multiple calls will be “AND”-ed together.". This works for SelectQuery:
```
Model.select().where(Model.id == 1).where(Model.status == 5)
SELECT ... FROM `model` AS t1 WHERE ((t1.`id`=1) AN... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/277/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/277/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/276 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/276/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/276/comments | https://api.github.com/repos/coleifer/peewee/issues/276/events | https://github.com/coleifer/peewee/issues/276 | 24,852,638 | MDU6SXNzdWUyNDg1MjYzOA== | 276 | Problem related_name collision ? | {
"login": "ghost",
"id": 10137,
"node_id": "MDQ6VXNlcjEwMTM3",
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ghost",
"html_url": "https://github.com/ghost",
"followers_url": "https://api.github.com/users/ghost/followers",
"f... | [] | closed | false | null | [] | null | [
"Since `Schuelerkontakt` extends `Kontakt`, it also includes copies of the various foreign keys. For instance `typ = ForeignKeyField(Kontakttyp, related_name='typ_des_kontakts')`.\n\nThat sets up an attribute on `Kontakttyp` named `typ_des_kontakts` that initially points to `Kontakt`. When we get to `Schuelerkont... | 2013-12-28T22:48:54 | 2013-12-29T16:13:44 | 2013-12-29T16:13:32 | NONE | null | If i try to import the following module i got the error:
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "db.py", line 102, in <module>
class Schuelerkontakt(Kontakt):
File "/usr/lib/python2.7/site-packages/peewee.py", line 2570, in __new__
attr.add_to_class(cls, name)
File "/us... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/276/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/276/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/275 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/275/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/275/comments | https://api.github.com/repos/coleifer/peewee/issues/275/events | https://github.com/coleifer/peewee/issues/275 | 24,779,520 | MDU6SXNzdWUyNDc3OTUyMA== | 275 | some error on foreign_key with Version 2.1.7 | {
"login": "ghost",
"id": 10137,
"node_id": "MDQ6VXNlcjEwMTM3",
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ghost",
"html_url": "https://github.com/ghost",
"followers_url": "https://api.github.com/users/ghost/followers",
"f... | [] | closed | false | null | [] | null | [
"This error affected py3k, which I don't regularly test -- my fault. I've fixed and re-pushed to PYPI as 2.1.7.\n"
] | 2013-12-26T06:41:47 | 2013-12-26T15:18:23 | 2013-12-26T15:18:23 | NONE | null | When I up to 2.1.7 today, tables con't create 。But in 2.16 I know it works good。
Below is what happened when I use it with Python3 and MySQL.
Traceback (most recent call last):
File "E:/Work/Python/notepy/model/model.py", line 74, in <module>
PostTag.create_table()
File "C:\Python33\lib\site-packages\peewee.p... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/275/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/275/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/274 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/274/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/274/comments | https://api.github.com/repos/coleifer/peewee/issues/274/events | https://github.com/coleifer/peewee/issues/274 | 24,759,083 | MDU6SXNzdWUyNDc1OTA4Mw== | 274 | Missing ChangeLog on PyPi and in release tarballs | {
"login": "pitchforks",
"id": 4378791,
"node_id": "MDQ6VXNlcjQzNzg3OTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4378791?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pitchforks",
"html_url": "https://github.com/pitchforks",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"That makes sense. I only recently started tracking changes between versions so I wasn't actually sure anyone even looked at the releases on GH.\n\nIs there a special way to do this, or just make a `CHANGELOG` file in the repo and bundle it with the package?\n"
] | 2013-12-25T01:00:50 | 2013-12-27T15:44:15 | 2013-12-27T15:44:15 | NONE | null | I am using https://pypi.python.org/pypi/peewee to track peewee for new releases. Unfortunately it doesn't include a ChangeLog, so I have to come to https://github.com/coleifer/peewee/releases to read it. The release tarball also doesn't seem to bundle a ChangeLog file.
Would it be possible to have a ChangeLog file in ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/274/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/274/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/273 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/273/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/273/comments | https://api.github.com/repos/coleifer/peewee/issues/273/events | https://github.com/coleifer/peewee/issues/273 | 24,722,814 | MDU6SXNzdWUyNDcyMjgxNA== | 273 | Circular references | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [
"This is partially fixed by d5a5a86a14b7d631ef8b8b3759bfd8345def9b56 which makes it possible to use `Proxy` with `ForeignKeyField`. Unfortunately, Postgresql will complain about the `create table` queries generated so I'll need to work around this.\n",
"http://peewee.readthedocs.org/en/latest/peewee/cookbook.htm... | 2013-12-23T20:26:12 | 2013-12-24T17:59:44 | 2013-12-24T17:59:44 | OWNER | null | It would be nice to support circular references between tables:
``` python
class User(Model):
username = CharField()
last_post = ForeignKeyField(Post, null=True) # error
class Post(Model):
author = ForeignKeyField(User, related_name='posts')
title = CharField()
```
Self-referential FKs are possible... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/273/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/273/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/272 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/272/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/272/comments | https://api.github.com/repos/coleifer/peewee/issues/272/events | https://github.com/coleifer/peewee/pull/272 | 24,659,935 | MDExOlB1bGxSZXF1ZXN0MTEwMzI1ODI= | 272 | Add a missing property copying in Node.clone. | {
"login": "xiaq",
"id": 582021,
"node_id": "MDQ6VXNlcjU4MjAyMQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/582021?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/xiaq",
"html_url": "https://github.com/xiaq",
"followers_url": "https://api.github.com/users/xiaq/followers",
... | [] | closed | false | null | [] | null | [
"I'm not sure why this is missing but let's add it back. Thanks!\n"
] | 2013-12-21T04:21:26 | 2014-07-06T01:50:39 | 2013-12-21T13:45:00 | CONTRIBUTOR | null | I guess it's truly missing, not intended?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/272/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/272/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/272",
"html_url": "https://github.com/coleifer/peewee/pull/272",
"diff_url": "https://github.com/coleifer/peewee/pull/272.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/272.patch",
"merged_at": "2013-12-21T13:45:00"
} |
https://api.github.com/repos/coleifer/peewee/issues/271 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/271/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/271/comments | https://api.github.com/repos/coleifer/peewee/issues/271/events | https://github.com/coleifer/peewee/issues/271 | 24,649,703 | MDU6SXNzdWUyNDY0OTcwMw== | 271 | DB errors are sometimes obscured | {
"login": "MichaelBlume",
"id": 208853,
"node_id": "MDQ6VXNlcjIwODg1Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/208853?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MichaelBlume",
"html_url": "https://github.com/MichaelBlume",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [
"Can you provide more information? How can I replicate this?\n",
"Here are some examples:\n\n``` python\nIn [1]: from peewee import *\n\nIn [2]: db = PostgresqlDatabase('doesnotexist')\n\nIn [3]: db.connect()\nOperationalError: FATAL: database \"doesnotexist\" does not exist\n\nIn [4]: db = PostgresqlDatabase('... | 2013-12-20T21:42:14 | 2013-12-20T22:44:07 | 2013-12-20T22:09:41 | NONE | null | when I connect to a DB with bad credentials, select a list of items, and then do a map on that list, the fact that the connection failed doesn't surface until I perform the map, and Python obscures the connection error by just telling me
TypeError: argument 2 to map() must support iteration'
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/271/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/271/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/270 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/270/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/270/comments | https://api.github.com/repos/coleifer/peewee/issues/270/events | https://github.com/coleifer/peewee/issues/270 | 24,378,022 | MDU6SXNzdWUyNDM3ODAyMg== | 270 | Issues with CompositeKey | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [
"So on the model `B` somewhere we would need to have columns mapped to `A.id` and `A.description`. Then introduce a FK constraint and accessor that would do the right joins.\n",
"Does it make sense to add a `CompositeForeignKey`, so you'd end up with something like:\n\n``` python\n\nclass A(ContextModel):\n i... | 2013-12-16T20:54:44 | 2017-07-07T04:15:45 | 2017-07-07T04:15:45 | OWNER | null | I have two models. Model A has a CompositeKey as primary_key, defined as indicated in [0]. Model B references model A with a ForeignKeyField(A) as indicated in [1]. Its seems that something is wrongly defined and raises an exception when tables are created in sqlite engine.
Below is the full code reproducing the prob... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/270/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/270/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/269 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/269/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/269/comments | https://api.github.com/repos/coleifer/peewee/issues/269/events | https://github.com/coleifer/peewee/issues/269 | 23,967,523 | MDU6SXNzdWUyMzk2NzUyMw== | 269 | Fx places.sqlite not fit for pwiz.py | {
"login": "ricardogithub",
"id": 3900829,
"node_id": "MDQ6VXNlcjM5MDA4Mjk=",
"avatar_url": "https://avatars.githubusercontent.com/u/3900829?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ricardogithub",
"html_url": "https://github.com/ricardogithub",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"> A second thing is: it is usually a good thing not to silently make assumptions, like emitting an UnknownFieldType as mentioned above.\n\npwiz emits `UnknownFieldType` because it is unknown...exactly because we don't want to be making assumptions. See: http://www.sqlite.org/datatype3.html .\n\nI don't see any pro... | 2013-12-09T15:04:33 | 2013-12-10T06:19:09 | 2013-12-10T06:18:49 | NONE | null | In fact, it is the other way around :-)
Firefox's **places.sqlite** database (and propably others too) use a slighty modified field model, which is not supported by pwiz.py.
What I found is that Firefox at least uses non-standard datatypes _long_ and _longvarchar_, and also can use fields _without_ a proper type de... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/269/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/269/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/268 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/268/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/268/comments | https://api.github.com/repos/coleifer/peewee/issues/268/events | https://github.com/coleifer/peewee/pull/268 | 23,877,359 | MDExOlB1bGxSZXF1ZXN0MTA2MDQwMTg= | 268 | Adds support for nested transactions to postgres via savepoints | {
"login": "jhorman",
"id": 323697,
"node_id": "MDQ6VXNlcjMyMzY5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/323697?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jhorman",
"html_url": "https://github.com/jhorman",
"followers_url": "https://api.github.com/users/jhorman/fo... | [] | closed | false | null | [] | null | [
"Interesting PR. I'm actually looking at refactoring the transaction code to use a stack for #265 , though I did not plan on implementing nested txns using savepoints.\n\nI'm not sure I like overloading `begin` to now mean \"create a savepoint\". Same for `rollback`. These should always mean either begin a trans... | 2013-12-06T18:51:37 | 2014-07-06T01:50:41 | 2013-12-12T19:31:57 | CONTRIBUTOR | null | Postgres supports nested transactions by way of savepoints.
http://www.postgresql.org/docs/9.3/static/sql-savepoint.html
An example usage is
``` sql
BEGIN;
INSERT INTO table1 VALUES (1);
SAVEPOINT my_savepoint;
INSERT INTO table1 VALUES (2);
ROLLBACK TO SAVEPOINT my_savepoint;
INSERT INTO table1 ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/268/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/268/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/268",
"html_url": "https://github.com/coleifer/peewee/pull/268",
"diff_url": "https://github.com/coleifer/peewee/pull/268.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/268.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/267 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/267/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/267/comments | https://api.github.com/repos/coleifer/peewee/issues/267/events | https://github.com/coleifer/peewee/issues/267 | 23,677,152 | MDU6SXNzdWUyMzY3NzE1Mg== | 267 | Self-referencing subquery not possible? | {
"login": "shai126",
"id": 5904710,
"node_id": "MDQ6VXNlcjU5MDQ3MTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/5904710?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/shai126",
"html_url": "https://github.com/shai126",
"followers_url": "https://api.github.com/users/shai126/... | [] | closed | false | null | [] | null | [
"If you're referencing the same table multiple times in the query you need to call `Model.alias()`.\n\n``` python\nclass Game(Model):\n some_fields\n\nG2 = Game.alias()\nGame.select(\n Game, \n G2.select(fn.Sum(G2.something)).where(G2.some_field == Game.another_field).alias('xxx'))\n```\n\nI haven't tried ... | 2013-12-03T21:52:54 | 2013-12-05T14:49:52 | 2013-12-05T14:49:52 | NONE | null | _(I posted this earlier today as a comment on #156, then realised that as #156 is closed I don't know if that was the right place to post or not. Please feel free to delete whichever one is in the wrong place)_
65118b2c7aa4b6ed671de9d8b951f409cf657d18 works as a fix for the example given in #156, but it seems that thi... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/267/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/267/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/266 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/266/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/266/comments | https://api.github.com/repos/coleifer/peewee/issues/266/events | https://github.com/coleifer/peewee/issues/266 | 23,655,200 | MDU6SXNzdWUyMzY1NTIwMA== | 266 | pwiz error with leading underscore in column names | {
"login": "vincentdavis",
"id": 232564,
"node_id": "MDQ6VXNlcjIzMjU2NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/232564?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vincentdavis",
"html_url": "https://github.com/vincentdavis",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [
"Can you share the table definition from whatever database engine you're using? i.e. the `CREATE TABLE` query.\n",
"CREATE TABLE `jeffco_2009` (\n `_id` int(11) NOT NULL AUTO_INCREMENT,\n `lat` float NOT NULL,\n `lon` float NOT NULL,\n `altatd` varchar(100) DEFAULT NULL,\n `anxyr` varchar(100) DEFAULT NULL,... | 2013-12-03T16:37:48 | 2013-12-06T15:59:17 | 2013-12-06T15:59:17 | NONE | null | column named _id in database. pwiz returns a model as follows in my example
class Jeffco_2009(BaseModel):
= IntegerField(db_column='_id')
altatd = CharField(null=True)
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/266/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/266/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/265 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/265/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/265/comments | https://api.github.com/repos/coleifer/peewee/issues/265/events | https://github.com/coleifer/peewee/issues/265 | 23,638,686 | MDU6SXNzdWUyMzYzODY4Ng== | 265 | It would be nice to support nested transactions within commit_on_success | {
"login": "ricoboni",
"id": 1664502,
"node_id": "MDQ6VXNlcjE2NjQ1MDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1664502?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ricoboni",
"html_url": "https://github.com/ricoboni",
"followers_url": "https://api.github.com/users/ricob... | [] | closed | false | null | [] | null | [
"Great catch, I'm actually surprised this hasn't come up before!\n",
"This has been fixed. See testcase: 54b655c8469fd0f22608ac55f681d99ffab72316\n",
"Reopening.\n",
"I didn't like my implementation and have re-written it. New code is in 727299c323f97fb3a5c82c2ca88b1a0adb9ad06f and tests in 318ff7b3ca9689a5... | 2013-12-03T12:17:41 | 2013-12-12T10:06:54 | 2013-12-12T04:52:09 | NONE | null | Sometimes we have an operation that uses itself the `commit_on_success` decorator but it needs to call another operation using `commit_on_success`. The current version just commits the inner part regardless the erros that may occur in the outer part.
I've solved this problem as bellow, but maybe it worth to have it in... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/265/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/265/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/264 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/264/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/264/comments | https://api.github.com/repos/coleifer/peewee/issues/264/events | https://github.com/coleifer/peewee/issues/264 | 23,549,865 | MDU6SXNzdWUyMzU0OTg2NQ== | 264 | CSV loader example needs additional import | {
"login": "vincentdavis",
"id": 232564,
"node_id": "MDQ6VXNlcjIzMjU2NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/232564?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vincentdavis",
"html_url": "https://github.com/vincentdavis",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [] | 2013-12-02T03:01:00 | 2013-12-02T04:22:48 | 2013-12-02T04:22:48 | NONE | null | So it is obvious that for the CSV loader example to run it needs
from peewee import *
But it would be nice to add it to the example
http://peewee.readthedocs.org/en/latest/peewee/playhouse.html#csv-loader
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/264/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/264/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/263 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/263/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/263/comments | https://api.github.com/repos/coleifer/peewee/issues/263/events | https://github.com/coleifer/peewee/issues/263 | 23,452,626 | MDU6SXNzdWUyMzQ1MjYyNg== | 263 | Allow asynchronous queries | {
"login": "sametmax",
"id": 1673950,
"node_id": "MDQ6VXNlcjE2NzM5NTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1673950?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sametmax",
"html_url": "https://github.com/sametmax",
"followers_url": "https://api.github.com/users/samet... | [] | closed | false | null | [] | null | [
"This is an interesting request, but it's so big I'm not sure how to address it. Since I intend to keep compatibility with 2.6 for quite some time, I think it's not really possible. Also, my experience with \"async\" in python has been limited to gevent and I don't feel very comfortable with the new APIs (`yield ... | 2013-11-28T14:29:52 | 2022-11-22T22:59:36 | 2014-04-05T17:16:42 | NONE | null | Hard one, as peewee has been built on top of synchronous DB driver up untill then, but with Python 3.4 comming and shipping with asyncio + yield from, this can be an interesting for Python 3 users.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/263/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/263/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/262 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/262/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/262/comments | https://api.github.com/repos/coleifer/peewee/issues/262/events | https://github.com/coleifer/peewee/issues/262 | 23,387,239 | MDU6SXNzdWUyMzM4NzIzOQ== | 262 | Type/Range Checking Input? | {
"login": "twodayslate",
"id": 1085707,
"node_id": "MDQ6VXNlcjEwODU3MDc=",
"avatar_url": "https://avatars.githubusercontent.com/u/1085707?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/twodayslate",
"html_url": "https://github.com/twodayslate",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Depends on how you're saving that value. If you're calling `Model.save()` then just override the `save` method and add the check there. If you're calling `Model.insert()` you may have to implement it as a check constraint in your db.\n",
"Does the option argument not do it?\n",
"> Does the option argument no... | 2013-11-27T13:40:28 | 2013-11-27T15:11:21 | 2013-11-27T15:11:21 | NONE | null | Is it possible to do range checking on an insert? For example, when inserting a float it must be between 1.0 and 5.0
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/262/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/262/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/261 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/261/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/261/comments | https://api.github.com/repos/coleifer/peewee/issues/261/events | https://github.com/coleifer/peewee/issues/261 | 23,351,462 | MDU6SXNzdWUyMzM1MTQ2Mg== | 261 | DDL generation is brittle | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [
{
"id": 191751,
"node_id": "MDU6TGFiZWwxOTE3NTE=",
"url": "https://api.github.com/repos/coleifer/peewee/labels/Feature",
"name": "Feature",
"color": "02e10c",
"default": false,
"description": null
}
] | closed | false | null | [] | null | [
"I can finally close this!\n",
"What do you mean?\n",
"Sorry, blaming incorrectly. It worked fine. \n"
] | 2013-11-26T22:03:15 | 2014-02-19T18:51:34 | 2014-01-29T14:57:58 | OWNER | null | Currently the DDL generation code is very brittle. The upside is that in the simple case it "just works" and isn't much code.
Examples:
- #259
- #147
Perhaps the DDL code should be implemented using `QueryCompiler` (or a subclass).
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/261/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/261/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/260 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/260/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/260/comments | https://api.github.com/repos/coleifer/peewee/issues/260/events | https://github.com/coleifer/peewee/issues/260 | 23,333,821 | MDU6SXNzdWUyMzMzMzgyMQ== | 260 | strict mode | {
"login": "ricardogithub",
"id": 3900829,
"node_id": "MDQ6VXNlcjM5MDA4Mjk=",
"avatar_url": "https://avatars.githubusercontent.com/u/3900829?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ricardogithub",
"html_url": "https://github.com/ricardogithub",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"Won't the database raise an exception in the event you execute a bad query?\n",
"I did not mean handling exceptions triggered by the RDBMS, that is working OK, seems. I meant strictness in the parsing and processing of model definitions, e.g. the following attribute definition: \n\n```\n field = CharField(uni... | 2013-11-26T18:10:15 | 2013-11-30T13:30:01 | 2013-11-27T14:06:27 | NONE | null | Writing a Model will generate code for the RDBMS of choice, if the create_table() method is called. I noticed that there seems to be no check on the actual response of the RDBMS. See my issue #259, which illustrated that peewee generates a statements for MySQL, but a faulty one, in that particular example. Is there any... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/260/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/260/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/259 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/259/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/259/comments | https://api.github.com/repos/coleifer/peewee/issues/259/events | https://github.com/coleifer/peewee/issues/259 | 23,333,271 | MDU6SXNzdWUyMzMzMzI3MQ== | 259 | unique index on TextField | {
"login": "ricardogithub",
"id": 3900829,
"node_id": "MDQ6VXNlcjM5MDA4Mjk=",
"avatar_url": "https://avatars.githubusercontent.com/u/3900829?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ricardogithub",
"html_url": "https://github.com/ricardogithub",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"MySQL is very strange!\n",
"I think this should probably be rolled into a larger issue to refactor the DDL generation code.\n",
"Closing in favor of 261.\n"
] | 2013-11-26T18:01:06 | 2013-11-26T22:03:35 | 2013-11-26T22:03:35 | NONE | null | MySQL requires a maximum number of characters that will be relevant for an unique index on longtext fields, whilst the actual field may and will be much larger. Seems this is not possible to define in pw while creating a new table. I am not aware of the same issue in supported rdbms, but is there a possibility to add t... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/259/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/259/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/258 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/258/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/258/comments | https://api.github.com/repos/coleifer/peewee/issues/258/events | https://github.com/coleifer/peewee/issues/258 | 23,287,676 | MDU6SXNzdWUyMzI4NzY3Ng== | 258 | Proposal: Peewee should provide a standard definition of database errors and wrap the database driver errors in those | {
"login": "gciding",
"id": 769267,
"node_id": "MDQ6VXNlcjc2OTI2Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/769267?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gciding",
"html_url": "https://github.com/gciding",
"followers_url": "https://api.github.com/users/gciding/fo... | [] | closed | false | null | [] | null | [
"Yes, I agree.\n",
"I've added standard exceptions and wrapped the connect / close / execute methods to ensure they raise the \"peewee\" version where possible:\n\n2d6f43358ebdacb12a6d7319f3fc2c699f22a053\n"
] | 2013-11-26T01:20:25 | 2013-11-27T22:24:50 | 2013-11-27T22:24:50 | NONE | null | Peewee acts as an ORM and therefore it is not necessary to import the raw/underlying database python library when you create a database. However, if you want to perform tasks that rely on processing underlying errors (such as a databse Integrity Error) you will need to import the underlying database library.
To illust... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/258/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/258/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/257 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/257/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/257/comments | https://api.github.com/repos/coleifer/peewee/issues/257/events | https://github.com/coleifer/peewee/issues/257 | 23,284,719 | MDU6SXNzdWUyMzI4NDcxOQ== | 257 | Playouse - CSV Loader - should accept file object, or handle files in universal-newline mode | {
"login": "gciding",
"id": 769267,
"node_id": "MDQ6VXNlcjc2OTI2Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/769267?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gciding",
"html_url": "https://github.com/gciding",
"followers_url": "https://api.github.com/users/gciding/fo... | [] | closed | false | null | [] | null | [
"Agreed, good idea.\n",
"Added in 04129b097ceaf0a7a8f93ddff072d8f4b3131348\n"
] | 2013-11-26T00:07:08 | 2013-11-27T22:50:03 | 2013-11-27T22:50:03 | NONE | null | In file `playhouse/csv_loader.py`
When you use `load_csv`, it expects a filename of the CSV file. If the CSV file has been saved in a slightly different format with respect to New Lines (which is common with csv files generated by MS Excel), the standard `open(filename, 'r')` won't work.
```
Error: new-line charact... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/257/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/257/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/256 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/256/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/256/comments | https://api.github.com/repos/coleifer/peewee/issues/256/events | https://github.com/coleifer/peewee/issues/256 | 23,097,019 | MDU6SXNzdWUyMzA5NzAxOQ== | 256 | comments on code | {
"login": "akaRem",
"id": 1472728,
"node_id": "MDQ6VXNlcjE0NzI3Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1472728?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/akaRem",
"html_url": "https://github.com/akaRem",
"followers_url": "https://api.github.com/users/akaRem/foll... | [] | closed | false | null | [] | null | [
"Noted, thank you!\n"
] | 2013-11-21T20:57:45 | 2013-11-23T23:29:43 | 2013-11-23T23:29:43 | NONE | null | Could you, please, add more comments on PeeWee's code?
You've made very cool and interesting framework. And I'd like to study how it works and get involved into development. But.. in many places its hard to understand which functions do what and why.
BTW, Flask-style comments are the best i've ever seen.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/256/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/256/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/255 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/255/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/255/comments | https://api.github.com/repos/coleifer/peewee/issues/255/events | https://github.com/coleifer/peewee/issues/255 | 23,096,322 | MDU6SXNzdWUyMzA5NjMyMg== | 255 | proposal on QueryCompiler._parse() | {
"login": "akaRem",
"id": 1472728,
"node_id": "MDQ6VXNlcjE0NzI3Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1472728?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/akaRem",
"html_url": "https://github.com/akaRem",
"followers_url": "https://api.github.com/users/akaRem/foll... | [] | closed | false | null | [] | null | [
"I'm not sure I agree with this proposal. The \"cost\" of evaluating a SQL expression only occurs once, when the SQL is generated and handed off to the cursor, so I'm not sure I see the need to refactor this for performance. Additionally `isinstance()` is more flexible than calling `type()` because it understands... | 2013-11-21T20:47:53 | 2013-11-23T23:27:21 | 2013-11-23T23:27:21 | NONE | null | You have very long if-elif-elif-...else in QueryCompiler._parse(), where it mostly works with sql, params..
It would be better to use this something like this construction:
```
def non_inline_function(a,b,c):
# do some /1
# do some /2
# do some /3
return ('sql', 'pqrams')
mapper = {
Func: l... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/255/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/255/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/254 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/254/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/254/comments | https://api.github.com/repos/coleifer/peewee/issues/254/events | https://github.com/coleifer/peewee/issues/254 | 22,995,610 | MDU6SXNzdWUyMjk5NTYxMA== | 254 | Peewee now logs Errors that were previously caught | {
"login": "chrismatta",
"id": 2523087,
"node_id": "MDQ6VXNlcjI1MjMwODc=",
"avatar_url": "https://avatars.githubusercontent.com/u/2523087?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/chrismatta",
"html_url": "https://github.com/chrismatta",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"The only things peewee logs are:\n- debug: log every query\n- error: log queries that result in errors\n\nSo if you do not want these errors, you can just add a null handler to the logger:\n\n``` python\nimport logging\nlogger = logging.getLogger('peewee')\nlogger.addHandler(logging.NullHandler()) # suppress logg... | 2013-11-20T14:50:19 | 2014-04-01T14:26:52 | 2014-04-01T14:17:10 | NONE | null | I think this has to do with the 2.1.5 `sql_error_handler`. Previously to know if I should update a record I would try a save and catch a MySQL IntegrityError, then I would update any fields in the duplicate record like this:
```
class BaseModel(Model):
class Meta:
database = mysql_db
class User(BaseMod... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/254/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/254/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/253 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/253/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/253/comments | https://api.github.com/repos/coleifer/peewee/issues/253/events | https://github.com/coleifer/peewee/issues/253 | 22,896,572 | MDU6SXNzdWUyMjg5NjU3Mg== | 253 | How to use limit()? | {
"login": "kramer65",
"id": 596581,
"node_id": "MDQ6VXNlcjU5NjU4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/596581?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kramer65",
"html_url": "https://github.com/kramer65",
"followers_url": "https://api.github.com/users/kramer6... | [] | closed | false | null | [] | null | [
"I think that's, oddly, correct. I ran this in postgresql:\n\n``` sql\n# select count(*) from entry limit 10;\n count \n-------\n 118\n(1 row)\n```\n\nIf you wrap the select you get what you expect:\n\n``` sql\nselect count(*) from (select 1 from entry limit 10) _;\n count \n-------\n 10\n(1 row)\n```\n\nI ad... | 2013-11-19T09:08:00 | 2013-11-19T10:57:00 | 2013-11-19T10:57:00 | NONE | null | I'm trying to use limit as follows:
```
one_ticket = Ticket.select().limit(1)
print one_ticket.count()
```
This prints out 5 however. Does anybody know what's wrong here?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/253/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/253/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/252 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/252/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/252/comments | https://api.github.com/repos/coleifer/peewee/issues/252/events | https://github.com/coleifer/peewee/pull/252 | 22,869,131 | MDExOlB1bGxSZXF1ZXN0MTAwNjY2MDY= | 252 | Allow null column migrations | {
"login": "cam-stitt",
"id": 186643,
"node_id": "MDQ6VXNlcjE4NjY0Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/186643?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cam-stitt",
"html_url": "https://github.com/cam-stitt",
"followers_url": "https://api.github.com/users/cam-... | [] | closed | false | null | [] | null | [
"I'm not sure I follow these changes.\n",
"I think it can be closed. It was for a specific thing I had been working on but I don't think it is actually needed :)\n"
] | 2013-11-18T21:35:40 | 2014-07-06T01:50:42 | 2013-11-20T00:30:32 | NONE | null | Just a simple option that allows people to force it to try to add the column if null is True. I need this for my migrator at https://github.com/cam-stitt/arnold.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/252/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/252/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/252",
"html_url": "https://github.com/coleifer/peewee/pull/252",
"diff_url": "https://github.com/coleifer/peewee/pull/252.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/252.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/251 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/251/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/251/comments | https://api.github.com/repos/coleifer/peewee/issues/251/events | https://github.com/coleifer/peewee/issues/251 | 22,785,662 | MDU6SXNzdWUyMjc4NTY2Mg== | 251 | select .. where .. - recursive iterable parsing in where clause | {
"login": "akaRem",
"id": 1472728,
"node_id": "MDQ6VXNlcjE0NzI3Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1472728?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/akaRem",
"html_url": "https://github.com/akaRem",
"followers_url": "https://api.github.com/users/akaRem/foll... | [] | closed | false | null | [] | null | [
"Do you mind trying this out?\n\n``` python\nparam = Param([(1, 2), (3, 4)])\nprint MyModel.select().where(MyModel.some_tree == param).sql()\n```\n",
"@coleifer \n\nThis does not convert param (1):\n\n```\np = peewee.Param([1,2])\nprint MyModel.select().where(MyModel.some_tree == p).sql()\n\n('SELECT t1.\"id\", t... | 2013-11-16T21:50:09 | 2013-11-20T16:49:14 | 2013-11-20T16:41:09 | NONE | null | Im on Mac OS X 10.9 with PyPy 2.1.0 and PostgreSQL 9.3.1, having
peewee 2.1.5 and psycopg2ct 2.4.4
I study how peewee builds SQL strings
Trying to implement postgresql's ltree:
```
class IntLTreeField(peewee.Field):
db_field = 'ltree'
template = '%(column_type)s'
def field_attributes(self):
retur... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/251/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/251/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/250 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/250/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/250/comments | https://api.github.com/repos/coleifer/peewee/issues/250/events | https://github.com/coleifer/peewee/issues/250 | 22,784,028 | MDU6SXNzdWUyMjc4NDAyOA== | 250 | playhouse PostgresqlExtDatabase/PostgresqlExtCompiler | {
"login": "akaRem",
"id": 1472728,
"node_id": "MDQ6VXNlcjE0NzI3Mjg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1472728?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/akaRem",
"html_url": "https://github.com/akaRem",
"followers_url": "https://api.github.com/users/akaRem/foll... | [] | closed | false | null | [] | null | [
"The problem is in how you're instantiating the compiler. Try this instead, it will work:\n\n``` python\ncompiler = db.compiler()\nprint compiler.create_table(MyModel)\n```\n",
"@coleifer Thanks! It works.\n",
"Awesome!\n"
] | 2013-11-16T20:10:34 | 2013-11-17T13:09:29 | 2013-11-16T22:55:37 | NONE | null | Im on Mac OS X 10.9 with PyPy 2.1.0 and PostgreSQL 9.3.1, having
peewee 2.1.5 and psycopg2ct 2.4.4
I study how peewee builds SQL strings
When I trying to use Postgres extension like this:
```
# -*- coding: utf-8 -*-
from psycopg2ct import compat
compat.register()
import peewee as pw
import playhouse.postgres_ext as ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/250/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/250/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/249 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/249/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/249/comments | https://api.github.com/repos/coleifer/peewee/issues/249/events | https://github.com/coleifer/peewee/issues/249 | 22,673,306 | MDU6SXNzdWUyMjY3MzMwNg== | 249 | How to do an internal reference to the model itself? | {
"login": "kramer65",
"id": 596581,
"node_id": "MDQ6VXNlcjU5NjU4MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/596581?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kramer65",
"html_url": "https://github.com/kramer65",
"followers_url": "https://api.github.com/users/kramer6... | [] | closed | false | null | [] | null | [
"Check out http://peewee.readthedocs.org/en/latest/peewee/models.html#self-referential-foreign-keys\n\ntl;dr\n\n``` python\nadded_by = ForeignKeyField('self', related_name='users_created')\n```\n"
] | 2013-11-14T16:20:41 | 2013-11-14T17:16:10 | 2013-11-14T17:16:10 | NONE | null | I'm building a website in which Admins (which are of course also regular Users) can add new users. For this reason, my User model looks something like this:
```
class User(db.Model, BaseUser):
username = CharField()
password = CharField()
added_by = ForeignKeyField(User, related_name='users_created')
```
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/249/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/249/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/248 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/248/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/248/comments | https://api.github.com/repos/coleifer/peewee/issues/248/events | https://github.com/coleifer/peewee/issues/248 | 22,414,215 | MDU6SXNzdWUyMjQxNDIxNQ== | 248 | How to select on basis of ForeignKeyField.attribute == 'something' | {
"login": "kerqicce",
"id": 5898015,
"node_id": "MDQ6VXNlcjU4OTgwMTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/5898015?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kerqicce",
"html_url": "https://github.com/kerqicce",
"followers_url": "https://api.github.com/users/kerqi... | [] | closed | false | null | [] | null | [
"You're close, but you will need to perform a join. Check out the docs on joining: http://peewee.readthedocs.org/en/latest/peewee/querying.html#joining-tables\n\n``` python\nresult = Secondary.select().join(Primary).where(Primary.prim_attr == 'something')\n```\n"
] | 2013-11-10T18:39:53 | 2013-11-10T22:55:13 | 2013-11-10T22:55:13 | NONE | null | I have two models:
```
class Primary(db.Model):
prim_attr = CharField()
class Secondary(db.Model):
primary = ForeignKeyField(Primary, related_name='secondaries')
sec_attr = IntegerField()
```
I want to get all secondary items where the primary.prim_attr equals 'something'. So I tried to do like this:
``... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/248/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/248/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/247 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/247/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/247/comments | https://api.github.com/repos/coleifer/peewee/issues/247/events | https://github.com/coleifer/peewee/issues/247 | 22,405,658 | MDU6SXNzdWUyMjQwNTY1OA== | 247 | How to return choice of a IntegerField as string? | {
"login": "kerqicce",
"id": 5898015,
"node_id": "MDQ6VXNlcjU4OTgwMTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/5898015?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kerqicce",
"html_url": "https://github.com/kerqicce",
"followers_url": "https://api.github.com/users/kerqi... | [] | closed | false | null | [] | null | [
"Typically I store my choices in a class-level constant so they are easier to access and compare against:\n\n``` python\n\nclass Something(Model):\n FOO_YES = 1\n FOO_NO = 2\n FOO_CHOICES = (\n (FOO_YES, 'Yes'),\n (FOO_NO, 'No'))\n foo = IntegerField(choices=FOO_CHOICES)\n\n def __unico... | 2013-11-10T12:01:40 | 2013-11-10T17:45:20 | 2013-11-10T14:43:00 | NONE | null | I have one table with an IntegerField and in it two choices:
```
class Something(db.Model):
myattr = IntegerField(choices=((1, 'option one'), (2, 'option two')))
def __unicode__(self):
return myattr
```
The **unicode**() method obviously just return the integer 1 or 2. How can I return strings of the ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/247/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/247/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/246 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/246/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/246/comments | https://api.github.com/repos/coleifer/peewee/issues/246/events | https://github.com/coleifer/peewee/issues/246 | 22,394,814 | MDU6SXNzdWUyMjM5NDgxNA== | 246 | How to create conditional transactions? | {
"login": "kerqicce",
"id": 5898015,
"node_id": "MDQ6VXNlcjU4OTgwMTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/5898015?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kerqicce",
"html_url": "https://github.com/kerqicce",
"followers_url": "https://api.github.com/users/kerqi... | [] | closed | false | null | [] | null | [
"Check your database's documentation on `SELECT FOR UPDATE` ([link to peewee docs](http://peewee.readthedocs.org/en/latest/peewee/api.html#SelectQuery.for_update)).\n\nIf you're using postgres, here are some docs. http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-FOR-UPDATE-SHARE\n\nDoes this answer you... | 2013-11-09T22:07:57 | 2013-11-10T14:40:47 | 2013-11-10T14:40:47 | NONE | null | Hello Coleifer. Thank you for creating so good software, we love using it!
Today we looked at code in which we need to make something like conditional transactions. I do not know if that is an official name, but for us this means that we want to check if a certain value is present in the database. If it is, we want to... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/246/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/246/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/245 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/245/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/245/comments | https://api.github.com/repos/coleifer/peewee/issues/245/events | https://github.com/coleifer/peewee/issues/245 | 22,382,883 | MDU6SXNzdWUyMjM4Mjg4Mw== | 245 | Redundant __future__ import | {
"login": "tyteen4a03",
"id": 440015,
"node_id": "MDQ6VXNlcjQ0MDAxNQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/440015?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tyteen4a03",
"html_url": "https://github.com/tyteen4a03",
"followers_url": "https://api.github.com/users/t... | [] | closed | false | null | [] | null | [
"This is not fixed in tests.py.\n"
] | 2013-11-09T09:10:11 | 2013-11-12T04:31:16 | 2013-11-09T17:02:03 | NONE | null | Since Peewee supports Python 2.6+, the `from __future__ import with_statement` is unnecessary.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/245/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/245/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/244 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/244/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/244/comments | https://api.github.com/repos/coleifer/peewee/issues/244/events | https://github.com/coleifer/peewee/issues/244 | 21,949,259 | MDU6SXNzdWUyMTk0OTI1OQ== | 244 | Presumably internal debug message gets printed to stderr | {
"login": "pitchforks",
"id": 4378791,
"node_id": "MDQ6VXNlcjQzNzg3OTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4378791?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pitchforks",
"html_url": "https://github.com/pitchforks",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"Peewee supports logging using python's standard library logging module. The logger can help you debug queries and also supports logging exceptions executing queries. Python docs have you covered: \n\nhttp://docs.python.org/3.1/library/logging.html#configuring-logging-for-a-library\n"
] | 2013-11-01T09:57:46 | 2013-11-01T13:41:36 | 2013-11-01T13:41:36 | NONE | null | Few days ago I have upgraded from 2.1.4 to 2.1.5 and now everytime my CLI program runs, it dumps this line to stdout:
```
No handlers could be found for logger "peewee"
```
I have searched for this text in the sources for 2.1.5 but didn't find anything.
This looks related to logging module but my own program doesn't... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/244/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/244/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/243 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/243/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/243/comments | https://api.github.com/repos/coleifer/peewee/issues/243/events | https://github.com/coleifer/peewee/issues/243 | 21,467,490 | MDU6SXNzdWUyMTQ2NzQ5MA== | 243 | Model cache being inconsistent when the value is set by id | {
"login": "ricoboni",
"id": 1664502,
"node_id": "MDQ6VXNlcjE2NjQ1MDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1664502?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ricoboni",
"html_url": "https://github.com/ricoboni",
"followers_url": "https://api.github.com/users/ricob... | [] | closed | false | null | [] | null | [
"Thanks!\n"
] | 2013-10-23T16:47:52 | 2013-10-23T17:25:05 | 2013-10-23T17:24:58 | NONE | null | Project have a ForeignKeyField referencing Client
The output is from my projects iPython shell
```
In [1]: p = Project.get(id=581)
In [2]: p.client
Out[2]: <models.Client at 0x1f6d790>
In [3]: p.client.id
Out[3]: 115
In [4]: p.client = 123
In [5]: p.client.id
Out[5]: 115
```
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/243/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/243/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/242 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/242/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/242/comments | https://api.github.com/repos/coleifer/peewee/issues/242/events | https://github.com/coleifer/peewee/issues/242 | 21,423,745 | MDU6SXNzdWUyMTQyMzc0NQ== | 242 | Postgres Mixed Encoding SQLASCII Issue | {
"login": "caelx",
"id": 1686351,
"node_id": "MDQ6VXNlcjE2ODYzNTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/1686351?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/caelx",
"html_url": "https://github.com/caelx",
"followers_url": "https://api.github.com/users/caelx/follower... | [] | closed | false | null | [] | null | [
"Just out of curiosity have you tried messing with the encoding on the connection object?\n",
"Thanks for getting back to me.\n\nYes, the database is set for client encoding USASCII but I tried changing it to UTF8. This did not help though because there were still unicode conversion errors for some of the charac... | 2013-10-22T23:05:48 | 2013-10-23T16:03:47 | 2013-10-23T16:03:47 | NONE | null | I have to deal with a postgres database which has mixed encodings (mix utf-8 and latin1) in some of the text fields. Now I don't know what kind of monster doesn't properly encode text before it gets inserted into the database, but it is what it is.
I created a ByteArrayField to deal with the raw text, but I was still... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/242/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/242/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/241 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/241/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/241/comments | https://api.github.com/repos/coleifer/peewee/issues/241/events | https://github.com/coleifer/peewee/pull/241 | 21,416,863 | MDExOlB1bGxSZXF1ZXN0OTMwOTAyOA== | 241 | cookbook.rst: clarify threadlocals vs check_same_threads | {
"login": "shamrin",
"id": 510678,
"node_id": "MDQ6VXNlcjUxMDY3OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/510678?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/shamrin",
"html_url": "https://github.com/shamrin",
"followers_url": "https://api.github.com/users/shamrin/fo... | [] | closed | false | null | [] | null | [
"Cheers!\n"
] | 2013-10-22T20:58:40 | 2014-07-01T20:36:27 | 2013-10-22T21:12:36 | CONTRIBUTOR | null | Hopefully this makes the distinction between `threadlocals = True` and `check_same_thread = False` clearer. See also my other issue: mrjoes/flask-admin#348.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/241/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/241/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/241",
"html_url": "https://github.com/coleifer/peewee/pull/241",
"diff_url": "https://github.com/coleifer/peewee/pull/241.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/241.patch",
"merged_at": "2013-10-22T21:12:36"
} |
https://api.github.com/repos/coleifer/peewee/issues/240 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/240/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/240/comments | https://api.github.com/repos/coleifer/peewee/issues/240/events | https://github.com/coleifer/peewee/issues/240 | 21,279,470 | MDU6SXNzdWUyMTI3OTQ3MA== | 240 | Incompleted transactions with PostgreSQL | {
"login": "rudyryk",
"id": 4500,
"node_id": "MDQ6VXNlcjQ1MDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/4500?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rudyryk",
"html_url": "https://github.com/rudyryk",
"followers_url": "https://api.github.com/users/rudyryk/followers"... | [] | closed | false | null | [] | null | [
"Sorry, I missed a couple of updates :( After updating works great! :+1: \n",
"No, bug is still present in 2.1.4 and in current development version with Python 3.3 at least. (Last time I just reproduced it incorrectly).\n",
"You will need to issue a `rollback`, if you are using the database in autocommit mode:\... | 2013-10-20T12:36:16 | 2017-02-14T09:31:12 | 2014-01-12T16:48:00 | NONE | null | How to deal with incompleted transactions in PostgreSQL? It seems we can't make queries after single transaction fail. Instead we get: **psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block**
Here's minimal code sample to reproduce the issue:
``` Python
import peewee... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/240/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/240/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/239 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/239/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/239/comments | https://api.github.com/repos/coleifer/peewee/issues/239/events | https://github.com/coleifer/peewee/issues/239 | 21,141,336 | MDU6SXNzdWUyMTE0MTMzNg== | 239 | Add support for MySQL connection recycling | {
"login": "arnuschky",
"id": 179920,
"node_id": "MDQ6VXNlcjE3OTkyMA==",
"avatar_url": "https://avatars.githubusercontent.com/u/179920?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arnuschky",
"html_url": "https://github.com/arnuschky",
"followers_url": "https://api.github.com/users/arnu... | [] | closed | false | null | [] | null | [
"Now that I think of it, this issue maybe more appropriate for flask-peewee, but I am not sure.\n",
"I'm a little unclear on how your particular issue is arising. If you're using flask-peewee's `Database` object, it should be opening and closing the connection on each request. If you're using a multi-threaded w... | 2013-10-17T09:26:05 | 2015-12-12T15:45:41 | 2013-10-18T14:12:59 | NONE | null | We're getting the following error on our flask project:
```
SQLError: (OperationalError) (2006, ‘MySQL server has gone away’)
```
This problem was implicitly mentioned in https://github.com/coleifer/peewee/issues/222 for example.
SQLalchemy addresses the problem as follows: https://github.com/mitsuhiko/flask-sqlal... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/239/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/239/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/238 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/238/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/238/comments | https://api.github.com/repos/coleifer/peewee/issues/238/events | https://github.com/coleifer/peewee/issues/238 | 20,957,609 | MDU6SXNzdWUyMDk1NzYwOQ== | 238 | Can't refer to model which not exists yet | {
"login": "wtld",
"id": 1318746,
"node_id": "MDQ6VXNlcjEzMTg3NDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1318746?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wtld",
"html_url": "https://github.com/wtld",
"followers_url": "https://api.github.com/users/wtld/followers",
... | [] | closed | false | null | [] | null | [
"By default you can use topic.post_set.\nIf you change topic = ForeignKeyField(Topic) to topic = ForeignKeyField(Topic,related_name='posts')\nyou can use topic.posts.\n",
"Unfortunately peewee does not support this kind of relationship. This is partly a limitation of python, but also in part due to my own feeli... | 2013-10-14T13:51:28 | 2013-10-15T01:31:22 | 2013-10-15T01:31:22 | NONE | null | ``` python
class Topic(Model):
title = CharField()
last_post = ForeignKeyField(Post)
class Post(Model):
topic = ForeignKeyField(Topic)
body = CharField()
```
How to refer 'Post' model from 'Topic' model?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/238/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/238/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/237 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/237/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/237/comments | https://api.github.com/repos/coleifer/peewee/issues/237/events | https://github.com/coleifer/peewee/issues/237 | 20,669,381 | MDU6SXNzdWUyMDY2OTM4MQ== | 237 | Is it possible to use getter in the model class? | {
"login": "a-nanasov",
"id": 1544480,
"node_id": "MDQ6VXNlcjE1NDQ0ODA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1544480?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/a-nanasov",
"html_url": "https://github.com/a-nanasov",
"followers_url": "https://api.github.com/users/a-... | [] | closed | false | null | [] | null | [
"That is an interesting setup. Unfortunately, due to the way peewee uses metaclasses, you cannot define your fields in `__init__`. I assume in practice there's a reason you're using a property -- perhaps to modify the value in the database column? Try:\n\n``` python\n\nclass Location(db.Model):\n name_column = ... | 2013-10-08T10:02:47 | 2013-10-08T15:06:49 | 2013-10-08T15:06:49 | NONE | null | Hi, I've tried to use @propery decorator with getter function:
``` python
class Location(db.Model):
def __init__(self):
self._name = CharField(unique = True)
@property
def name(self):
return self._name
class Meta:
db_table = 'locations'
```
but got the following SQL query
`<... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/237/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/237/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/236 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/236/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/236/comments | https://api.github.com/repos/coleifer/peewee/issues/236/events | https://github.com/coleifer/peewee/issues/236 | 20,396,778 | MDU6SXNzdWUyMDM5Njc3OA== | 236 | AttributeError with multiple ForeignKeyField to the same table. | {
"login": "andmart",
"id": 303252,
"node_id": "MDQ6VXNlcjMwMzI1Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/303252?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/andmart",
"html_url": "https://github.com/andmart",
"followers_url": "https://api.github.com/users/andmart/fo... | [] | closed | false | null | [] | null | [
"Sorry. I forgot to write peewee's version. 2.1.4\n",
"This is because there are two foreign keys to the same model on `Student`. Specify `related_name` attributes (the backref on `Parent`):\n\n``` python\nclass Student(Model):\n name = CharField()\n father = ForeignKeyField(Parent, related_name='father_st... | 2013-10-02T14:18:10 | 2015-01-22T19:50:12 | 2013-10-02T16:21:32 | NONE | null | Charles,
Here a simple example to reproduce:
``` python
from peewee import *
class Parent(Model):
name = CharField()
class Student(Model):
name = CharField()
father = ForeignKeyField(Parent)
mother = ForeignKeyField(Parent)
```
```
AttributeError: Foreign key: student.mother related name "student_s... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/236/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/236/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/235 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/235/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/235/comments | https://api.github.com/repos/coleifer/peewee/issues/235/events | https://github.com/coleifer/peewee/issues/235 | 20,155,187 | MDU6SXNzdWUyMDE1NTE4Nw== | 235 | handle error by flashing error msg in admin during data entry | {
"login": "beebek",
"id": 1183800,
"node_id": "MDQ6VXNlcjExODM4MDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1183800?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/beebek",
"html_url": "https://github.com/beebek",
"followers_url": "https://api.github.com/users/beebek/foll... | [] | closed | false | null | [] | null | [
"You will need to implement that yourself by overriding `ModelAdmin.save_model`.\n"
] | 2013-09-27T07:00:54 | 2013-09-27T15:11:28 | 2013-09-27T15:11:28 | NONE | null | ```
class Organization(db.Model):
name = TextField(default="", unique=True)
def save(self, *args, **kwargs):
if not self.get_id(): # this is the first time saving
self.create_folder()
return super(Organization, self).save(*args, **kwargs)
def __unicode__(self):
return ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/235/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/235/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/234 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/234/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/234/comments | https://api.github.com/repos/coleifer/peewee/issues/234/events | https://github.com/coleifer/peewee/issues/234 | 20,055,461 | MDU6SXNzdWUyMDA1NTQ2MQ== | 234 | create a folder during database creation | {
"login": "beebek",
"id": 1183800,
"node_id": "MDQ6VXNlcjExODM4MDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1183800?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/beebek",
"html_url": "https://github.com/beebek",
"followers_url": "https://api.github.com/users/beebek/foll... | [] | closed | false | null | [] | null | [
"Edit: fixed formatting\n",
"Typically this is something you would do before saving the model to the database:\n\n``` python\n\norg = Organization(form_folder='whatever')\norg.save() # actually save to the db, create the folder\n```\n\nYou would implement this:\n\n``` python\n\nclass Organization(db.Model):\n ... | 2013-09-25T16:59:24 | 2013-09-27T07:01:13 | 2013-09-26T16:41:26 | NONE | null | I have a simple model
``` python
class Organization(db.Model):
name = TextField(default="")
form_folder = TextField(default="")
def __unicode__(self):
return self.name
```
When the user passes the form_folder name, I need to create a folder with the same name. Is it possible to use some construct... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/234/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/234/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/233 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/233/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/233/comments | https://api.github.com/repos/coleifer/peewee/issues/233/events | https://github.com/coleifer/peewee/issues/233 | 19,984,296 | MDU6SXNzdWUxOTk4NDI5Ng== | 233 | Case stmt for peewee | {
"login": "stanegit",
"id": 3876591,
"node_id": "MDQ6VXNlcjM4NzY1OTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/3876591?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stanegit",
"html_url": "https://github.com/stanegit",
"followers_url": "https://api.github.com/users/stane... | [] | closed | false | null | [] | null | [
"Funny you should ask that! I've just been looking at making this easier to accomplish. Currently you have to do some messy stuff with `Clause` and `R`.\n",
"I hope you can do \"magic\" :)\n",
"Something like sqlalchemy would be perfecet\n\ncase([\n (CcnDef.w_pci.code,'PCI'),\n ... | 2013-09-24T15:08:56 | 2013-09-24T18:56:02 | 2013-09-24T17:02:41 | NONE | null | Hi , thx for peewee , can we do CASE() stmt with peewee?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/233/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/233/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/232 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/232/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/232/comments | https://api.github.com/repos/coleifer/peewee/issues/232/events | https://github.com/coleifer/peewee/issues/232 | 19,909,386 | MDU6SXNzdWUxOTkwOTM4Ng== | 232 | update password also while updating the record | {
"login": "beebek",
"id": 1183800,
"node_id": "MDQ6VXNlcjExODM4MDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1183800?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/beebek",
"html_url": "https://github.com/beebek",
"followers_url": "https://api.github.com/users/beebek/foll... | [] | closed | false | null | [] | null | [
"No, `set_password` is a method on the `User` model, but once you call `.update()` you are working with a `Query` object which doesn't have that method.\n\nYou can do:\n\n``` python\nfrom flask_peewee.utils import make_password\n\n(User\n .update(\n organization_name=organization_name,\n username=u... | 2013-09-23T13:40:25 | 2013-09-23T14:27:06 | 2013-09-23T13:57:18 | NONE | null | I have a simple query e.g.
user = User.update(organization_name=organization_name,
username=username,
email=email,
active=active,
admin=admin,
created_date=created_date,
role=role).where(User.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/232/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/232/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/231 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/231/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/231/comments | https://api.github.com/repos/coleifer/peewee/issues/231/events | https://github.com/coleifer/peewee/issues/231 | 19,342,202 | MDU6SXNzdWUxOTM0MjIwMg== | 231 | Class with multiple foreign key references to the same table throws error | {
"login": "chrismatta",
"id": 2523087,
"node_id": "MDQ6VXNlcjI1MjMwODc=",
"avatar_url": "https://avatars.githubusercontent.com/u/2523087?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/chrismatta",
"html_url": "https://github.com/chrismatta",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"This is happening in 2.1.4, I just tested it in 2.1.0 and it seems to be working fine.\n",
"Do you have a foreign key on `InvArray` named `invhostdr_set`?\n",
"No, I don't. I only have one foreign key on InvArray that points to a different table, InvLocation.\n",
"Try setting the `related_name` attribute on ... | 2013-09-11T19:46:52 | 2013-10-01T23:06:10 | 2013-09-19T21:06:11 | NONE | null | After upgrading this class throws an error:
```
class InvHostDr(BaseModel):
comment = TextField()
primary_array = ForeignKeyField(
db_column='primary_array_id', rel_model=InvArray)
primary_host = ForeignKeyField(
db_column='primary_host_id', rel_model=InvHost)
primary_project_host = For... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/231/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/231/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/230 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/230/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/230/comments | https://api.github.com/repos/coleifer/peewee/issues/230/events | https://github.com/coleifer/peewee/issues/230 | 19,179,073 | MDU6SXNzdWUxOTE3OTA3Mw== | 230 | db migration | {
"login": "beebek",
"id": 1183800,
"node_id": "MDQ6VXNlcjExODM4MDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1183800?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/beebek",
"html_url": "https://github.com/beebek",
"followers_url": "https://api.github.com/users/beebek/foll... | [] | closed | false | null | [] | null | [
"Peewee has support for simple migrations using postgresql:\n\nhttp://peewee.readthedocs.org/en/latest/peewee/playhouse.html#basic-schema-migrations\n\nCurrently I do not have plans to enhance this module or add support for other database engines.\n"
] | 2013-09-09T06:47:37 | 2013-09-09T10:24:49 | 2013-09-09T10:24:49 | NONE | null | It would be great If there is db migration as well.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/230/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/230/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/229 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/229/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/229/comments | https://api.github.com/repos/coleifer/peewee/issues/229/events | https://github.com/coleifer/peewee/issues/229 | 19,067,184 | MDU6SXNzdWUxOTA2NzE4NA== | 229 | Join "on" clause does not accept a conjunction or disjunction. | {
"login": "rammie",
"id": 554792,
"node_id": "MDQ6VXNlcjU1NDc5Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/554792?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rammie",
"html_url": "https://github.com/rammie",
"followers_url": "https://api.github.com/users/rammie/follow... | [] | closed | false | null | [] | null | [
"Try adding a `.alias('foo')` to your expression.\n",
"Sweet, that works! Thanks once again, peewee rulz.\n",
"Probably needs a better error message, glad you're liking peewee!\n",
"@rammie -- Do you mind sharing the join that caused this error?\n",
"``` python\nfrom peewee import *\n\nclass T2(Model):\n ... | 2013-09-05T18:45:49 | 2014-10-22T05:04:24 | 2014-10-21T16:40:37 | NONE | null | I ran into this issue while trying to do a left join which requires multiple conditions in the on clause. Here is a traceback of the issue:
```
Traceback (most recent call last):
...
File "python2.7/site-packages/peewee.py", line 1650, in __iter__
return iter(self.execute())
File "python2.7/site-packages/pee... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/229/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/229/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/228 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/228/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/228/comments | https://api.github.com/repos/coleifer/peewee/issues/228/events | https://github.com/coleifer/peewee/issues/228 | 18,755,129 | MDU6SXNzdWUxODc1NTEyOQ== | 228 | Change >> to a NOT IN instead of IS | {
"login": "kolanos",
"id": 17498,
"node_id": "MDQ6VXNlcjE3NDk4",
"avatar_url": "https://avatars.githubusercontent.com/u/17498?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kolanos",
"html_url": "https://github.com/kolanos",
"followers_url": "https://api.github.com/users/kolanos/follower... | [] | closed | false | null | [] | null | [
"Unfortunately this is not going to change any time soon. I made a decision a while ago that `IS` would be treated as a separate lookup even if it is only ever used with `NULL`. Similarly, negation is always handled by the unary negation operator and is not special cased.\n"
] | 2013-08-29T20:26:22 | 2013-08-29T20:57:04 | 2013-08-29T20:57:04 | NONE | null | Since `.where(field << (...)` equates to a `WHERE field IN (...)`, it stands to reason that a `.where(field >> (...)` would equate to `WHERE field NOT IN (...)`.
Then a `.where(field == None)` would equate to `WHERE field IS NULL` and `.where(field != None)` equates to `WHERE field IS NOT NULL`.
Does that not make mo... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/228/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/228/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/227 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/227/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/227/comments | https://api.github.com/repos/coleifer/peewee/issues/227/events | https://github.com/coleifer/peewee/pull/227 | 18,580,885 | MDExOlB1bGxSZXF1ZXN0Nzg3NDI3MA== | 227 | wrong MySQLDatabase field override key for bool | {
"login": "spenthil",
"id": 110513,
"node_id": "MDQ6VXNlcjExMDUxMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/110513?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/spenthil",
"html_url": "https://github.com/spenthil",
"followers_url": "https://api.github.com/users/spenthi... | [] | closed | false | null | [] | null | [] | 2013-08-27T00:08:21 | 2014-07-02T20:27:48 | 2013-08-27T15:07:34 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/227/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/227/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/227",
"html_url": "https://github.com/coleifer/peewee/pull/227",
"diff_url": "https://github.com/coleifer/peewee/pull/227.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/227.patch",
"merged_at": "2013-08-27T15:07:34"
} | |
https://api.github.com/repos/coleifer/peewee/issues/226 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/226/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/226/comments | https://api.github.com/repos/coleifer/peewee/issues/226/events | https://github.com/coleifer/peewee/pull/226 | 18,509,967 | MDExOlB1bGxSZXF1ZXN0Nzg0MDQ2MA== | 226 | Added kwargs to ModelOptions for further customization | {
"login": "cam-stitt",
"id": 186643,
"node_id": "MDQ6VXNlcjE4NjY0Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/186643?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cam-stitt",
"html_url": "https://github.com/cam-stitt",
"followers_url": "https://api.github.com/users/cam-... | [] | closed | false | null | [] | null | [
"I added another commit that removed the forced auto_increment no matter what. I feel like people should be able to set the pk on an item even if there is an auto_increment.\n",
"Both of your changes should now be merged in (more or less). Thank you!\n"
] | 2013-08-24T17:56:50 | 2014-07-06T01:50:53 | 2013-08-27T15:14:39 | NONE | null | This allows people to add more options to the model, for example if used with a serializer that looks for excluded fields:
```
class User(Model):
class Meta:
excludes = ['id']
```
The kwargs that would be used is unique for each use case.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/226/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/226/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/226",
"html_url": "https://github.com/coleifer/peewee/pull/226",
"diff_url": "https://github.com/coleifer/peewee/pull/226.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/226.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/225 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/225/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/225/comments | https://api.github.com/repos/coleifer/peewee/issues/225/events | https://github.com/coleifer/peewee/pull/225 | 18,451,883 | MDExOlB1bGxSZXF1ZXN0NzgxMDM1OQ== | 225 | add auto reconnect in execute_sql | {
"login": "beanyoung",
"id": 973789,
"node_id": "MDQ6VXNlcjk3Mzc4OQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/973789?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/beanyoung",
"html_url": "https://github.com/beanyoung",
"followers_url": "https://api.github.com/users/bean... | [] | closed | false | null | [] | null | [
"Because `OperationalError` might signify other things than just a closed connection, I'm not too excited about merging this. Perhaps you can subclass your `Database` class and add this logic yourself?\n",
"Check out 51c66e7ed6bcc56940eb39d30c6d9333290e9b55 (and the subsequent commits). You can now define a `sq... | 2013-08-23T03:10:24 | 2015-11-22T05:10:37 | 2013-08-23T21:04:51 | NONE | null | I use peewee with tornado, and all requests share one database connection, but when something wrong happens with database, the connection will be unavaliable. So I added a `try exception` block in `execute_sql()`, and this works fine for me.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/225/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/225/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/225",
"html_url": "https://github.com/coleifer/peewee/pull/225",
"diff_url": "https://github.com/coleifer/peewee/pull/225.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/225.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/224 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/224/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/224/comments | https://api.github.com/repos/coleifer/peewee/issues/224/events | https://github.com/coleifer/peewee/pull/224 | 18,316,008 | MDExOlB1bGxSZXF1ZXN0NzczNzE3NA== | 224 | python3 compatibility fix | {
"login": "lemanyk",
"id": 266274,
"node_id": "MDQ6VXNlcjI2NjI3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/266274?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lemanyk",
"html_url": "https://github.com/lemanyk",
"followers_url": "https://api.github.com/users/lemanyk/fo... | [] | closed | false | null | [] | null | [] | 2013-08-20T19:28:43 | 2014-07-06T01:50:56 | 2013-08-25T01:18:28 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/224/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/224/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/224",
"html_url": "https://github.com/coleifer/peewee/pull/224",
"diff_url": "https://github.com/coleifer/peewee/pull/224.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/224.patch",
"merged_at": null
} | |
https://api.github.com/repos/coleifer/peewee/issues/223 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/223/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/223/comments | https://api.github.com/repos/coleifer/peewee/issues/223/events | https://github.com/coleifer/peewee/pull/223 | 18,031,083 | MDExOlB1bGxSZXF1ZXN0NzU4OTczMg== | 223 | cookbook: missing execute in atomic update docs | {
"login": "spenthil",
"id": 110513,
"node_id": "MDQ6VXNlcjExMDUxMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/110513?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/spenthil",
"html_url": "https://github.com/spenthil",
"followers_url": "https://api.github.com/users/spenthi... | [] | closed | false | null | [] | null | [
"damn that was fast.\n\n\n"
] | 2013-08-14T01:46:04 | 2014-06-25T05:53:56 | 2013-08-14T01:47:07 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/223/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/223/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/223",
"html_url": "https://github.com/coleifer/peewee/pull/223",
"diff_url": "https://github.com/coleifer/peewee/pull/223.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/223.patch",
"merged_at": "2013-08-14T01:47:06"
} | |
https://api.github.com/repos/coleifer/peewee/issues/222 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/222/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/222/comments | https://api.github.com/repos/coleifer/peewee/issues/222/events | https://github.com/coleifer/peewee/issues/222 | 17,857,221 | MDU6SXNzdWUxNzg1NzIyMQ== | 222 | test_multiple_writers from ConcurrencyTestCase fails occasionally | {
"login": "sYnfo",
"id": 1011548,
"node_id": "MDQ6VXNlcjEwMTE1NDg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1011548?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sYnfo",
"html_url": "https://github.com/sYnfo",
"followers_url": "https://api.github.com/users/sYnfo/follower... | [] | closed | false | null | [] | null | [
"Thank you for mentioning this, I will look into it.\n",
"I think the problem is the threads are waiting for locks to release and give up. I noticed the time it took to run the tests was pretty high (versus ~4.4 seconds on my machine).\n\n```\nRan 107 tests in 570.951s # 2.0.9\n\nRan 127 tests in 273.637s # 2... | 2013-08-09T11:04:55 | 2014-03-13T01:44:14 | 2013-08-09T14:20:32 | CONTRIBUTOR | null | it seems to be very rare, I've only seen it happen once for 2.0.9 [0] and once for 2.1.4 [1] in ~30 builds. Sorry if opening an issue is not the right thing to do, just figured you may want to know. :)
[0] http://koji.fedoraproject.org/koji/getfile?taskID=5763686&name=build.log
[1] http://koji.fedoraproject.org/koji/g... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/222/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/222/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/221 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/221/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/221/comments | https://api.github.com/repos/coleifer/peewee/issues/221/events | https://github.com/coleifer/peewee/issues/221 | 17,641,676 | MDU6SXNzdWUxNzY0MTY3Ng== | 221 | Allow to define database dynamically | {
"login": "rudyryk",
"id": 4500,
"node_id": "MDQ6VXNlcjQ1MDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/4500?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rudyryk",
"html_url": "https://github.com/rudyryk",
"followers_url": "https://api.github.com/users/rudyryk/followers"... | [] | closed | false | null | [] | null | [
"See #210 and the docs on proxy:\n\nhttp://peewee.readthedocs.org/en/latest/peewee/playhouse.html#proxy\n\nThis has come up a couple times so I will try to make the docs more obvious on this.\n",
"That's great! Yes, a short reference in main docs chapter about models would solve it, I think. Thank you! :)\n",
"... | 2013-08-05T15:45:52 | 2021-05-03T15:07:52 | 2016-03-30T02:56:48 | NONE | null | Peewee is awesome :+1: :)
I'm using Peewee in my Tornado-powered project and I need to define database connection dynamically, like that:
``` python
import tornado
from peewee import *
class Application(tornado.web.Application):
def __init__(self, **kwargs):
# Some init stuff ...
# Setup DB and... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/221/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/221/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/220 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/220/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/220/comments | https://api.github.com/repos/coleifer/peewee/issues/220/events | https://github.com/coleifer/peewee/issues/220 | 17,374,454 | MDU6SXNzdWUxNzM3NDQ1NA== | 220 | SelectQuery loads all models into memory at once | {
"login": "extesy",
"id": 65872,
"node_id": "MDQ6VXNlcjY1ODcy",
"avatar_url": "https://avatars.githubusercontent.com/u/65872?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/extesy",
"html_url": "https://github.com/extesy",
"followers_url": "https://api.github.com/users/extesy/followers",
... | [] | closed | false | null | [] | null | [
"This problem can partially be addressed by using this:\n\nhttp://peewee.readthedocs.org/en/latest/peewee/cookbook.html#iterating-over-lots-of-rows\n",
"There is also http://initd.org/psycopg/docs/usage.html#server-side-cursors but peewee ~~does not have support for this feature currently~~. Although looking at ... | 2013-07-30T02:27:17 | 2013-08-07T02:42:12 | 2013-08-07T00:44:53 | NONE | null | I have a code like this:
```
for book in Book.select().where(Book.merchant == m).order_by(Book.last_checked_at):
```
And there are approximately 100k rows in the table (PostgreSQL). When I don't use any `limit` functions, peewee loads all those 100k rows at the very beginning of the loop and that takes 250mb of memor... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/220/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/220/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/219 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/219/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/219/comments | https://api.github.com/repos/coleifer/peewee/issues/219/events | https://github.com/coleifer/peewee/issues/219 | 17,150,778 | MDU6SXNzdWUxNzE1MDc3OA== | 219 | Native UUID field | {
"login": "charlierm",
"id": 1155497,
"node_id": "MDQ6VXNlcjExNTU0OTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/1155497?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/charlierm",
"html_url": "https://github.com/charlierm",
"followers_url": "https://api.github.com/users/ch... | [] | closed | false | null | [] | null | [
"Check out the `playhouse` package, bundled with peewee, as it has support for postgres' UUID field:\n\nhttp://peewee.readthedocs.org/en/latest/peewee/playhouse.html#UUIDField\n",
"My mistake, Apologies!\n\nThank you!\n",
"No problem, I need to make the playhouse stuff more obvious as there's some pretty fun to... | 2013-07-24T11:07:14 | 2013-07-24T13:05:21 | 2013-07-24T13:03:53 | NONE | null | I am unsure as to whether this is suitable, however, it would be beneficial to have a UUID field built into Peewee.
PostgreSQL has a native UUID datatype, it could use this when possible, falling back to char when it's not available.
UUIDs are popular, it would be lovely to have them built in if only for the conveni... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/219/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/219/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/218 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/218/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/218/comments | https://api.github.com/repos/coleifer/peewee/issues/218/events | https://github.com/coleifer/peewee/issues/218 | 17,009,659 | MDU6SXNzdWUxNzAwOTY1OQ== | 218 | Problem with InsertQuery() returning AutoIncremented value | {
"login": "odonnellryan",
"id": 1455825,
"node_id": "MDQ6VXNlcjE0NTU4MjU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1455825?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/odonnellryan",
"html_url": "https://github.com/odonnellryan",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"Hey @odonnellryan no need to apologize, thank you for opening the issue. It seems to me that this would be addressing the effect rather than the cause, which is that your model does not have `auto_increment` set to `True`. Do you mind sharing the model definition that is causing this problem?\n\nFor a small exam... | 2013-07-20T18:34:02 | 2013-07-22T02:23:57 | 2013-07-22T02:23:57 | NONE | null | I couldn't get InsertQuery to return the AutoIncremented value upon an Execute. It has (only) returned None for me.
Seems to be a problem with this if statement:
if model._meta.auto_increment:
I've replaced it with:
`def last_insert_id(self, cursor, model):
if not cursor.lastrowid:
return None
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/218/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/218/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/217 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/217/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/217/comments | https://api.github.com/repos/coleifer/peewee/issues/217/events | https://github.com/coleifer/peewee/issues/217 | 16,908,366 | MDU6SXNzdWUxNjkwODM2Ng== | 217 | Where is Q? | {
"login": "andr0s",
"id": 298775,
"node_id": "MDQ6VXNlcjI5ODc3NQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/298775?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/andr0s",
"html_url": "https://github.com/andr0s",
"followers_url": "https://api.github.com/users/andr0s/follow... | [] | closed | false | null | [] | null | [
"If you check, you can see in the notes on upgrading from 1.0 -> 2.0 the API changed and there is no `Q` anymore as the preferred way to query is by referencing the fields directly: http://peewee.readthedocs.org/en/latest/peewee/upgrading.html#upgrading\n\nFor backwards compatibility, `.filter()` can be used along ... | 2013-07-18T08:16:41 | 2013-07-18T23:08:35 | 2013-07-18T23:08:35 | NONE | null | So the docs stated that I can use something like this:
objs = Obj.filter(Q(name='a') | Q(surname='b'))
But when I'm trying to do this, Python simply can't find Q object. I tried to search the source code, but with no luck (found only DQ but not sure it's what I need).
I'm porting some existing Django code to peewee f... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/217/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/217/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/216 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/216/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/216/comments | https://api.github.com/repos/coleifer/peewee/issues/216/events | https://github.com/coleifer/peewee/issues/216 | 16,739,664 | MDU6SXNzdWUxNjczOTY2NA== | 216 | Multiple ForeignKeyField in one Model cause failure on deletion | {
"login": "johnmave126",
"id": 1661662,
"node_id": "MDQ6VXNlcjE2NjE2NjI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1661662?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/johnmave126",
"html_url": "https://github.com/johnmave126",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Following the validation that ensures a related_name cannot override a field on the related model, I have made it raise an `AttributeError` if you attempt to create two foreign keys with the same related_name.\n\nThank you for finding this!\n",
"But the case provided is that two foreign keys with no related_name... | 2013-07-15T05:04:29 | 2013-07-20T10:58:55 | 2013-07-15T15:03:52 | NONE | null | Reproduction:
Using MySQL innoDB (With Foreign Key Constraint check on)
peewee version: HEAD of master branch
``` python
class SampleA(Model):
pass
class SampleB(Model):
s1 = ForeignKeyField(SampleA, null=True)
s2 = ForeignKeyField(SampleA, null=True)
instance1 = SampleA.create()
instance2 = SampleB.crea... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/216/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/216/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/215 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/215/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/215/comments | https://api.github.com/repos/coleifer/peewee/issues/215/events | https://github.com/coleifer/peewee/issues/215 | 16,739,136 | MDU6SXNzdWUxNjczOTEzNg== | 215 | Provide information on escaping and SQL injection | {
"login": "arnuschky",
"id": 179920,
"node_id": "MDQ6VXNlcjE3OTkyMA==",
"avatar_url": "https://avatars.githubusercontent.com/u/179920?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arnuschky",
"html_url": "https://github.com/arnuschky",
"followers_url": "https://api.github.com/users/arnu... | [] | closed | false | null | [] | null | [
"Thanks! Your issue-resolving efficiency is really great!\n"
] | 2013-07-15T04:25:09 | 2013-07-15T14:48:26 | 2013-07-15T14:40:09 | NONE | null | Unfortunately, there seems to be no mentioning of proper escaping using peewee. Is it done automatically? Do we have to do something? How to protect against SQL injection and similar attacks? It would be useful if this could be mentioned in the docs somewhere.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/215/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/215/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.