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/614 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/614/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/614/comments | https://api.github.com/repos/coleifer/peewee/issues/614/events | https://github.com/coleifer/peewee/issues/614 | 83,773,182 | MDU6SXNzdWU4Mzc3MzE4Mg== | 614 | Aggregate Multiple Joins to Same Table | {
"login": "arrowgamer",
"id": 779694,
"node_id": "MDQ6VXNlcjc3OTY5NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/779694?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arrowgamer",
"html_url": "https://github.com/arrowgamer",
"followers_url": "https://api.github.com/users/a... | [] | closed | false | null | [] | null | [
"I didn't realize this broke with the latest changes, that sucks should've had a unit test in place to catch it. I'll look into it, but I'm thinking maybe I need to just scrap `AggregateQueryResultWrapper` and try a rewrite with some new ideas, it's becoming a bit of an eye-sore.\n",
"Did you try `on=SomethingWit... | 2015-06-02T01:07:18 | 2015-06-05T04:36:01 | 2015-06-05T04:36:01 | CONTRIBUTOR | null | I don't appear able to load a join via `aggregate_rows()` when multiple foreign keys point to the same object. This used to be possible.
Consider the below:
``` python
from peewee import *
from unittest import TestCase
db = SqliteDatabase(':memory:')
class Thing(Model):
name = CharField()
class Meta:
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/614/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/614/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/613 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/613/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/613/comments | https://api.github.com/repos/coleifer/peewee/issues/613/events | https://github.com/coleifer/peewee/issues/613 | 83,756,855 | MDU6SXNzdWU4Mzc1Njg1NQ== | 613 | Aggregate Self-Referencing Joins via Child to Parent | {
"login": "arrowgamer",
"id": 779694,
"node_id": "MDQ6VXNlcjc3OTY5NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/779694?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arrowgamer",
"html_url": "https://github.com/arrowgamer",
"followers_url": "https://api.github.com/users/a... | [] | closed | false | null | [] | null | [
"Shoot...be great if in the future the test-cases could use models in the existing tests, as much as I enjoy your 'bro' models lol.\n\nHave you tried using `prefetch` instead of `aggregate_rows()`? I think that there are enough complexities to `aggregate_rows()` that making it a general-purpose does-everything kind... | 2015-06-02T00:15:50 | 2015-06-04T23:26:56 | 2015-06-04T23:26:56 | CONTRIBUTOR | null | Hi there. I tested out your changes in version 2.6.1, and while we're now able to use aggregate_rows() to load a record with its children via a self-referencing join, loading a child with its parent does not seem possible.
Below is the code I'm using to test. The first test now passes. The second test does not pass du... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/613/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/613/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/612 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/612/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/612/comments | https://api.github.com/repos/coleifer/peewee/issues/612/events | https://github.com/coleifer/peewee/issues/612 | 82,918,535 | MDU6SXNzdWU4MjkxODUzNQ== | 612 | Allow for using PEP8 compliant comparisons in boolean Fields | {
"login": "ezk84",
"id": 1305919,
"node_id": "MDQ6VXNlcjEzMDU5MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1305919?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ezk84",
"html_url": "https://github.com/ezk84",
"followers_url": "https://api.github.com/users/ezk84/follower... | [] | closed | false | null | [] | null | [
"There is no way to override the `is` lookup, so this won't work. Same thing for `not`, `and` and `or`.\n",
"@coleifer Would adding something like `.equals(value)` or `.bool(value)` (to http://docs.peewee-orm.com/en/latest/peewee/querying.html#query-operators) be out of the question?",
"I came across this issue... | 2015-05-30T21:33:12 | 2019-03-20T18:34:05 | 2015-05-31T21:38:05 | NONE | null | Current implementation necessitates this sort of syntax:
``` python
Model.selec().where(Model.field == True)
```
This raises a `E712 comparison to True should be 'if cond is True:' or 'if cond:'` and similarly with comparisons to `False`.
Would be nice to be able to do:
``` python
Model.selec().where... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/612/reactions",
"total_count": 5,
"+1": 5,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/612/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/611 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/611/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/611/comments | https://api.github.com/repos/coleifer/peewee/issues/611/events | https://github.com/coleifer/peewee/issues/611 | 81,672,075 | MDU6SXNzdWU4MTY3MjA3NQ== | 611 | Allow the use of connection pooling from within database url | {
"login": "kylef",
"id": 44164,
"node_id": "MDQ6VXNlcjQ0MTY0",
"avatar_url": "https://avatars.githubusercontent.com/u/44164?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kylef",
"html_url": "https://github.com/kylef",
"followers_url": "https://api.github.com/users/kylef/followers",
"f... | [] | closed | false | null | [] | null | [
"Well, actually if you look at the docs, this is now supported. I don't believe I've pushed those changes to PyPI yet, but they will be included in the next release.\n\n\n",
"Oh nice @coleifer, mak... | 2015-05-27T23:35:25 | 2015-05-27T23:57:48 | 2015-05-27T23:46:53 | NONE | null | It would be nice if the [database URL](http://peewee.readthedocs.org/en/latest/peewee/playhouse.html#db-url) API would support connection pooling.
For example, an argument to the connect function which allows you to use pooling if available. `connect('uri', use_pooling=True)`
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/611/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/611/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/610 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/610/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/610/comments | https://api.github.com/repos/coleifer/peewee/issues/610/events | https://github.com/coleifer/peewee/pull/610 | 79,709,388 | MDExOlB1bGxSZXF1ZXN0MzYwODE1MTM= | 610 | Added id accessor to foreign relations, similar to Django. | {
"login": "tals",
"id": 761863,
"node_id": "MDQ6VXNlcjc2MTg2Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/761863?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tals",
"html_url": "https://github.com/tals",
"followers_url": "https://api.github.com/users/tals/followers",
... | [] | closed | false | null | [] | null | [
"Well, I originally didn't want to add this, but thinking about it, enough people have requested this that maybe it'd be a good idea. Thanks I'll go ahead and add some tests.\n"
] | 2015-05-23T03:28:30 | 2015-05-24T17:03:25 | 2015-05-24T17:03:24 | CONTRIBUTOR | null | Models with a ForeignKeyField instance now receive an additional attribute - attr_name_id. This allows you to access the foreign id without bringing in the entire model.
It's currently missing tests, but I figured I should see if you're interested in this first :)
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/610/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/610/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/610",
"html_url": "https://github.com/coleifer/peewee/pull/610",
"diff_url": "https://github.com/coleifer/peewee/pull/610.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/610.patch",
"merged_at": "2015-05-24T17:03:24"
} |
https://api.github.com/repos/coleifer/peewee/issues/609 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/609/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/609/comments | https://api.github.com/repos/coleifer/peewee/issues/609/events | https://github.com/coleifer/peewee/issues/609 | 79,692,832 | MDU6SXNzdWU3OTY5MjgzMg== | 609 | Getting just the ID of a foreign key requires full object | {
"login": "tals",
"id": 761863,
"node_id": "MDQ6VXNlcjc2MTg2Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/761863?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tals",
"html_url": "https://github.com/tals",
"followers_url": "https://api.github.com/users/tals/followers",
... | [] | closed | false | null | [] | null | [
"Poking around the code, it's possible to get something like the Django flavor by having a new descriptor that just returns `_data[self.att_name]` and add it to the object during the `_new_()` call of `ForeignKeyField`\n",
"This query will join `Post` and `User` and eagerly fetch the post's associated user object... | 2015-05-23T02:19:04 | 2015-05-24T19:45:57 | 2015-05-24T17:02:05 | CONTRIBUTOR | null | Hey there,
For illustrative purposes, lets use the following model:
``` python
class User(Model):
name = CharField(max_length=50)
class Post(Model):
author = ForeignKeyField(User)
text = TextField()
all_posts_with_user = Post.select(Post, User).join(User).execute()
all_posts = Post.select().execute()
``... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/609/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/609/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/608 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/608/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/608/comments | https://api.github.com/repos/coleifer/peewee/issues/608/events | https://github.com/coleifer/peewee/issues/608 | 78,940,712 | MDU6SXNzdWU3ODk0MDcxMg== | 608 | Some issues with connection pooling | {
"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 | [
"`lsof` confirms that the app opens only a single connection to the database.\n",
"This is getting stranger still. I have a different connection for every greenlet, and the low-level mysql code seems to create a new connection object to the database for each instance (as expected). However, `lsof` is showing only... | 2015-05-21T10:50:33 | 2015-05-21T20:43:34 | 2015-05-21T17:33:00 | NONE | null | Using latest peewee with a pooled mysql db (I know, sorry... ;) ) It's a single-thread multi-greenlet application.
What we see is that the size of the connections `inuse` monotonically increases, until it hits `max_connections`. Still debugging that right now...
`stale_timeout` is somewhat of a misnomer, right? If I ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/608/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/608/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/607 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/607/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/607/comments | https://api.github.com/repos/coleifer/peewee/issues/607/events | https://github.com/coleifer/peewee/pull/607 | 78,610,050 | MDExOlB1bGxSZXF1ZXN0MzU4NTQ0MzA= | 607 | Introspector doing too much work | {
"login": "pilate",
"id": 131484,
"node_id": "MDQ6VXNlcjEzMTQ4NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/131484?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pilate",
"html_url": "https://github.com/pilate",
"followers_url": "https://api.github.com/users/pilate/follow... | [] | closed | false | null | [] | null | [
"Nice catch, thanks!\n"
] | 2015-05-20T17:08:39 | 2015-05-20T17:39:10 | 2015-05-20T17:39:10 | CONTRIBUTOR | null | Tables from arguments aren't being passed to introspector.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/607/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/607/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/607",
"html_url": "https://github.com/coleifer/peewee/pull/607",
"diff_url": "https://github.com/coleifer/peewee/pull/607.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/607.patch",
"merged_at": "2015-05-20T17:39:10"
} |
https://api.github.com/repos/coleifer/peewee/issues/606 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/606/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/606/comments | https://api.github.com/repos/coleifer/peewee/issues/606/events | https://github.com/coleifer/peewee/pull/606 | 77,164,297 | MDExOlB1bGxSZXF1ZXN0MzU1Nzk0MDI= | 606 | Self refrencing joins with aggregate_rows | {
"login": "arrowgamer",
"id": 779694,
"node_id": "MDQ6VXNlcjc3OTY5NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/779694?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arrowgamer",
"html_url": "https://github.com/arrowgamer",
"followers_url": "https://api.github.com/users/a... | [] | closed | false | null | [] | null | [
"Can you provide a test-case that shows the broken behavior?\n",
"``` python\nfrom peewee import *\nfrom unittest import TestCase\n\ndb = SqliteDatabase(':memory:')\n\n\nclass SomethingThatReferencesItself(Model):\n name = CharField()\n bro = ForeignKeyField('self', null=True, related_name='bros')\n\n cl... | 2015-05-17T00:09:37 | 2015-05-20T02:10:38 | 2015-05-20T01:50:35 | CONTRIBUTOR | null | Hi again. I was trying to use aggregate_rows to eagerly load a model with a self referencing join, and I found that I could not do so unless the rel_for_model function was altered as per this pull request.
The reason is that rel_for_model doesn't appear to support joins via ModelAlias.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/606/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/606/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/606",
"html_url": "https://github.com/coleifer/peewee/pull/606",
"diff_url": "https://github.com/coleifer/peewee/pull/606.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/606.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/605 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/605/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/605/comments | https://api.github.com/repos/coleifer/peewee/issues/605/events | https://github.com/coleifer/peewee/issues/605 | 76,887,260 | MDU6SXNzdWU3Njg4NzI2MA== | 605 | Request for support for complex/null operators | {
"login": "johnboy2",
"id": 5591205,
"node_id": "MDQ6VXNlcjU1OTEyMDU=",
"avatar_url": "https://avatars.githubusercontent.com/u/5591205?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/johnboy2",
"html_url": "https://github.com/johnboy2",
"followers_url": "https://api.github.com/users/johnb... | [] | closed | false | null | [] | null | [
"Hmm...while I can see the benefit of allowing operations to map to callables, I do not have plans to add that currently. You can always subclass `QueryCompiler` and provide your own implementation for `_parse_expression` that does the right thing.\n"
] | 2015-05-15T23:11:32 | 2015-05-16T20:33:30 | 2015-05-16T20:33:30 | NONE | null | As requested in the online documentation, I am proposing a feature change for peewee, as described below.
While looking at subclassing peewee.Database for a project, I quickly realized that some operations that work on PostgreSQL or SQLite have no _direct_ analogy on some platforms I'm looking to use it with. Usually,... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/605/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/605/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/604 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/604/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/604/comments | https://api.github.com/repos/coleifer/peewee/issues/604/events | https://github.com/coleifer/peewee/issues/604 | 75,883,018 | MDU6SXNzdWU3NTg4MzAxOA== | 604 | Connection pooling: re-running failed query in sql_error_handler | {
"login": "tuukkamustonen",
"id": 94327,
"node_id": "MDQ6VXNlcjk0MzI3",
"avatar_url": "https://avatars.githubusercontent.com/u/94327?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tuukkamustonen",
"html_url": "https://github.com/tuukkamustonen",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [
"Have you tried telling the pool to close all connections in the error handler? This might work better:\n\n``` python\n def sql_error_handler(self, exception, sql, params, require_commit):\n\n if isinstance(exception, pymysql.err.OperationalError):\n\n if exception.args[0] in self.CONN_FAILURE_... | 2015-05-13T07:32:55 | 2015-09-30T03:39:59 | 2015-06-02T13:43:34 | NONE | null | Restructued from my email at https://groups.google.com/forum/#!topic/peewee-orm/LDuaQtT-ZTc
I find connection pooling somewhat unusable at the moment due to following:
When using `playhouse.pool.PooledMySQLDatabase`, if database is rebooted (non-HA), open connections in the pool fail the next time they are used.
Tho... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/604/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/604/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/603 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/603/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/603/comments | https://api.github.com/repos/coleifer/peewee/issues/603/events | https://github.com/coleifer/peewee/issues/603 | 75,732,042 | MDU6SXNzdWU3NTczMjA0Mg== | 603 | FTSModels for sqlite pass `options` that are not expected. | {
"login": "mklauber",
"id": 563721,
"node_id": "MDQ6VXNlcjU2MzcyMQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/563721?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mklauber",
"html_url": "https://github.com/mklauber",
"followers_url": "https://api.github.com/users/mklaube... | [] | closed | false | null | [] | null | [
"Doh, Found it in the closed issues. Sorry.\n"
] | 2015-05-12T20:41:47 | 2015-05-12T20:47:54 | 2015-05-12T20:47:54 | NONE | null | I'm having an issue with using the sqlite_ext FTS extension. I'm trying to follow the example from the documentation (reproduced below), but I'm getting the following stack trace. (reproduced _further_ below). Am I missing something, or is this part of the general experimental nature of the sqlite_ext?
``` python
c... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/603/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/603/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/602 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/602/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/602/comments | https://api.github.com/repos/coleifer/peewee/issues/602/events | https://github.com/coleifer/peewee/issues/602 | 75,437,483 | MDU6SXNzdWU3NTQzNzQ4Mw== | 602 | will peewee support table partition? | {
"login": "pyloque",
"id": 2040421,
"node_id": "MDQ6VXNlcjIwNDA0MjE=",
"avatar_url": "https://avatars.githubusercontent.com/u/2040421?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pyloque",
"html_url": "https://github.com/pyloque",
"followers_url": "https://api.github.com/users/pyloque/... | [] | closed | false | null | [] | null | [
"You can probably build something _on top_ of peewee, but peewee itself does not support table partitioning.\n\nIf you want to change the table your query uses at run-time, you can set the `ModelClass._meta.db_table` attribute, e.g.\n\n``` python\nAccount._meta.db_table = 'account_123'\nquery = Account.select().whe... | 2015-05-12T02:53:36 | 2016-08-03T19:27:49 | 2015-05-12T03:54:06 | NONE | null | in our project, table_name is decided by entity field value, so different entities of the same model class can be saved to different tables with same table_name prefix.
I currently self maked an orm framework with less functions.I wish peewee can support table partition,so I could replace it with powerfull peewee.
```... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/602/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/602/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/601 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/601/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/601/comments | https://api.github.com/repos/coleifer/peewee/issues/601/events | https://github.com/coleifer/peewee/issues/601 | 74,917,693 | MDU6SXNzdWU3NDkxNzY5Mw== | 601 | Add method/hook for default table names | {
"login": "mikemill",
"id": 1652125,
"node_id": "MDQ6VXNlcjE2NTIxMjU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1652125?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mikemill",
"html_url": "https://github.com/mikemill",
"followers_url": "https://api.github.com/users/mikem... | [] | closed | false | null | [] | null | [
"Nice idea, be happy to add that.\n",
"Wow, thanks for such a quick response. That solution is awesome!\n"
] | 2015-05-10T13:15:53 | 2015-05-10T15:53:07 | 2015-05-10T15:32:30 | NONE | null | In our project we are using the singular form for the model names and the plural form for the tables. This means each of our models has to have `class Meta: db_table = 'foos'`. It'd be nice if there was a method or hook for defining the default table name algorithm that way it can be defined once. Currently it is co... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/601/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/601/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/600 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/600/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/600/comments | https://api.github.com/repos/coleifer/peewee/issues/600/events | https://github.com/coleifer/peewee/issues/600 | 74,778,482 | MDU6SXNzdWU3NDc3ODQ4Mg== | 600 | Ordering of set in back reference from ForeignKeyField | {
"login": "josefdlange",
"id": 1062835,
"node_id": "MDQ6VXNlcjEwNjI4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1062835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/josefdlange",
"html_url": "https://github.com/josefdlange",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Well, let's say you have `User` and `Tweet` from the docs:\r\n\r\n``` python\r\nclass User(Model):\r\n username = CharField(unique=True)\r\n\r\nclass Tweet(Model):\r\n user = ForeignKeyField(User, related_name='tweets')\r\n content = TextField()\r\n timestamp = DateTimeField(default=datetime.datetime.n... | 2015-05-09T23:05:39 | 2020-11-05T12:44:52 | 2015-05-10T02:17:17 | CONTRIBUTOR | null | Is it possible, in a simple way, to declare what order in which the back reference created by a ForeignKeyField returns? I can sort the items once I get them (in most cases since the backref groups shouldn't be huge), but offloading this work to the DB would be nice. Is there something right in front of me I am missing... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/600/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/600/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/599 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/599/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/599/comments | https://api.github.com/repos/coleifer/peewee/issues/599/events | https://github.com/coleifer/peewee/issues/599 | 74,706,606 | MDU6SXNzdWU3NDcwNjYwNg== | 599 | KeyError with user-defined operations | {
"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 | [
"Actually, I think this is acceptable behavior. It wouldn't be hard to use a second attribute to store instance-specific overrides and merge them when instantiating the `QueryCompiler`, but I think this is OK as-is.\n"
] | 2015-05-09T16:22:45 | 2015-05-10T15:52:34 | 2015-05-10T15:52:34 | OWNER | null | ``` python
from peewee import *
from peewee import OP
from peewee import Expression
db = MySQLDatabase(app.config['MYSQL_DATABASE_DB'], host=app.config['MYSQL_DATABASE_HOST'], user=app.config['MYSQL_DATABASE_USER'], passwd=app.config['MYSQL_DATABASE_PASSWORD'])
OP['MOD'] = 'mod'
def mod(lhs, rhs):
return Express... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/599/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/599/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/598 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/598/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/598/comments | https://api.github.com/repos/coleifer/peewee/issues/598/events | https://github.com/coleifer/peewee/issues/598 | 74,371,604 | MDU6SXNzdWU3NDM3MTYwNA== | 598 | Tests are not run for MySQL? | {
"login": "pmeinhardt",
"id": 706519,
"node_id": "MDQ6VXNlcjcwNjUxOQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/706519?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pmeinhardt",
"html_url": "https://github.com/pmeinhardt",
"followers_url": "https://api.github.com/users/p... | [] | closed | false | null | [] | null | [
"No they are not run for MySQL because there are some failures that I do not intend to fix. MySQL is supported, and most things work, but it is not tested as part of the continuous integration.\n"
] | 2015-05-08T13:52:44 | 2015-05-08T14:04:24 | 2015-05-08T14:04:24 | NONE | null | Tests are only run for SQLite and PostgreSQL at the moment. Is there any particular reason the suite is not run against MySQL? After all `peewee` claims to support MySQL in the README and documentation.
See [.travis.yml](https://github.com/coleifer/peewee/blob/65bf15f93f2f96abf8b216e6eea056726711a19f/.travis.yml#L8-L1... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/598/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/598/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/597 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/597/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/597/comments | https://api.github.com/repos/coleifer/peewee/issues/597/events | https://github.com/coleifer/peewee/pull/597 | 74,137,018 | MDExOlB1bGxSZXF1ZXN0MzQ5NjExNjI= | 597 | Update quickstart.rst | {
"login": "ghost",
"id": 10137,
"node_id": "MDQ6VXNlcjEwMTM3",
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ghost",
"html_url": "https://github.com/ghost",
"followers_url": "https://api.github.com/users/ghost/followers",
"f... | [] | closed | false | null | [] | null | [
"Thank you!\n"
] | 2015-05-07T21:38:42 | 2015-05-07T23:17:37 | 2015-05-07T21:39:38 | NONE | null | Fix typo.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/597/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/597/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/597",
"html_url": "https://github.com/coleifer/peewee/pull/597",
"diff_url": "https://github.com/coleifer/peewee/pull/597.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/597.patch",
"merged_at": "2015-05-07T21:39:38"
} |
https://api.github.com/repos/coleifer/peewee/issues/596 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/596/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/596/comments | https://api.github.com/repos/coleifer/peewee/issues/596/events | https://github.com/coleifer/peewee/issues/596 | 74,114,107 | MDU6SXNzdWU3NDExNDEwNw== | 596 | Feature Request: N+1 query detection | {
"login": "josephschorr",
"id": 4073002,
"node_id": "MDQ6VXNlcjQwNzMwMDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/4073002?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/josephschorr",
"html_url": "https://github.com/josephschorr",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"That's a neat idea, but I'm not sure how to implement that without cluttering up the `ForeignKeyField` / `RelationDescriptor` classes.\n\nOne thing you can do currently, which is very easy, is to use the `assert_query_count` helper in `playhouse.test_utils` ([documentation link](http://docs.peewee-orm.com/en/lates... | 2015-05-07T20:21:00 | 2015-05-07T21:02:12 | 2015-05-07T21:02:12 | NONE | null | It would be really nice if there was a clean way to detect N+1 queries in tests, perhaps by having peewee (when initialized with a flag) raise an exception when accessing a non-cached ForeignKeyField value.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/596/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/596/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/595 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/595/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/595/comments | https://api.github.com/repos/coleifer/peewee/issues/595/events | https://github.com/coleifer/peewee/issues/595 | 73,798,673 | MDU6SXNzdWU3Mzc5ODY3Mw== | 595 | __init__() got an unexpected keyword argument 'abstract' on peewee 2.04 | {
"login": "jbpineiroc",
"id": 12285501,
"node_id": "MDQ6VXNlcjEyMjg1NTAx",
"avatar_url": "https://avatars.githubusercontent.com/u/12285501?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jbpineiroc",
"html_url": "https://github.com/jbpineiroc",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"Without a little more info I have no idea what to do with this.\n\nNext time take the two extra seconds to format your issue at least.\n"
] | 2015-05-07T01:38:43 | 2015-05-07T02:46:36 | 2015-05-07T02:46:36 | NONE | null | File "C:\Python27\lib\site-packages\peewee.py", line 1801, in **new**
cls._meta = ModelOptions(cls, **meta_options)
TypeError: Error when calling the metaclass bases
__init__() got an unexpected keyword argument 'abstract'
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/595/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/595/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/594 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/594/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/594/comments | https://api.github.com/repos/coleifer/peewee/issues/594/events | https://github.com/coleifer/peewee/issues/594 | 73,765,563 | MDU6SXNzdWU3Mzc2NTU2Mw== | 594 | Having a single multi-column index defined in Meta class breaks table/index creation | {
"login": "josefdlange",
"id": 1062835,
"node_id": "MDQ6VXNlcjEwNjI4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1062835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/josefdlange",
"html_url": "https://github.com/josefdlange",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"This is not at all a peewee bug. You just forgot that if you want a tuple with one element you need a trailing comma:\n\n``` python\n class Meta:\n indexes = (\n (('something', 'name'), True), # Added trailing comma.\n )\n```\n",
"D'oh! I learn something new every day. Thanks for the... | 2015-05-06T23:14:08 | 2015-05-06T23:23:53 | 2015-05-06T23:22:53 | CONTRIBUTOR | null | Given the following, table/index creation fails:
```
from peewee import Model, ForeignKeyField
from somewhere import SomeOtherModel
class SomeModel(Model):
something = ForeignKeyField(SomeOtherModel)
name = CharField()
class Meta:
indexes = (
(('something', 'name'), True)
)
``... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/594/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/594/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/593 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/593/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/593/comments | https://api.github.com/repos/coleifer/peewee/issues/593/events | https://github.com/coleifer/peewee/issues/593 | 73,657,255 | MDU6SXNzdWU3MzY1NzI1NQ== | 593 | Query add_column method | {
"login": "stanep",
"id": 3240661,
"node_id": "MDQ6VXNlcjMyNDA2NjE=",
"avatar_url": "https://avatars.githubusercontent.com/u/3240661?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stanep",
"html_url": "https://github.com/stanep",
"followers_url": "https://api.github.com/users/stanep/foll... | [] | closed | false | null | [] | null | [
"No. You can muck around with `SelectQuery._select`, which is a list of the selected columns. Even better is to just use the `SelectQuery.select()` method to modify the list of columns.\n",
"Ok , fair enough\n\nOn Wed, May 6, 2015 at 11:46 AM, Charles Leifer notifications@github.com\nwrote:\n\n> Closed #593 https... | 2015-05-06T15:30:57 | 2015-05-06T15:51:58 | 2015-05-06T15:46:14 | NONE | null | Hi , is it possible to add method to query class so we can do something like this
qr = User.select(User.id)
later on
qr.add_column(User.first_name)
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/593/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/593/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/592 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/592/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/592/comments | https://api.github.com/repos/coleifer/peewee/issues/592/events | https://github.com/coleifer/peewee/issues/592 | 73,378,013 | MDU6SXNzdWU3MzM3ODAxMw== | 592 | Hybrid module | {
"login": "stanep",
"id": 3240661,
"node_id": "MDQ6VXNlcjMyNDA2NjE=",
"avatar_url": "https://avatars.githubusercontent.com/u/3240661?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stanep",
"html_url": "https://github.com/stanep",
"followers_url": "https://api.github.com/users/stanep/foll... | [] | closed | false | null | [] | null | [
"Yeah, I haven't issued a new release yet.\n",
"Anyway great thing hybrid properties,thx\n\nOn Tue, May 5, 2015 at 1:37 PM, Charles Leifer notifications@github.com\nwrote:\n\n> Closed #592 https://github.com/coleifer/peewee/issues/592.\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://githu... | 2015-05-05T17:32:29 | 2015-05-05T18:15:39 | 2015-05-05T17:36:56 | NONE | null | Hi when you do
pip install -U peewee
playhouse get installed but hybrid.py is missing
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/592/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/592/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/591 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/591/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/591/comments | https://api.github.com/repos/coleifer/peewee/issues/591/events | https://github.com/coleifer/peewee/pull/591 | 73,083,846 | MDExOlB1bGxSZXF1ZXN0MzQ2NTgzODg= | 591 | fix when not using named cursor | {
"login": "eseom",
"id": 1251642,
"node_id": "MDQ6VXNlcjEyNTE2NDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1251642?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eseom",
"html_url": "https://github.com/eseom",
"followers_url": "https://api.github.com/users/eseom/follower... | [] | closed | false | null | [] | null | [
"Interesting, what version of psycopg2 are you using?\n",
"missed my environment\nubuntu 14.04\npython 2.7.6\npsycopg2 is 2.4.5 from python-psycopg2 package\n\nIt could be this situation.\n\n```\nimport psycopg2\n\nname = None\nconnection = psycopg2.connect('dbname=test user=test')\ncursor = connection.cursor(nam... | 2015-05-04T17:53:40 | 2015-05-05T16:25:15 | 2015-05-05T16:25:15 | CONTRIBUTOR | null | I'm using peewee on my projects. Thanks. :)
I wrote a simple connection to the postgresql server without named cursor.
```
from peewee import * # NOQA
from playhouse.postgres_ext import * # NOQA
database = PostgresqlExtDatabase('test', user='test')
class MyModel(Model):
name = CharField()
value = CharFie... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/591/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/591/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/591",
"html_url": "https://github.com/coleifer/peewee/pull/591",
"diff_url": "https://github.com/coleifer/peewee/pull/591.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/591.patch",
"merged_at": "2015-05-05T16:25:15"
} |
https://api.github.com/repos/coleifer/peewee/issues/590 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/590/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/590/comments | https://api.github.com/repos/coleifer/peewee/issues/590/events | https://github.com/coleifer/peewee/issues/590 | 72,314,052 | MDU6SXNzdWU3MjMxNDA1Mg== | 590 | Default for register_hstore in postgresql extensions should be False | {
"login": "elgow",
"id": 11529401,
"node_id": "MDQ6VXNlcjExNTI5NDAx",
"avatar_url": "https://avatars.githubusercontent.com/u/11529401?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/elgow",
"html_url": "https://github.com/elgow",
"followers_url": "https://api.github.com/users/elgow/follow... | [] | closed | false | null | [] | null | [] | 2015-04-30T23:57:09 | 2015-05-01T01:29:25 | 2015-05-01T01:29:25 | NONE | null | Default usage of the pewee playhouse postgresql extension fails to work with an out-of-the-box postgresql database. The postgresql database ships with the hstore extension not installed, but the playhouse postgresql extension has this default setting.
kwargs.pop('register_hstore', True)
This causes the DB to fai... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/590/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/590/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/589 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/589/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/589/comments | https://api.github.com/repos/coleifer/peewee/issues/589/events | https://github.com/coleifer/peewee/issues/589 | 72,106,179 | MDU6SXNzdWU3MjEwNjE3OQ== | 589 | Closing MySQL Database and / or Model creation decorator | {
"login": "conqp",
"id": 3766192,
"node_id": "MDQ6VXNlcjM3NjYxOTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/3766192?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/conqp",
"html_url": "https://github.com/conqp",
"followers_url": "https://api.github.com/users/conqp/follower... | [] | closed | false | null | [] | null | [
"I prefer to keep model creation APIs as-is. Of course if you like using this function to create tables at module-load time then you could release it as a peewee extension. I prefer to avoid any import-time side-effects and APIs that promote them.\n",
"Thanks for the feedback. But what about the first part of the... | 2015-04-30T09:10:55 | 2015-04-30T15:04:47 | 2015-04-30T13:01:09 | CONTRIBUTOR | null | Hi coleifer,
I am working with peewee now for some time - mostly with MySQL databases - and have encountered several problems regarding the lack of automatic closing of database connections, particularly Error 2006 as described here: http://peewee.readthedocs.org/en/latest/peewee/database.html#using-mysql
I have modif... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/589/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/589/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/588 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/588/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/588/comments | https://api.github.com/repos/coleifer/peewee/issues/588/events | https://github.com/coleifer/peewee/issues/588 | 71,552,112 | MDU6SXNzdWU3MTU1MjExMg== | 588 | Adding a column with SqliteMigrator fails on tables which already have an index | {
"login": "tfeldmann",
"id": 385566,
"node_id": "MDQ6VXNlcjM4NTU2Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/385566?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tfeldmann",
"html_url": "https://github.com/tfeldmann",
"followers_url": "https://api.github.com/users/tfel... | [] | closed | false | null | [] | null | [
"Peewee is currently at 2.6.0, and this code runs correctly under 2.6.0, so I'm not sure what more I can tell you besides _upgrade_! :)\n",
"Ok, this is strange. I tested it in Ubuntu 15.04 and Windows 8.1 VMs and it works. But I can reproduce the error every time on my system in both python2 and python3.\n\npeew... | 2015-04-28T10:40:41 | 2015-04-29T15:35:14 | 2015-04-28T14:15:42 | NONE | null | Hello Charles,
I have a problem with adding a column to one of my tables. I created a short example program which reproduces the error.
I found the problem was introduced in peewee 2.4.3
Greetings,
Thomas
``` python
from peewee import *
from peewee import create_model_tables
from playhouse.migrate import SqliteMigr... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/588/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/588/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/587 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/587/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/587/comments | https://api.github.com/repos/coleifer/peewee/issues/587/events | https://github.com/coleifer/peewee/issues/587 | 71,111,523 | MDU6SXNzdWU3MTExMTUyMw== | 587 | Support for "on conflict" clause | {
"login": "elya5",
"id": 4464481,
"node_id": "MDQ6VXNlcjQ0NjQ0ODE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4464481?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/elya5",
"html_url": "https://github.com/elya5",
"followers_url": "https://api.github.com/users/elya5/follower... | [] | closed | false | null | [] | null | [] | 2015-04-26T19:46:01 | 2015-04-26T21:41:49 | 2015-04-26T21:41:49 | NONE | null | It would be great to have support for the `on conflict` clause as it is described [here](https://www.sqlite.org/lang_conflict.html) for sqlite.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/587/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/587/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/586 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/586/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/586/comments | https://api.github.com/repos/coleifer/peewee/issues/586/events | https://github.com/coleifer/peewee/issues/586 | 70,713,167 | MDU6SXNzdWU3MDcxMzE2Nw== | 586 | Class methods on model instances (why?) | {
"login": "foxx",
"id": 651797,
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/foxx",
"html_url": "https://github.com/foxx",
"followers_url": "https://api.github.com/users/foxx/followers",
... | [] | closed | false | null | [] | null | [
"Classmethods operate on the table. Instance methods operate on the rows. Class represents table, instance represents row. It is just an inconvenient fact of python's `classmethod` decorator that you can call classmethods from an instance. I could write a special decorator that prevented this, e.g. `classonlymethod... | 2015-04-24T15:07:50 | 2015-04-24T15:13:12 | 2015-04-24T15:10:04 | CONTRIBUTOR | null | As per [documentation](1), models have class methods such as `get_or_create`, which can be used to create a new model instance. Merging together object and objectset methods doesn't feel like a clean abstraction (imho), e.g. the ability to `get` another object which is unrelated to the object we're calling `get` from. ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/586/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/586/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/585 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/585/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/585/comments | https://api.github.com/repos/coleifer/peewee/issues/585/events | https://github.com/coleifer/peewee/issues/585 | 70,683,256 | MDU6SXNzdWU3MDY4MzI1Ng== | 585 | connect() doesn't allow sqlite://:memory: | {
"login": "foxx",
"id": 651797,
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/foxx",
"html_url": "https://github.com/foxx",
"followers_url": "https://api.github.com/users/foxx/followers",
... | [] | closed | false | null | [] | null | [
"The correct way is to write:\n\n``` python\nconnect('sqlite:///:memory:')\n```\n",
"Doh, you are correct. Confirmed working, my apologies.\n"
] | 2015-04-24T12:56:43 | 2015-04-24T15:08:45 | 2015-04-24T14:30:14 | CONTRIBUTOR | null | The following code does not work;
``` py
db = connect('sqlite://:memory:')
File "/usr/lib/python2.7/urlparse.py", line 113, in port
port = int(port, 10)
ValueError: invalid literal for int() with base 10: 'memory'
```
This is because `urlparse` doesn't see the above as a valid connection string, and rightly so... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/585/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/585/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/584 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/584/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/584/comments | https://api.github.com/repos/coleifer/peewee/issues/584/events | https://github.com/coleifer/peewee/issues/584 | 70,667,789 | MDU6SXNzdWU3MDY2Nzc4OQ== | 584 | Lastly... thank you | {
"login": "foxx",
"id": 651797,
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/foxx",
"html_url": "https://github.com/foxx",
"followers_url": "https://api.github.com/users/foxx/followers",
... | [] | closed | false | null | [] | null | [
"Glad you're enjoying using peewee!\n"
] | 2015-04-24T11:40:50 | 2015-04-24T14:29:08 | 2015-04-24T14:29:08 | CONTRIBUTOR | null | I've raised quite a few issues today, but I'd just like to take a moment to say a huge thank you to everyone involved in getting peewee where it is today. The code appears to be well written, I was able to easily follow the source code and understand what was happening, and overall is just a pleasure to use.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/584/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/584/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/583 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/583/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/583/comments | https://api.github.com/repos/coleifer/peewee/issues/583/events | https://github.com/coleifer/peewee/issues/583 | 70,667,387 | MDU6SXNzdWU3MDY2NzM4Nw== | 583 | Database router and connection manager support | {
"login": "foxx",
"id": 651797,
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/foxx",
"html_url": "https://github.com/foxx",
"followers_url": "https://api.github.com/users/foxx/followers",
... | [] | closed | false | null | [] | null | [
"Extending the discussion from #582, I was unable to find a clean way to introduce module inspection into Peewee without also bringing in the concept of 'apps', which is way outside of its scope as an ORM.\n\nThe cleanest way I've found so far is to use a connection manager by wrapping each connection with a proxy ... | 2015-04-24T11:37:53 | 2015-04-24T14:33:10 | 2015-04-24T14:28:52 | CONTRIBUTOR | null | As an extension from #582, although Playhouse has an existing class for [ReadSlave](3), it doesn't appear to be a suitable replacement for database routers, as seen in [django](4).
Admittedly adding support for database routers would most likely require some sort of connections manager, and would need some careful th... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/583/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/583/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/582 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/582/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/582/comments | https://api.github.com/repos/coleifer/peewee/issues/582/events | https://github.com/coleifer/peewee/issues/582 | 70,667,073 | MDU6SXNzdWU3MDY2NzA3Mw== | 582 | test_database requires explicit list of models | {
"login": "foxx",
"id": 651797,
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/foxx",
"html_url": "https://github.com/foxx",
"followers_url": "https://api.github.com/users/foxx/followers",
... | [] | closed | false | null | [] | null | [
"As a temporary workaround, I was able to do the following;\n\n``` py\nimport unittest\nimport inspect\nimport models\nimport peewee\nfrom app import testdb\nfrom playhouse.test_utils import test_database\n\nclass PeeweeTestDatabaseMixin(object):\n def run(self, *args, **kwargs):\n classes = [ v for k,v i... | 2015-04-24T11:35:52 | 2015-04-24T14:32:56 | 2015-04-24T14:06:20 | CONTRIBUTOR | null | If you wish to use `test_database`, you have to give it an explicit list of models, as seen [here](1). This can lead to some surprising behaviour if you create a model class and forget to add it to the list.
One way around this, as seen [here](2), is to use module inspection to auto detect classes without having to ex... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/582/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/582/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/581 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/581/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/581/comments | https://api.github.com/repos/coleifer/peewee/issues/581/events | https://github.com/coleifer/peewee/issues/581 | 70,655,515 | MDU6SXNzdWU3MDY1NTUxNQ== | 581 | db_url.connect does not support pooling | {
"login": "foxx",
"id": 651797,
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/foxx",
"html_url": "https://github.com/foxx",
"followers_url": "https://api.github.com/users/foxx/followers",
... | [] | closed | false | null | [] | null | [
"In the mean time, for anyone who comes across this problem in the future, I was able to get a temporary monkeypatch working;\n\n``` py\nfrom playhouse import db_url\nfrom playhouse.pool import PooledMySQLDatabase\ndb_url.schemes['mysql'] = PooledMySQLDatabase\n```\n\nThe above will replace the MySQL backend with a... | 2015-04-24T10:44:45 | 2015-04-24T15:10:06 | 2015-04-24T14:26:45 | CONTRIBUTOR | null | As seen [here](1), there is no way to make `connect()` use a pooled connection. I've looked over the code and there doesn't appear to be any way to convert an existing DB object into a pooled one, at least short of using some horrible metaclass hacks or monkey patching.
Could someone clarify if this feature is on the ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/581/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/581/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/580 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/580/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/580/comments | https://api.github.com/repos/coleifer/peewee/issues/580/events | https://github.com/coleifer/peewee/issues/580 | 70,641,084 | MDU6SXNzdWU3MDY0MTA4NA== | 580 | JSON support with MariaDB | {
"login": "foxx",
"id": 651797,
"node_id": "MDQ6VXNlcjY1MTc5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/651797?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/foxx",
"html_url": "https://github.com/foxx",
"followers_url": "https://api.github.com/users/foxx/followers",
... | [] | closed | false | null | [] | null | [
"I have no plans myself for adding support for any MySQL-specific features since between Postgres and SQLite I never find myself using MySQL. That said, I would certainly be open to a well-tested pull-request (with documentation).\n",
"Thanks for the quick reply, if I end up using MariaDB JSON heavily then I'll p... | 2015-04-24T09:39:47 | 2015-04-24T14:02:44 | 2015-04-24T14:01:18 | CONTRIBUTOR | null | It would seem that Playhouse has [support](1) for Postgres JSON, where as it doesn't have the same for MySQL. MariaDB, which is backwards compatible, has [supported](1) JSON since 10.0.1 and it would be fantastic to see Playhouse support for this.
Are there any plans to put this on the roadmap?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/580/reactions",
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 1,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/580/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/579 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/579/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/579/comments | https://api.github.com/repos/coleifer/peewee/issues/579/events | https://github.com/coleifer/peewee/pull/579 | 70,232,871 | MDExOlB1bGxSZXF1ZXN0MzM5MDAzMTc= | 579 | Log slow queries | {
"login": "koblas",
"id": 219934,
"node_id": "MDQ6VXNlcjIxOTkzNA==",
"avatar_url": "https://avatars.githubusercontent.com/u/219934?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/koblas",
"html_url": "https://github.com/koblas",
"followers_url": "https://api.github.com/users/koblas/follow... | [] | closed | false | null | [] | null | [] | 2015-04-22T20:57:04 | 2015-04-22T20:57:26 | 2015-04-22T20:57:26 | NONE | null | Test Plan: Local testing on dev box
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/579/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/579/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/579",
"html_url": "https://github.com/coleifer/peewee/pull/579",
"diff_url": "https://github.com/coleifer/peewee/pull/579.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/579.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/578 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/578/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/578/comments | https://api.github.com/repos/coleifer/peewee/issues/578/events | https://github.com/coleifer/peewee/pull/578 | 69,993,449 | MDExOlB1bGxSZXF1ZXN0MzM4MTg0NTA= | 578 | let the Meta class can extends from another class | {
"login": "anjianshi",
"id": 5005012,
"node_id": "MDQ6VXNlcjUwMDUwMTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/5005012?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/anjianshi",
"html_url": "https://github.com/anjianshi",
"followers_url": "https://api.github.com/users/an... | [] | closed | false | null | [] | null | [
"I can see the reasoning behind this change, but I'm loth to introduce any changes that might break existing applications. I'm not sure off-hand, but given the way peewee munges `Meta` objects at present, there may be some edge-cases or situations where this breaks.\n\nWhat do you think?\n",
"I see, the `dir()` f... | 2015-04-22T01:19:05 | 2015-04-22T04:47:09 | 2015-04-22T04:47:09 | NONE | null | Example:
``` python
db = PostgresqlDatabase("mydb")
class BaseMeta:
database = db
class BaseModel(Model):
class Meta(BaseMeta):
pass
class ModelA(Model):
pass
class ModelB(Model):
class Meta(BaseMeta):
db_table = "model_b"
```
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/578/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/578/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/578",
"html_url": "https://github.com/coleifer/peewee/pull/578",
"diff_url": "https://github.com/coleifer/peewee/pull/578.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/578.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/577 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/577/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/577/comments | https://api.github.com/repos/coleifer/peewee/issues/577/events | https://github.com/coleifer/peewee/issues/577 | 69,896,638 | MDU6SXNzdWU2OTg5NjYzOA== | 577 | peewee.DataError: (1406, "Data too long for column ... | {
"login": "martinburch",
"id": 2335284,
"node_id": "MDQ6VXNlcjIzMzUyODQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/2335284?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/martinburch",
"html_url": "https://github.com/martinburch",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Sorry, I think this was a database issue, peewee was just passing back the error.\n"
] | 2015-04-21T16:48:21 | 2015-04-21T16:57:39 | 2015-04-21T16:57:39 | NONE | null | I'm trying to create a custom field type
```
class JSONField(Field):
def db_value(self, value):
return json.dumps(value)
def python_value(self, value):
return json.load(value)
```
And then use this to write some data. But I'm being told its too long for the column. How do I explain to peewee... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/577/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/577/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/576 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/576/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/576/comments | https://api.github.com/repos/coleifer/peewee/issues/576/events | https://github.com/coleifer/peewee/pull/576 | 69,109,649 | MDExOlB1bGxSZXF1ZXN0MzM1MzA5ODU= | 576 | Update database.rst | {
"login": "jiffies",
"id": 1257256,
"node_id": "MDQ6VXNlcjEyNTcyNTY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1257256?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jiffies",
"html_url": "https://github.com/jiffies",
"followers_url": "https://api.github.com/users/jiffies/... | [] | closed | false | null | [] | null | [
"thnx porco rosso\n"
] | 2015-04-17T10:14:28 | 2015-04-17T13:01:31 | 2015-04-17T13:01:22 | CONTRIBUTOR | null | Mysql databse url format should like postgresql.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/576/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/576/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/576",
"html_url": "https://github.com/coleifer/peewee/pull/576",
"diff_url": "https://github.com/coleifer/peewee/pull/576.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/576.patch",
"merged_at": "2015-04-17T13:01:22"
} |
https://api.github.com/repos/coleifer/peewee/issues/575 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/575/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/575/comments | https://api.github.com/repos/coleifer/peewee/issues/575/events | https://github.com/coleifer/peewee/issues/575 | 68,942,152 | MDU6SXNzdWU2ODk0MjE1Mg== | 575 | peewee successfully updates model with existed unique fields | {
"login": "semolex",
"id": 7127330,
"node_id": "MDQ6VXNlcjcxMjczMzA=",
"avatar_url": "https://avatars.githubusercontent.com/u/7127330?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/semolex",
"html_url": "https://github.com/semolex",
"followers_url": "https://api.github.com/users/semolex/... | [] | closed | false | null | [] | null | [
"I'm not sure I understand what is happening. Can you share code to replicate the issue?\n",
"I feel sorry for disturbing you. It is not issue of peewee itself, it was at DB level...\n"
] | 2015-04-16T14:57:29 | 2015-04-17T19:53:05 | 2015-04-17T19:52:34 | NONE | null | I have such code:
``` python
class User(peewee.Model):
username = peewee.CharField(unique=True, max_length=50)
password = peewee.CharField()
email = peewee.CharField(unique=True, max_length=80)
status = peewee.IntegerField(choices=[(1, 'active'), (2, 'inactive'), (3, 'blocked')], default=1)
class M... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/575/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/575/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/574 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/574/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/574/comments | https://api.github.com/repos/coleifer/peewee/issues/574/events | https://github.com/coleifer/peewee/pull/574 | 68,893,544 | MDExOlB1bGxSZXF1ZXN0MzM0MzcwNDI= | 574 | Support encoding in Postgres | {
"login": "klen",
"id": 90699,
"node_id": "MDQ6VXNlcjkwNjk5",
"avatar_url": "https://avatars.githubusercontent.com/u/90699?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/klen",
"html_url": "https://github.com/klen",
"followers_url": "https://api.github.com/users/klen/followers",
"follo... | [] | closed | false | null | [] | null | [
"Thanks!\n",
"Thank you! Can I hope on patch-release?\n",
"I'll probably wait a bit as I just released a new one not long ago. Maybe a couple weeks?\n",
"Up to you. But for now I have to use manual installation from github, it's not compatible.\n",
"I just released 2.6.0.\n",
"Great! Thank you!\n"
] | 2015-04-16T10:22:45 | 2015-04-22T07:09:31 | 2015-04-17T17:17:32 | CONTRIBUTOR | null | Hello,
In my case I work with a lot of unicode data. All my databases have a UTF-8 encoding, but I've got errors like this: `UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128)`.
I knew about the trick:
``` python
database = PosgresqlDatabase(database, **connection_pa... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/574/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/574/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/574",
"html_url": "https://github.com/coleifer/peewee/pull/574",
"diff_url": "https://github.com/coleifer/peewee/pull/574.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/574.patch",
"merged_at": "2015-04-17T17:17:32"
} |
https://api.github.com/repos/coleifer/peewee/issues/573 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/573/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/573/comments | https://api.github.com/repos/coleifer/peewee/issues/573/events | https://github.com/coleifer/peewee/issues/573 | 68,882,251 | MDU6SXNzdWU2ODg4MjI1MQ== | 573 | postgres_ext do not support LTreeField? | {
"login": "dllhlx",
"id": 7111160,
"node_id": "MDQ6VXNlcjcxMTExNjA=",
"avatar_url": "https://avatars.githubusercontent.com/u/7111160?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dllhlx",
"html_url": "https://github.com/dllhlx",
"followers_url": "https://api.github.com/users/dllhlx/foll... | [] | closed | false | null | [] | null | [
"i find define of LTreeFiled in peewee old version - 0.9.9 , why delete this logic in lastest version ?\n",
"> from the docs we can know peewee ext can support postgres ltree\n\nWhere in the docs does it say this?\n",
"I have no intentions of adding LTree back, but would accept pull-requests.\n"
] | 2015-04-16T09:24:13 | 2015-04-18T18:37:05 | 2015-04-18T18:37:05 | NONE | null | from the docs <http://docs.peewee-orm.com/en/1.0.0/peewee/playhouse.html#ltree > we can know peewee ext can support postgres ltree but in the source code in github we can not find the define of LTreeField. why?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/573/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/573/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/572 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/572/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/572/comments | https://api.github.com/repos/coleifer/peewee/issues/572/events | https://github.com/coleifer/peewee/issues/572 | 68,785,637 | MDU6SXNzdWU2ODc4NTYzNw== | 572 | PostgerSQL:how to add explicit type casts? | {
"login": "khahux",
"id": 4948118,
"node_id": "MDQ6VXNlcjQ5NDgxMTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/4948118?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/khahux",
"html_url": "https://github.com/khahux",
"followers_url": "https://api.github.com/users/khahux/foll... | [] | closed | false | null | [] | null | [
"Hey, if you are using the `PostgresqlExtDatabase` you can use `cls.created_at.cast('text') ** format`.\n\nHonestly why on earth are you doing your date comparison like that, though?! You can use the `between()` function, `fn.date_trunc()`, so many alternatives.\n\nFor example, I believe this should work:\n\n``` py... | 2015-04-15T20:58:42 | 2015-04-16T00:59:45 | 2015-04-16T00:59:45 | NONE | null | ```
@classmethod
def get_blog_by_date(cls, year, month):
format = '%%%s-%s%%' % (year, month)
return cls.select(cls.created_at).where(cls.created_at ** format)
```
------ error ------
ProgrammingError: operator does not exist: timestamp without time zone ~~\* unknown
LINE 1: ...ed_at" FROM "blog" AS t1... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/572/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/572/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/571 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/571/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/571/comments | https://api.github.com/repos/coleifer/peewee/issues/571/events | https://github.com/coleifer/peewee/issues/571 | 68,598,255 | MDU6SXNzdWU2ODU5ODI1NQ== | 571 | A more powerful get_or_create method | {
"login": "lsc20051426",
"id": 219287,
"node_id": "MDQ6VXNlcjIxOTI4Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/219287?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lsc20051426",
"html_url": "https://github.com/lsc20051426",
"followers_url": "https://api.github.com/user... | [] | closed | false | null | [] | null | [
"I think I will pass on making changes to the implementation. The method has been deprecated for some time and there is documentation on implementing it yourself:\n\nhttp://docs.peewee-orm.com/en/latest/peewee/querying.html#get-or-create\n",
"These changes are now included in the new version 2.6.0. The function b... | 2015-04-15T07:17:42 | 2015-04-28T06:34:43 | 2015-04-15T20:09:15 | NONE | null | Currently the get_or_create is pretty weak.
Here is the example from django:
```
try:
obj = Person.objects.get(first_name='John', last_name='Lennon')
except Person.DoesNotExist:
obj = Person(first_name='John', last_name='Lennon', birthday=date(1940, 10, 9))
obj.save()
```
This pattern gets quite unwieldy ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/571/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/571/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/570 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/570/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/570/comments | https://api.github.com/repos/coleifer/peewee/issues/570/events | https://github.com/coleifer/peewee/issues/570 | 68,462,093 | MDU6SXNzdWU2ODQ2MjA5Mw== | 570 | joining is not allowed on UpdateQuery instances | {
"login": "arski",
"id": 904818,
"node_id": "MDQ6VXNlcjkwNDgxOA==",
"avatar_url": "https://avatars.githubusercontent.com/u/904818?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arski",
"html_url": "https://github.com/arski",
"followers_url": "https://api.github.com/users/arski/followers"... | [] | closed | false | null | [] | null | [
"``` python\nus_pub = Publisher.select().where(Publisher.country == 'US')\nBook.update(foo='bar').where(Book.publisher << us_pub)\n```\n\nIIRC only MySQL supports joins on update queries, while SQLite and Postgres do not. Subqueries are the way to go.\n",
"aha! thanks for the quick reply.\n",
"actually, what if... | 2015-04-14T18:28:18 | 2020-07-28T14:09:28 | 2015-04-14T18:31:19 | NONE | null | this is an error message from peewee. May I ask why this is though? Let's assume I want to run an update on Books where the Publisher of said book is based in the US. That's imo a very common update query. Or is there just a different way of doing this during an update?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/570/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/570/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/569 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/569/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/569/comments | https://api.github.com/repos/coleifer/peewee/issues/569/events | https://github.com/coleifer/peewee/pull/569 | 65,986,903 | MDExOlB1bGxSZXF1ZXN0MzI1MzgxMTM= | 569 | Expose parsed db url | {
"login": "stt",
"id": 245985,
"node_id": "MDQ6VXNlcjI0NTk4NQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/245985?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stt",
"html_url": "https://github.com/stt",
"followers_url": "https://api.github.com/users/stt/followers",
"fol... | [] | closed | false | null | [] | null | [
"Nice! Do you mind adding a test-case for the new function?\n",
"Sure, :+1: ?\n",
"Thanks!\n"
] | 2015-04-02T18:38:59 | 2015-04-03T14:09:14 | 2015-04-03T14:09:12 | CONTRIBUTOR | null | It'd be useful to get the parsed dict from db_url so it could be used with pooled connections as well.
E.g.:
```
db = PooledMySQLDatabase(
max_connections=32,
stale_timeout=300, # 5 minutes.
**db_url.parse(app.config['DATABASE_URL'])
)
```
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/569/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/569/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/569",
"html_url": "https://github.com/coleifer/peewee/pull/569",
"diff_url": "https://github.com/coleifer/peewee/pull/569.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/569.patch",
"merged_at": "2015-04-03T14:09:12"
} |
https://api.github.com/repos/coleifer/peewee/issues/568 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/568/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/568/comments | https://api.github.com/repos/coleifer/peewee/issues/568/events | https://github.com/coleifer/peewee/issues/568 | 65,792,741 | MDU6SXNzdWU2NTc5Mjc0MQ== | 568 | Snippet function on FTS tables. | {
"login": "leiserfg",
"id": 2947276,
"node_id": "MDQ6VXNlcjI5NDcyNzY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2947276?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/leiserfg",
"html_url": "https://github.com/leiserfg",
"followers_url": "https://api.github.com/users/leise... | [] | closed | false | null | [] | null | [
"The problem is that peewee assumes when it encounters a Model as part of a query, that it should alias it to the alias used for that table. In this case, however, we don't want that -- we simply want the table name to be passed in.\n\nTo remedy, you can rewrite this as:\n\n``` python\nfrom peewee import Entity\n(F... | 2015-04-01T22:28:14 | 2018-10-02T12:31:44 | 2015-04-02T00:08:23 | NONE | null | When i write
``` python
FTSBook.select(fn.snippet(FTSBook)).where(FTSBook.match('python'))
```
it returns:
``` sql
SELECT snippet("ftsbook" AS t1) FROM "ftsbook" AS t1 WHERE ("ftsbook" MATCH 'python')
```
But if i run this query it fails:
```
near "AS": syntax error
```
is it a bug in peewee or there is a way... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/568/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/568/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/567 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/567/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/567/comments | https://api.github.com/repos/coleifer/peewee/issues/567/events | https://github.com/coleifer/peewee/issues/567 | 65,690,955 | MDU6SXNzdWU2NTY5MDk1NQ== | 567 | Unable to create json or jsonb columns in Postgres 9.4 | {
"login": "wishabhilash",
"id": 831818,
"node_id": "MDQ6VXNlcjgzMTgxOA==",
"avatar_url": "https://avatars.githubusercontent.com/u/831818?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wishabhilash",
"html_url": "https://github.com/wishabhilash",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [
"You need to use playhouse.postgres_ext.PostgresqlExtDatabase.\n",
"Ohh thanks... :+1: \n"
] | 2015-04-01T13:59:49 | 2015-04-07T19:44:48 | 2015-04-01T14:34:15 | NONE | null | Am trying to create a table with a jsonb column but its keeps on giving me error.
```
from peewee import *
from playhouse.postgres_ext import BinaryJSONField
db = PostgresqlDatabase(database="test")
class JSONTest3(Model):
username = BinaryJSONField()
class Meta:
database = db
if __name__ == '__mai... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/567/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/567/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/566 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/566/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/566/comments | https://api.github.com/repos/coleifer/peewee/issues/566/events | https://github.com/coleifer/peewee/issues/566 | 65,562,653 | MDU6SXNzdWU2NTU2MjY1Mw== | 566 | UNION query | {
"login": "ybahador",
"id": 9665921,
"node_id": "MDQ6VXNlcjk2NjU5MjE=",
"avatar_url": "https://avatars.githubusercontent.com/u/9665921?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ybahador",
"html_url": "https://github.com/ybahador",
"followers_url": "https://api.github.com/users/ybaha... | [] | closed | false | null | [] | null | [
"Can you share your code and the SQL? Its hard to help without any clues you know...\n",
"Also what database are you using? If you can't share your exact query can you give me an example that fails in a similar way?\n",
"Please comment and I will re-open.\n",
"I'm using postgres as my database.\n\nHere is my ... | 2015-03-31T22:41:26 | 2015-04-03T04:20:51 | 2015-04-03T00:23:45 | NONE | null | I'm making a compound query by using the | operator but the generated query does not have correct parenthesis and results in a SQL error.
I'm using peewee version 2.5.0
I've also found a similar issue (#454) and based on the discussion it seems that the issue has been fixed in previous versions, It's strange that I'm... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/566/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/566/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/565 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/565/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/565/comments | https://api.github.com/repos/coleifer/peewee/issues/565/events | https://github.com/coleifer/peewee/issues/565 | 64,942,927 | MDU6SXNzdWU2NDk0MjkyNw== | 565 | PrimaryKey issue with peewee and pymysql | {
"login": "ckoepp",
"id": 1830022,
"node_id": "MDQ6VXNlcjE4MzAwMjI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1830022?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ckoepp",
"html_url": "https://github.com/ckoepp",
"followers_url": "https://api.github.com/users/ckoepp/foll... | [] | closed | false | null | [] | null | [
"If you use `IntegerField` then it will not be auto-incrementing. Instead you should use `PrimaryKeyField` which contains the appropriate \"AUTO INCREMENT\" clause.\n"
] | 2015-03-28T13:31:29 | 2015-03-28T14:50:09 | 2015-03-28T14:50:09 | NONE | null | I ran into an issue with primary keys when using pymysql in combination with peewee. Somehow the default value for the integer PK always is 0 which of course leads to problems when more than one object is created. A minimal example is the following code using a (rather stupid) Cat object and adding two cats:
```
from... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/565/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/565/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/564 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/564/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/564/comments | https://api.github.com/repos/coleifer/peewee/issues/564/events | https://github.com/coleifer/peewee/pull/564 | 64,866,576 | MDExOlB1bGxSZXF1ZXN0MzIxNTE3NjI= | 564 | Update pk seq | {
"login": "elgow",
"id": 11529401,
"node_id": "MDQ6VXNlcjExNTI5NDAx",
"avatar_url": "https://avatars.githubusercontent.com/u/11529401?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/elgow",
"html_url": "https://github.com/elgow",
"followers_url": "https://api.github.com/users/elgow/follow... | [] | closed | false | null | [] | null | [
"Thank you for the effort you put into this, but I don't have any plans to merge this functionality, as it seems to me something that would be a better fit for your own library code.\n",
"The use case for this is actually very common. Many, if not most, DBs have some reference tables that are populated with an in... | 2015-03-27T22:54:06 | 2015-03-28T21:04:13 | 2015-03-28T02:36:11 | NONE | null | New method to force the DB to ensure that the next auto-generated key will be greater than any existing key, including explicitly inserted keys. On sqlite and MySQL this happens automatically, so the method is a no-op. For Postgresql it provides a canned version of a nice query to update the sequence, saving peewee use... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/564/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/564/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/564",
"html_url": "https://github.com/coleifer/peewee/pull/564",
"diff_url": "https://github.com/coleifer/peewee/pull/564.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/564.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/563 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/563/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/563/comments | https://api.github.com/repos/coleifer/peewee/issues/563/events | https://github.com/coleifer/peewee/issues/563 | 64,439,169 | MDU6SXNzdWU2NDQzOTE2OQ== | 563 | Does .dicts() or .tuples() force an eval? | {
"login": "syegulalp",
"id": 401657,
"node_id": "MDQ6VXNlcjQwMTY1Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/401657?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/syegulalp",
"html_url": "https://github.com/syegulalp",
"followers_url": "https://api.github.com/users/syeg... | [] | closed | false | null | [] | null | [
"Well, first of all, two queries is not N+1 queries. N+1 queries happens when you have a loop, for instance, and for every result in the outer query you execute an additional query.\n\nSo no, it's not N+1.\n\nIn fact, it is only 1 query, which you can verify by [enabling query logging](http://docs.peewee-orm.com/en... | 2015-03-26T04:30:02 | 2015-03-26T16:02:06 | 2015-03-26T15:59:16 | NONE | null | I have the following code:
```
media_association = MediaAssociation.select(MediaAssociation.id).where(
MediaAssociation.blog == self.id).dicts()
media = Media.select().where(Media.id << media_association)
```
Would this cause an `n+1` query, where `media_association` generates one query and then `media` ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/563/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/563/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/562 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/562/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/562/comments | https://api.github.com/repos/coleifer/peewee/issues/562/events | https://github.com/coleifer/peewee/pull/562 | 64,239,314 | MDExOlB1bGxSZXF1ZXN0MzE5MTAyMTk= | 562 | Update quickstart.rst | {
"login": "mozillazg",
"id": 485054,
"node_id": "MDQ6VXNlcjQ4NTA1NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/485054?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mozillazg",
"html_url": "https://github.com/mozillazg",
"followers_url": "https://api.github.com/users/mozi... | [] | closed | false | null | [] | null | [] | 2015-03-25T10:40:29 | 2015-03-26T02:12:06 | 2015-03-25T18:39:15 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/562/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/562/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/562",
"html_url": "https://github.com/coleifer/peewee/pull/562",
"diff_url": "https://github.com/coleifer/peewee/pull/562.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/562.patch",
"merged_at": null
} | |
https://api.github.com/repos/coleifer/peewee/issues/561 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/561/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/561/comments | https://api.github.com/repos/coleifer/peewee/issues/561/events | https://github.com/coleifer/peewee/pull/561 | 64,188,107 | MDExOlB1bGxSZXF1ZXN0MzE4OTYwMzA= | 561 | insert_many() + insert_returning support | {
"login": "ianawilson",
"id": 831154,
"node_id": "MDQ6VXNlcjgzMTE1NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/831154?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ianawilson",
"html_url": "https://github.com/ianawilson",
"followers_url": "https://api.github.com/users/i... | [] | closed | false | null | [] | null | [
"I didn't think it made a lot of sense to return the IDs for bulk inserts. If inserting a lot of rows, it could mean a lot of data being transferred back over the wire for all those inserts. Furthermore, insert_many() doesn't return instances, so what would be the point of having the IDs?\n\nAlso, the behavior prio... | 2015-03-25T06:16:49 | 2015-03-27T03:47:40 | 2015-03-27T03:31:06 | NONE | null | I saw that there was support for RETURNING but only for single-row INSERTs, and I needed support for multi-row INSERTs with RETURNING as well.
Based on your tests, it looks like you may not have wanted to include this functionality. If that's the case, I'd be happy to make this a non-default option for `insert_many()`... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/561/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/561/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/561",
"html_url": "https://github.com/coleifer/peewee/pull/561",
"diff_url": "https://github.com/coleifer/peewee/pull/561.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/561.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/560 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/560/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/560/comments | https://api.github.com/repos/coleifer/peewee/issues/560/events | https://github.com/coleifer/peewee/issues/560 | 64,087,478 | MDU6SXNzdWU2NDA4NzQ3OA== | 560 | ArrayField: to lower | {
"login": "havannavar",
"id": 1104650,
"node_id": "MDQ6VXNlcjExMDQ2NTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1104650?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/havannavar",
"html_url": "https://github.com/havannavar",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"I don't think `array_lower` does what you are expecting there. It returns the lower bound of the requested array dimension.\n",
"So, can you let me know, how can i resolve this issue ?\n",
"I am not sure. Can you express this query using plain SQL? If you can give me the correct SQL, then I will help you trans... | 2015-03-24T20:04:16 | 2015-03-25T21:34:49 | 2015-03-25T18:52:26 | NONE | null | I am trying to convert ArrayField values to lower case, but unsuccessful
here is my query with exception
```
Tweets.select().where((fn.Lower(Tweets.preferred_city) == fn.Lower(city)) & (fn.array_lower(Tweets.tagging).contains_any(['foo','bar'])))
ProgrammingError: function contains_any(unknown) does not exis... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/560/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/560/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/559 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/559/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/559/comments | https://api.github.com/repos/coleifer/peewee/issues/559/events | https://github.com/coleifer/peewee/pull/559 | 63,569,984 | MDExOlB1bGxSZXF1ZXN0MzE2OTM5MTE= | 559 | Add pwiz option to preserve original DB column order. | {
"login": "elgow",
"id": 11529401,
"node_id": "MDQ6VXNlcjExNTI5NDAx",
"avatar_url": "https://avatars.githubusercontent.com/u/11529401?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/elgow",
"html_url": "https://github.com/elgow",
"followers_url": "https://api.github.com/users/elgow/follow... | [] | closed | false | null | [] | null | [
"Hello Charles,\n\nThis is a minor modification to enable pwiz to create models that preserve the column ordering from the original source DB. I needed that in order to use dump files created with native Postgresql tools from the original DB. The new behavior an option so that default pwiz behavior is unchanged. I... | 2015-03-22T20:06:37 | 2015-03-27T04:17:25 | 2015-03-27T04:16:38 | NONE | null | Add pwiz option to preserve original DB column order in generated model definitions. Very useful when a DB created by Peewee will be loaded from a dump file created with native DB tools (e.g. Postgresql INSERT type dump).
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/559/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/559/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/559",
"html_url": "https://github.com/coleifer/peewee/pull/559",
"diff_url": "https://github.com/coleifer/peewee/pull/559.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/559.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/558 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/558/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/558/comments | https://api.github.com/repos/coleifer/peewee/issues/558/events | https://github.com/coleifer/peewee/issues/558 | 63,284,332 | MDU6SXNzdWU2MzI4NDMzMg== | 558 | Get "raw" ForeignKeyField value without firing a query | {
"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 | [
"`post._data['user']`\n",
"Thank you Charles! :)\n"
] | 2015-03-20T19:06:40 | 2015-03-20T22:23:54 | 2015-03-20T20:29:29 | NONE | null | I haven't found a way to simply get related object id for ForeignKeyField without performing a query.
Is that currently possible? That would be convenient in cases when we need to know only related object id, i.e. when trying to read from cache etc.
Here's what I mean:
``` python
import peewee
db = peewee.SqliteDat... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/558/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/558/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/557 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/557/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/557/comments | https://api.github.com/repos/coleifer/peewee/issues/557/events | https://github.com/coleifer/peewee/issues/557 | 63,249,466 | MDU6SXNzdWU2MzI0OTQ2Ng== | 557 | playhouse.db_url shouldn’t remove the leading slash | {
"login": "bfontaine",
"id": 1334295,
"node_id": "MDQ6VXNlcjEzMzQyOTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1334295?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bfontaine",
"html_url": "https://github.com/bfontaine",
"followers_url": "https://api.github.com/users/bf... | [] | closed | false | null | [] | null | [
"This follows the pattern used by SQLAlchemy:\n\nhttp://docs.sqlalchemy.org/en/rel_0_9/core/engines.html#sqlite\n\nThis translates to `sqlite://<no host, so empty>/<path to database>`.\n",
"See also: https://pythonhosted.org/Flask-SQLAlchemy/config.html\n",
"Thanks!\n"
] | 2015-03-20T15:29:20 | 2015-03-20T18:30:14 | 2015-03-20T17:23:45 | CONTRIBUTOR | null | [`playhouse.db_url`removes the first character of the path](https://github.com/coleifer/peewee/blob/master/playhouse/db_url.py#L45) , which means that when you think you’re connecting to `/foo/bar/mydb.db` it’ll in fact try to connect to `foo/bar/mydb.db` and fail.
This means I’ve to use `sqlite3:////foo/bar/mydb.db` ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/557/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/557/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/556 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/556/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/556/comments | https://api.github.com/repos/coleifer/peewee/issues/556/events | https://github.com/coleifer/peewee/issues/556 | 62,828,713 | MDU6SXNzdWU2MjgyODcxMw== | 556 | negative operator for descending order | {
"login": "langit",
"id": 3238258,
"node_id": "MDQ6VXNlcjMyMzgyNTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/3238258?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/langit",
"html_url": "https://github.com/langit",
"followers_url": "https://api.github.com/users/langit/foll... | [] | closed | false | null | [] | null | [
"- 08b3c0ee03576e16965b9003b38b4bad4b126fb3\n- 3ced2b6d3955243fb815250158c44af94b212781\n- 2f114136cb823f5a5b0c936dcc93d313c9e4f368\n"
] | 2015-03-18T23:41:41 | 2015-03-19T01:45:40 | 2015-03-19T01:45:40 | NONE | null | I'd like to propose a syntax sugar for ordering. Instead of
```
.order_by(User.name.desc())
```
one can also do
```
.order_by( - User.name)
```
which simply requires a hook method in class Node:
```
def __neg__(self):
self._ordering = "DESC"
```
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/556/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/556/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/555 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/555/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/555/comments | https://api.github.com/repos/coleifer/peewee/issues/555/events | https://github.com/coleifer/peewee/issues/555 | 62,790,348 | MDU6SXNzdWU2Mjc5MDM0OA== | 555 | Delete with joins | {
"login": "jakedt",
"id": 2183986,
"node_id": "MDQ6VXNlcjIxODM5ODY=",
"avatar_url": "https://avatars.githubusercontent.com/u/2183986?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jakedt",
"html_url": "https://github.com/jakedt",
"followers_url": "https://api.github.com/users/jakedt/foll... | [] | closed | false | null | [] | null | [
"This appears to not work at all with sqlite, and so is probably a non-starter. Feel free to close if you agree.\n",
"I don't believe it is supported by Postgres either, so yes I think I will close it out. If your deletes happen infrequently you could always recourse to having a \"raw\" SQL query to accomplish th... | 2015-03-18T20:23:53 | 2016-06-28T05:57:30 | 2015-03-18T23:02:35 | NONE | null | Currently peewee doesn't support joins in delete queries. We've worked around this by using where clauses and nested subqueries (to force mysql to create a temp table). This is causing our DB to have a lot of deadlocks. One way around this would be to allow deletes to use joins.
An example query:
``` python
subq ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/555/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/555/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/554 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/554/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/554/comments | https://api.github.com/repos/coleifer/peewee/issues/554/events | https://github.com/coleifer/peewee/issues/554 | 62,788,832 | MDU6SXNzdWU2Mjc4ODgzMg== | 554 | SQLite journal mode hangs | {
"login": "wkschwartz",
"id": 1417749,
"node_id": "MDQ6VXNlcjE0MTc3NDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1417749?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wkschwartz",
"html_url": "https://github.com/wkschwartz",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [] | 2015-03-18T20:19:08 | 2015-03-18T20:47:28 | 2015-03-18T20:47:28 | NONE | null | ## Summary
The following code hangs indefinitely.
``` python
>>> import peewee
>>> db = peewee.SqliteDatabase(':memory:', journal_mode='WAL')
>>> db.connect()
```
## Diagnosis
When you hit Ctrl+C to trigger `KeyboardInterrupt` exception, you get the following traceback, indicating that `_add_conn_hooks`, which is ca... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/554/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/554/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/553 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/553/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/553/comments | https://api.github.com/repos/coleifer/peewee/issues/553/events | https://github.com/coleifer/peewee/issues/553 | 62,734,763 | MDU6SXNzdWU2MjczNDc2Mw== | 553 | implicit join via select function | {
"login": "langit",
"id": 3238258,
"node_id": "MDQ6VXNlcjMyMzgyNTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/3238258?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/langit",
"html_url": "https://github.com/langit",
"followers_url": "https://api.github.com/users/langit/foll... | [] | closed | false | null | [] | null | [
"This is definitely a nice API and something I will consider for peewee 3.0 (whenever that might be, no timetable yet but I'm starting to think about it). I've added this to the TODOs for peewee 3. Closing for now.\n"
] | 2015-03-18T16:27:14 | 2015-03-19T01:50:10 | 2015-03-19T01:50:10 | NONE | null | I use django a lot and have just come to know about peewee, and I already like it. When I read of the N+1 behavior in the quickstart, an idea suddenly hit me: would it be nice if peewee can automatically figure out how to join tables behind the scenes so that users are relieved from such SQL concepts? Here is what I me... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/553/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/553/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/552 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/552/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/552/comments | https://api.github.com/repos/coleifer/peewee/issues/552/events | https://github.com/coleifer/peewee/issues/552 | 62,542,810 | MDU6SXNzdWU2MjU0MjgxMA== | 552 | Errors when inserting explicit ID in Postgresql table with auto-generated primary key | {
"login": "elgow",
"id": 11529401,
"node_id": "MDQ6VXNlcjExNTI5NDAx",
"avatar_url": "https://avatars.githubusercontent.com/u/11529401?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/elgow",
"html_url": "https://github.com/elgow",
"followers_url": "https://api.github.com/users/elgow/follow... | [] | closed | false | null | [] | null | [
"I think this is going to be a wontfix for me. If you are relying on specific autogenerated primary key values in your tests, that seems problematic -- perhaps they should have a separate unique identifier. Similarly, when restoring backups, I don't imagine you would do that using peewee but use postgresql pg_resto... | 2015-03-17T23:34:21 | 2015-03-22T18:35:22 | 2015-03-18T15:13:54 | NONE | null | Postgresql behavior differs from Sqlite and Mysql for auto-generated keys. While Sqlite and Mysql handle it seamlessly, Postgresql will fail in two ways if an insert with an explicitly specified key value is made in a table with an auto-generated key.
1) If the explicit key insert is the first insert in a session, th... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/552/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/552/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/551 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/551/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/551/comments | https://api.github.com/repos/coleifer/peewee/issues/551/events | https://github.com/coleifer/peewee/issues/551 | 62,514,956 | MDU6SXNzdWU2MjUxNDk1Ng== | 551 | QueryResultWrapper iterator broken | {
"login": "wkschwartz",
"id": 1417749,
"node_id": "MDQ6VXNlcjE0MTc3NDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1417749?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wkschwartz",
"html_url": "https://github.com/wkschwartz",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"This is a more correct fix, but I'll have to think through the edge cases:\n\n``` diff\ndiff --git a/peewee.py b/peewee.py\nindex 0a640c3..f630bce 100644\n--- a/peewee.py\n+++ b/peewee.py\n@@ -1837,6 +1837,8 @@ class QueryResultWrapper(object):\n inst = self._result_cache[self.__idx]\n self... | 2015-03-17T20:48:37 | 2015-03-19T19:25:36 | 2015-03-19T02:54:03 | NONE | null | ## Summary
Peewee's `QueryResultWrapper.__next__` does not raise `StopIteration` exceptions on subsequent calls after the first `StopIteration` in contrast to the Python iterator protocol (documentation quoted/linked below). Instead, `QueryResultWrapper` iterators raise a `sqlite3.ProgrammingError`. The following test... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/551/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/551/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/550 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/550/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/550/comments | https://api.github.com/repos/coleifer/peewee/issues/550/events | https://github.com/coleifer/peewee/issues/550 | 62,153,445 | MDU6SXNzdWU2MjE1MzQ0NQ== | 550 | Foreign key enforcement in SQLite | {
"login": "wkschwartz",
"id": 1417749,
"node_id": "MDQ6VXNlcjE0MTc3NDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1417749?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wkschwartz",
"html_url": "https://github.com/wkschwartz",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"You can subclass `SqliteDatabase` and override the `_add_conn_hooks` method. I don't think I will add this as a database option, but it should be easy to add yourself.\r\n\r\n**Edit**: this is out-dated, see bottom of page for more info.",
"Using `_add_conn_hooks` doesn't work. In fact, it doesn't even work for ... | 2015-03-16T17:22:47 | 2016-12-11T21:23:47 | 2015-03-17T17:55:18 | NONE | null | Foreign keys are disabled by [default in SQLite3](http://www.sqlite.org/foreignkeys.html#fk_enable). It would be nice to have an optional `enable_foreign_keys` boolean argument to the `SqliteDatabase` constructor. It would have two effects. Suppose `db = SqliteDatabase(filename, enable_foreign_keys=True)`. Then
1. `db.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/550/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/550/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/549 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/549/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/549/comments | https://api.github.com/repos/coleifer/peewee/issues/549/events | https://github.com/coleifer/peewee/pull/549 | 61,157,406 | MDExOlB1bGxSZXF1ZXN0MzExNDgyNzg= | 549 | Custom bindings for selection expressions | {
"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 | [
"Related to topic here https://groups.google.com/forum/#!topic/peewee-orm/Ny-2UE6yPvs\n",
"Neat! Do you mind renaming `target` to `bind_to` and adding documentation on the `Node` class' api docs?\n",
"Sounds good. Made those changes @coleifer \n"
] | 2015-03-13T17:48:00 | 2015-03-13T22:21:14 | 2015-03-13T22:21:14 | CONTRIBUTOR | null | Currently there is no way to have the results of a selection sub expression land on a joined instance, instead of on the top level instance. Many times a model is expected to always have a field defined, even if it was inflated via a join.
Example:
``` python
BlogEntry.select(
BlogEntry,
User,
fn.Exists... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/549/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/549/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/549",
"html_url": "https://github.com/coleifer/peewee/pull/549",
"diff_url": "https://github.com/coleifer/peewee/pull/549.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/549.patch",
"merged_at": "2015-03-13T22:21:14"
} |
https://api.github.com/repos/coleifer/peewee/issues/548 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/548/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/548/comments | https://api.github.com/repos/coleifer/peewee/issues/548/events | https://github.com/coleifer/peewee/pull/548 | 61,077,218 | MDExOlB1bGxSZXF1ZXN0MzExMzAyODA= | 548 | Error with long names in tables | {
"login": "sidan93",
"id": 9017730,
"node_id": "MDQ6VXNlcjkwMTc3MzA=",
"avatar_url": "https://avatars.githubusercontent.com/u/9017730?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sidan93",
"html_url": "https://github.com/sidan93",
"followers_url": "https://api.github.com/users/sidan93/... | [] | closed | false | null | [] | null | [
"I think the better fix is to just manually specify the sequence name to be whatever postgresql truncated it to. e.g.:\n\n``` python\ntabletabletable = PrimaryKeyField(sequence='tabletabletable_id_s')\n```\n"
] | 2015-03-13T14:31:57 | 2015-03-14T05:25:43 | 2015-03-14T05:25:43 | NONE | null | DATABASE: postgressql
only works postgressql!
I have a table called "TableTableTable" with primary key "@TableTableTable"
CURRVAL complains of a very long name "TableTableTable_@TableTableTable_seq" and cuts it
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/548/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/548/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/548",
"html_url": "https://github.com/coleifer/peewee/pull/548",
"diff_url": "https://github.com/coleifer/peewee/pull/548.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/548.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/547 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/547/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/547/comments | https://api.github.com/repos/coleifer/peewee/issues/547/events | https://github.com/coleifer/peewee/issues/547 | 60,686,396 | MDU6SXNzdWU2MDY4NjM5Ng== | 547 | pwiz takes a very long time | {
"login": "digi604",
"id": 25490,
"node_id": "MDQ6VXNlcjI1NDkw",
"avatar_url": "https://avatars.githubusercontent.com/u/25490?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/digi604",
"html_url": "https://github.com/digi604",
"followers_url": "https://api.github.com/users/digi604/follower... | [] | closed | false | null | [] | null | [
"Uhhh this isn't a bug really. How many tables you got? What kind of database?\n",
"Also typically you'll only need to run pwiz once so even if it takes a while hopefully it's a one-time thing. pwiz takes a long time because it needs to traverse the graph of tables and introspect each one, finding col type info, ... | 2015-03-11T16:28:18 | 2015-03-11T17:59:00 | 2015-03-11T17:59:00 | NONE | null | i have a db with many tables... pwiz seams to take a looong time... up to 30min to generate 1 table model
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/547/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/547/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/546 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/546/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/546/comments | https://api.github.com/repos/coleifer/peewee/issues/546/events | https://github.com/coleifer/peewee/issues/546 | 60,372,364 | MDU6SXNzdWU2MDM3MjM2NA== | 546 | extending database.connect_kwargs in / with ExecutionContext | {
"login": "richey-v",
"id": 6144958,
"node_id": "MDQ6VXNlcjYxNDQ5NTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/6144958?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/richey-v",
"html_url": "https://github.com/richey-v",
"followers_url": "https://api.github.com/users/riche... | [] | closed | false | null | [] | null | [
"Unfortunately I don't know how well this will work given the API of `ExecutionContext`. You might look into the new `Using` helper, as I think this is more what you want:\n\nhttp://docs.peewee-orm.com/en/latest/peewee/api.html#Using\n"
] | 2015-03-09T16:41:38 | 2015-03-09T23:36:01 | 2015-03-09T23:36:01 | NONE | null | I'd like to be able to have same application (in Flask) be able to connect to database (MySQL) with different arguments for some transactions. Specifically, looking for a way to have certain transactions coming from certain URLs be read-only and some be read/write.
I thought db.execution_context decorator would be a ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/546/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/546/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/545 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/545/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/545/comments | https://api.github.com/repos/coleifer/peewee/issues/545/events | https://github.com/coleifer/peewee/issues/545 | 60,267,259 | MDU6SXNzdWU2MDI2NzI1OQ== | 545 | Meta Class fields not inherited | {
"login": "stephenfin",
"id": 1690835,
"node_id": "MDQ6VXNlcjE2OTA4MzU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1690835?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/stephenfin",
"html_url": "https://github.com/stephenfin",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"This doesn't look like peewee to me.\n",
"Nope - it's Marshmallow. My apologies.\n"
] | 2015-03-08T17:36:41 | 2015-03-08T18:55:01 | 2015-03-08T18:10:03 | NONE | null | Take two models that demonstrate inheritance:
```
class BaseSchema(Schema):
"""Base serializer."""
id = fields.Integer(dump_only=True)
created_at = fields.DateTime(dump_only=True)
class Meta:
ordered = True
class PersonSchema(BaseSchema):
"""Person serializer."""
updated_at = fields.D... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/545/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/545/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/544 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/544/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/544/comments | https://api.github.com/repos/coleifer/peewee/issues/544/events | https://github.com/coleifer/peewee/pull/544 | 60,233,975 | MDExOlB1bGxSZXF1ZXN0MzA3MTIyNTI= | 544 | Max length reflection | {
"login": "garar",
"id": 220005,
"node_id": "MDQ6VXNlcjIyMDAwNQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/220005?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/garar",
"html_url": "https://github.com/garar",
"followers_url": "https://api.github.com/users/garar/followers"... | [] | closed | false | null | [] | null | [
"I think I'm going to pass on this, but thank you for the PR.\n",
"Hi!\n\nCan I get some arguments against it? Currently when you run generate_models from Introspector it will return invalid models. max_length with be incorrect for CHAR and VARCHAR fields. I would call it a bug.\n\nThanks!\n"
] | 2015-03-08T00:38:12 | 2015-03-08T18:21:05 | 2015-03-08T18:09:02 | NONE | null | Hello!
I've added support for max_length to reflection. Previously reflection didn't read max_length for varchar or char.
Left me know if you need anything else for this.
Thanks!
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/544/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/544/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/544",
"html_url": "https://github.com/coleifer/peewee/pull/544",
"diff_url": "https://github.com/coleifer/peewee/pull/544.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/544.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/543 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/543/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/543/comments | https://api.github.com/repos/coleifer/peewee/issues/543/events | https://github.com/coleifer/peewee/issues/543 | 60,152,907 | MDU6SXNzdWU2MDE1MjkwNw== | 543 | postgresql DEFAULT now() | {
"login": "mmongeon-aa",
"id": 9663290,
"node_id": "MDQ6VXNlcjk2NjMyOTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/9663290?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mmongeon-aa",
"html_url": "https://github.com/mmongeon-aa",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Peewee does not support database defaults out of the box. You can subclass `playhouse.postgres_ext.DateTimeTZField` and override the `__ddl__` method, however:\n\n``` python\nclass DefaultNowDateTimeTZField(DateTimeTZField):\n def __ddl__(self, column_type):\n ddl = super(DefaultNowDateTimeTZField, self)... | 2015-03-06T20:16:38 | 2017-04-15T17:08:43 | 2015-03-06T20:21:08 | NONE | null | I'm trying to create a table in PostgreSQL that uses timestamp with time zone field default now()
```
from playhouse.postgres_ext import *
from peewee import *
from playhouse.csv_loader import load_csv
db = PostgresqlExtDatabase('mydb', host='127.0.0.1', user='user', password='pass')
class BaseModel(Model):
clas... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/543/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/543/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/542 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/542/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/542/comments | https://api.github.com/repos/coleifer/peewee/issues/542/events | https://github.com/coleifer/peewee/issues/542 | 60,037,600 | MDU6SXNzdWU2MDAzNzYwMA== | 542 | UnsignedIntegerField? | {
"login": "nilp0inter",
"id": 1224006,
"node_id": "MDQ6VXNlcjEyMjQwMDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1224006?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nilp0inter",
"html_url": "https://github.com/nilp0inter",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"http://docs.peewee-orm.com/en/latest/peewee/models.html#creating-a-custom-field\n",
"if you got here through google - like me - here is a quick solution which worked for my use case\r\n``\r\nuid = SmallIntegerField(null=True, constraints=[SQL(\"UNSIGNED\")])\r\n``",
":+1: thanks for sharing @sooslaca ",
... | 2015-03-06T00:01:34 | 2022-10-21T10:24:21 | 2015-03-06T00:17:32 | CONTRIBUTOR | null | Hi,
I'm trying to create a model with an unsigned integer field but I can't find how to do it with peewee.
Is this possible?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/542/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/542/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/541 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/541/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/541/comments | https://api.github.com/repos/coleifer/peewee/issues/541/events | https://github.com/coleifer/peewee/pull/541 | 59,728,928 | MDExOlB1bGxSZXF1ZXN0MzA0MjYzMDA= | 541 | In PostgresqlExtDatabase, respect the 'autorollback' option | {
"login": "davidmcclure",
"id": 814168,
"node_id": "MDQ6VXNlcjgxNDE2OA==",
"avatar_url": "https://avatars.githubusercontent.com/u/814168?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/davidmcclure",
"html_url": "https://github.com/davidmcclure",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [
"Thanks for this!\n"
] | 2015-03-04T00:07:02 | 2015-03-04T00:53:14 | 2015-03-04T00:53:10 | CONTRIBUTOR | null | First of all, thanks so much for Peewee! I ran across the problem described in #240, which was fixed by the addition of the `autorollback` database option.
I was setting `autorollback=True`, but still hitting the problem, and realized that the implementation of `execute_sql` in `PostgresqlExtDatabase` (which I'm using... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/541/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/541/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/541",
"html_url": "https://github.com/coleifer/peewee/pull/541",
"diff_url": "https://github.com/coleifer/peewee/pull/541.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/541.patch",
"merged_at": "2015-03-04T00:53:10"
} |
https://api.github.com/repos/coleifer/peewee/issues/540 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/540/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/540/comments | https://api.github.com/repos/coleifer/peewee/issues/540/events | https://github.com/coleifer/peewee/pull/540 | 59,225,060 | MDExOlB1bGxSZXF1ZXN0MzAxNTk1OTQ= | 540 | Traverse multiple FKs to the same model with several joins | {
"login": "sangwa",
"id": 7068898,
"node_id": "MDQ6VXNlcjcwNjg4OTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/7068898?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sangwa",
"html_url": "https://github.com/sangwa",
"followers_url": "https://api.github.com/users/sangwa/foll... | [] | closed | false | null | [] | null | [
"The way to do this with peewee currently is to use aliases in the joins, which tell peewee what attribute to patch the related data onto.\n\nIf I modify your example,\n\n``` python\nrelations = (Relation\n .select(Relation, parents, children)\n .join(parents, on=(Relation.parent == pa... | 2015-02-27T11:34:54 | 2015-02-27T15:45:06 | 2015-02-27T15:45:06 | NONE | null | Consider the following many-to-many relationship:
``` python
from peewee import Model, PrimaryKeyField, ForeignKeyField, CharField
class Entity(Model):
id = PrimaryKeyField()
name = CharField(unique=True)
class Relation(Model):
class Meta:
indexes = ((('parent', 'child'), True),)
id = Primary... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/540/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/540/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/540",
"html_url": "https://github.com/coleifer/peewee/pull/540",
"diff_url": "https://github.com/coleifer/peewee/pull/540.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/540.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/539 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/539/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/539/comments | https://api.github.com/repos/coleifer/peewee/issues/539/events | https://github.com/coleifer/peewee/issues/539 | 59,105,050 | MDU6SXNzdWU1OTEwNTA1MA== | 539 | Issue with database.transaction() for playhouse.flask_utils import FlaskDB | {
"login": "havannavar",
"id": 1104650,
"node_id": "MDQ6VXNlcjExMDQ2NTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1104650?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/havannavar",
"html_url": "https://github.com/havannavar",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"You need to access the `peewee` database associated with the Flask `Database` object. So,\n\n``` python\nwith database.database.transaction():\n ...\n```\n"
] | 2015-02-26T17:11:23 | 2015-02-26T18:01:30 | 2015-02-26T18:01:30 | NONE | null | I am using FlaskDB
```
from flask import Flask
from playhouse.flask_utils import FlaskDB
DATABASE = {
'name': 'testdb',
'engine': 'playhouse.pool.PooledPostgresqlExtDatabase',
'user': 'sats',
'max_connections': 32,
'stale_timeout': 600,
}
app = Flask(__name__)
app.config.from_object(__name__)
database = FlaskDB(ap... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/539/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/539/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/538 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/538/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/538/comments | https://api.github.com/repos/coleifer/peewee/issues/538/events | https://github.com/coleifer/peewee/issues/538 | 59,097,240 | MDU6SXNzdWU1OTA5NzI0MA== | 538 | (2006, "MySQL server has gone away (error(32, 'Broken pipe'))") | {
"login": "emamirazavi",
"id": 3804866,
"node_id": "MDQ6VXNlcjM4MDQ4NjY=",
"avatar_url": "https://avatars.githubusercontent.com/u/3804866?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/emamirazavi",
"html_url": "https://github.com/emamirazavi",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"http://docs.peewee-orm.com/en/latest/peewee/database.html#error-2006-mysql-server-has-gone-away\n",
"For an alternate fix, see also 017e4e4952f0b429dd21f0e90465a0f644cf6015\n",
"For a new alternate fix:\r\n```python\r\nfrom playhouse.shortcuts import ReconnectMixin\r\n\r\n\r\nclass MyRetryDB(ReconnectMixin, My... | 2015-02-26T16:24:44 | 2021-04-28T07:32:33 | 2015-02-26T18:02:31 | NONE | null | When i want to save my model, my connection broke! and raises an exception with title of this issue, but mysql logfile reads:
INSERT INTO `inboundmsg` (`tojid`, `fromjid`, `type`, `datetime`, `content`, `url`, `size`, `local`, `status`) VALUES ('989393310102', '989102260264', 'image', '2015-02-26 19:43:11.789153', '/9j... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/538/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/538/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/537 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/537/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/537/comments | https://api.github.com/repos/coleifer/peewee/issues/537/events | https://github.com/coleifer/peewee/issues/537 | 59,054,432 | MDU6SXNzdWU1OTA1NDQzMg== | 537 | upsert fails when applying on insert_many | {
"login": "hitzg",
"id": 688395,
"node_id": "MDQ6VXNlcjY4ODM5NQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/688395?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hitzg",
"html_url": "https://github.com/hitzg",
"followers_url": "https://api.github.com/users/hitzg/followers"... | [] | closed | false | null | [] | null | [
"Nice post, I will look into this.\n",
"Interestingly, here is the output when I run your sample script (slightly cleaned up output):\n\n``` python\n query 1: INSERT INTO \"person\" (\"name\") VALUES (?), (?), (?), (?)\n query 2: INSERT OR REPLACE INTO \"person\" (\"name\") VALUES (?), (?), (?), (?)\nPersons in... | 2015-02-26T10:49:57 | 2015-02-27T07:19:43 | 2015-02-27T07:19:43 | NONE | null | I got confused using `insert_many` and `upsert`. But I'm not sure if this is a bug of peewee or just a limitation of sqlite. But either way the result is not what I would expect.
(also I was not sure if I should post this as an issue or on stackoverflow. I'm happy to post it there if you feel its more appropriate)
Min... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/537/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/537/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/536 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/536/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/536/comments | https://api.github.com/repos/coleifer/peewee/issues/536/events | https://github.com/coleifer/peewee/issues/536 | 59,042,295 | MDU6SXNzdWU1OTA0MjI5NQ== | 536 | Usage around insert_many | {
"login": "MartynBliss",
"id": 1713902,
"node_id": "MDQ6VXNlcjE3MTM5MDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1713902?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MartynBliss",
"html_url": "https://github.com/MartynBliss",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"In order to keep peewee lightweight, I think I will pass on adding this functionality.\n"
] | 2015-02-26T09:17:32 | 2015-02-26T15:02:39 | 2015-02-26T15:02:39 | NONE | null | Not really an issue...
It would be helpful if when doing an insert_many there would be a way to get a recommended chunk size given a model. If the max number of sql parameters is fixed, then returning that divided by the number of fields that each row insert would generate?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/536/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/536/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/535 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/535/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/535/comments | https://api.github.com/repos/coleifer/peewee/issues/535/events | https://github.com/coleifer/peewee/issues/535 | 58,663,054 | MDU6SXNzdWU1ODY2MzA1NA== | 535 | Exception when switching from MySql to Sqlite | {
"login": "hamiltont",
"id": 305380,
"node_id": "MDQ6VXNlcjMwNTM4MA==",
"avatar_url": "https://avatars.githubusercontent.com/u/305380?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hamiltont",
"html_url": "https://github.com/hamiltont",
"followers_url": "https://api.github.com/users/hami... | [] | closed | false | null | [] | null | [
"I'm inclined to actually leave that error as-is, since I wouldn't want you to specify `cascade=True` with SQLite, then have it _not_ cascade. Thank you for reporting, though.\n",
"Ok dokie! Figured it's a preference thing, thanks for the quick reply!\n"
] | 2015-02-23T22:50:16 | 2015-02-23T23:26:40 | 2015-02-23T23:15:33 | NONE | null | With mysql this was valid:
```
database.drop_tables(tables, safe=True, cascade=True)
```
When I switched to sqlite, this line caused the exception below. I'd have expected that it would just ignore the cascade argument if the engine is sqlite.
```
('DROP TABLE IF EXISTS "benchmark" CASCADE', [])
127.0.0.1 - - ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/535/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/535/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/534 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/534/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/534/comments | https://api.github.com/repos/coleifer/peewee/issues/534/events | https://github.com/coleifer/peewee/issues/534 | 58,578,306 | MDU6SXNzdWU1ODU3ODMwNg== | 534 | Using load_csv on files generated with dump_csv and using a database model doesn't work | {
"login": "MartynBliss",
"id": 1713902,
"node_id": "MDQ6VXNlcjE3MTM5MDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1713902?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MartynBliss",
"html_url": "https://github.com/MartynBliss",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Nice catch, thanks for letting me know.\n"
] | 2015-02-23T12:15:53 | 2015-02-24T01:09:13 | 2015-02-24T01:09:13 | NONE | null | When the fields are iterated as part of creating in memory database table, primary keys are being stripped from column names, but the row data is not being modified. So what happens is field(1) gets the value of field(0) and so on
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/534/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/534/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/533 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/533/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/533/comments | https://api.github.com/repos/coleifer/peewee/issues/533/events | https://github.com/coleifer/peewee/issues/533 | 58,495,375 | MDU6SXNzdWU1ODQ5NTM3NQ== | 533 | ArrayField: contains_any returning 'A||' | {
"login": "havannavar",
"id": 1104650,
"node_id": "MDQ6VXNlcjExMDQ2NTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1104650?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/havannavar",
"html_url": "https://github.com/havannavar",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"I'm not sure... the code is tested and here is a sample script that runs fine on my computer:\n\n``` python\n#!/usr/bin/env python\n\nimport logging\n\nfrom peewee import *\nfrom peewee import create_model_tables\nfrom playhouse.postgres_ext import *\n\n\ndb = PostgresqlExtDatabase('peewee_test')\n\nclass BaseMode... | 2015-02-22T08:32:38 | 2015-02-23T15:39:17 | 2015-02-23T02:07:44 | NONE | null | Here is my Model
class BlogPost(BaseModel):
user = TextField()
content = TextField()
tags = ArrayField(TextField)
data in database is BlogPost(user='abc',content='awesome', tags=['foo', 'bar', 'baz'])"
and when i execute
Blog.select().where(Blog.tags.contains_any('python', 'bar'))
I always get an Error... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/533/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/533/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/532 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/532/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/532/comments | https://api.github.com/repos/coleifer/peewee/issues/532/events | https://github.com/coleifer/peewee/issues/532 | 58,453,118 | MDU6SXNzdWU1ODQ1MzExOA== | 532 | MySQL full text search | {
"login": "leebrooks0",
"id": 2501773,
"node_id": "MDQ6VXNlcjI1MDE3NzM=",
"avatar_url": "https://avatars.githubusercontent.com/u/2501773?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/leebrooks0",
"html_url": "https://github.com/leebrooks0",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"Check out http://docs.peewee-orm.com/en/latest/peewee/querying.html#adding-user-defined-operators\n",
"@coleifer Is there a way to add the FULLTEXT index on the model?",
"Looks like MySQL syntax is `create fulltext index ...`, which is not supported by peewee's out-of-the-box schema manager. Your best bet is t... | 2015-02-21T09:57:48 | 2019-06-18T19:54:50 | 2015-02-23T02:02:20 | NONE | null | Is there any support for MySQL full text search? I see you can call fn.any_function(), but I am not sure how you would use that when using MATCH AGAINST?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/532/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/532/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/531 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/531/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/531/comments | https://api.github.com/repos/coleifer/peewee/issues/531/events | https://github.com/coleifer/peewee/issues/531 | 58,289,598 | MDU6SXNzdWU1ODI4OTU5OA== | 531 | [Feature] Ability to explicitly switch db connection per query | {
"login": "alexlatchford",
"id": 628146,
"node_id": "MDQ6VXNlcjYyODE0Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/628146?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/alexlatchford",
"html_url": "https://github.com/alexlatchford",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"PS. My current solution is something like:\n\n``` python\nquery = MyModel.select()\nquery.database = process_db_conn\nresult = query.execute()\n```\n\nWorks just about, having some teething problems with connections hanging around too though but think it's psycopg2 rather than peewee :)\n",
"Thanks for the featu... | 2015-02-19T23:47:16 | 2015-03-02T14:41:45 | 2015-02-24T05:44:47 | CONTRIBUTOR | null | Currently models are defined globally and you have to specific the database in the metaclass, I'd like a way to switch db connection explicitly. I understand that the execution_context decorator exists but still only worked with a single peewee connection pool (i.e. threads).
For my use case I've created a manager cla... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/531/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/531/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/530 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/530/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/530/comments | https://api.github.com/repos/coleifer/peewee/issues/530/events | https://github.com/coleifer/peewee/issues/530 | 57,900,570 | MDU6SXNzdWU1NzkwMDU3MA== | 530 | Support for pysqlcipher3 | {
"login": "tfeldmann",
"id": 385566,
"node_id": "MDQ6VXNlcjM4NTU2Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/385566?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tfeldmann",
"html_url": "https://github.com/tfeldmann",
"followers_url": "https://api.github.com/users/tfel... | [] | closed | false | null | [] | null | [] | 2015-02-17T09:20:50 | 2015-02-18T22:15:37 | 2015-02-18T22:15:37 | NONE | null | The sqlcipher_ext in playhouse uses pysqlcipher, which is only compatible with Python 2.7.x.
David Riggleman recently forked this module to work with both Python 2 + 3: https://github.com/rigglemania/pysqlcipher3
It would be great if peewee used this module to be able to work with encrypted databases in Python 3.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/530/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/530/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/529 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/529/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/529/comments | https://api.github.com/repos/coleifer/peewee/issues/529/events | https://github.com/coleifer/peewee/issues/529 | 57,900,087 | MDU6SXNzdWU1NzkwMDA4Nw== | 529 | I cannot explicitly create the storage engine of MySQL tables | {
"login": "kevinisaac",
"id": 4241767,
"node_id": "MDQ6VXNlcjQyNDE3Njc=",
"avatar_url": "https://avatars.githubusercontent.com/u/4241767?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kevinisaac",
"html_url": "https://github.com/kevinisaac",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"I don't have any plans to add this functionality, but will accept pull-requests.\n"
] | 2015-02-17T09:15:17 | 2015-02-24T03:32:48 | 2015-02-24T03:32:48 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/529/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/529/timeline | null | completed | null | null | |
https://api.github.com/repos/coleifer/peewee/issues/528 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/528/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/528/comments | https://api.github.com/repos/coleifer/peewee/issues/528/events | https://github.com/coleifer/peewee/issues/528 | 57,713,212 | MDU6SXNzdWU1NzcxMzIxMg== | 528 | Keyword URLs supported in database connection? | {
"login": "SamuelMarks",
"id": 807580,
"node_id": "MDQ6VXNlcjgwNzU4MA==",
"avatar_url": "https://avatars.githubusercontent.com/u/807580?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SamuelMarks",
"html_url": "https://github.com/SamuelMarks",
"followers_url": "https://api.github.com/user... | [] | closed | false | null | [] | null | [
"http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#db-url\nOn Feb 14, 2015 5:12 PM, \"Samuel Marks\" notifications@github.com wrote:\n\n> Looking through your examples, looks like I need seperated values rather\n> than a single URL.\n> \n> So going off that:\n> \n> from os import environ\n> from operator i... | 2015-02-15T01:12:41 | 2015-02-23T22:02:42 | 2015-02-23T02:08:13 | NONE | null | Looking through your examples, looks like I need seperated values rather than a single URL.
So going off that:
```
from os import environ
from operator import add
environ.setdefault('HEROKU_POSTGRESQL_AMBER', 'postgres://username:password@hostname:PORT/dbname')
username, password, hostname, PORT, dbname = reduce(
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/528/reactions",
"total_count": 1,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 1,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/528/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/527 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/527/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/527/comments | https://api.github.com/repos/coleifer/peewee/issues/527/events | https://github.com/coleifer/peewee/issues/527 | 57,655,481 | MDU6SXNzdWU1NzY1NTQ4MQ== | 527 | Cannot create tables with circular foreign key dependencies with SQLite | {
"login": "bfontaine",
"id": 1334295,
"node_id": "MDQ6VXNlcjEzMzQyOTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1334295?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bfontaine",
"html_url": "https://github.com/bfontaine",
"followers_url": "https://api.github.com/users/bf... | [] | closed | false | null | [] | null | [
"> SQLite doesn’t support the ALTER TABLE … ADD CONSTRAINT syntax (source), which is why there’s a syntax error here.\n\nGood point. I think I will leave this out as anyone using SQLite probably should already be aware of the limited support for alter table. And circular FKs are a bad design!\n"
] | 2015-02-13T21:19:24 | 2015-02-17T22:47:52 | 2015-02-17T22:47:52 | CONTRIBUTOR | null | TL;DR: SQLite doesn’t support the `ALTER TABLE … ADD CONSTRAINT` syntax used by `db.create_foreign_key`.
---
Hello,
I’m trying to store genealogical data in an SQLite database with the following simplified models:
``` python
FamilyProxy = Proxy()
class Person(Model):
# the family where this person is a child i... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/527/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/527/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/526 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/526/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/526/comments | https://api.github.com/repos/coleifer/peewee/issues/526/events | https://github.com/coleifer/peewee/pull/526 | 57,633,275 | MDExOlB1bGxSZXF1ZXN0MjkyODU4ODM= | 526 | Typo fixed in querying.rst | {
"login": "bfontaine",
"id": 1334295,
"node_id": "MDQ6VXNlcjEzMzQyOTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1334295?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bfontaine",
"html_url": "https://github.com/bfontaine",
"followers_url": "https://api.github.com/users/bf... | [] | closed | false | null | [] | null | [
"Thanks!\n"
] | 2015-02-13T18:09:26 | 2015-02-17T22:46:20 | 2015-02-17T22:46:17 | CONTRIBUTOR | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/526/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/526/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/526",
"html_url": "https://github.com/coleifer/peewee/pull/526",
"diff_url": "https://github.com/coleifer/peewee/pull/526.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/526.patch",
"merged_at": "2015-02-17T22:46:17"
} | |
https://api.github.com/repos/coleifer/peewee/issues/525 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/525/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/525/comments | https://api.github.com/repos/coleifer/peewee/issues/525/events | https://github.com/coleifer/peewee/issues/525 | 57,441,369 | MDU6SXNzdWU1NzQ0MTM2OQ== | 525 | Issue: integration with PostgreSQL | {
"login": "havannavar",
"id": 1104650,
"node_id": "MDQ6VXNlcjExMDQ2NTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1104650?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/havannavar",
"html_url": "https://github.com/havannavar",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"For future reference please take the time to format your code.\n",
"This is the issue:\n\n``` python\nclass BaseModel(database.Model):\n class Meta:\n database = database\n```\n\nSetting the `database` to the `FlaskDB` wrapper will not work because peewee models expect the `Meta.database` attribute to ... | 2015-02-12T10:20:01 | 2015-02-13T05:06:28 | 2015-02-12T13:44:49 | NONE | null | Hi Charles,
I m trying to integrate between playhouse.flask_utils. FlaskDB and postgresql, but unable to do so.
here is my code and exception
``` python
DATABASE = {
'name': 'testdb',
'engine': 'playhouse.pool.PooledPostgresqlDatabase',
'user': 'sats',
'max_connections': 32,
'stale_timeout': 600,... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/525/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/525/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/524 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/524/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/524/comments | https://api.github.com/repos/coleifer/peewee/issues/524/events | https://github.com/coleifer/peewee/issues/524 | 57,190,493 | MDU6SXNzdWU1NzE5MDQ5Mw== | 524 | Are mysql migrations still not tested? | {
"login": "leebrooks0",
"id": 2501773,
"node_id": "MDQ6VXNlcjI1MDE3NzM=",
"avatar_url": "https://avatars.githubusercontent.com/u/2501773?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/leebrooks0",
"html_url": "https://github.com/leebrooks0",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"No, they are tested now. Thanks!\n",
"Smashing, looking forward to using your ORM!\n\nOn Tue, Feb 10, 2015 at 5:39 PM, Charles Leifer notifications@github.com\nwrote:\n\n> No, they are tested now. Thanks!\n> \n> —\n> Reply to this email directly or view it on GitHub\n> https://github.com/coleifer/peewee/issues/5... | 2015-02-10T15:36:23 | 2015-02-10T15:40:43 | 2015-02-10T15:38:46 | NONE | null | In the docs it says that migrations have not been well tested with mysql? Is this still correct?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/524/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/524/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/523 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/523/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/523/comments | https://api.github.com/repos/coleifer/peewee/issues/523/events | https://github.com/coleifer/peewee/issues/523 | 56,810,865 | MDU6SXNzdWU1NjgxMDg2NQ== | 523 | Cannot store BLOB fields with peewee and PyMySQL | {
"login": "conqp",
"id": 3766192,
"node_id": "MDQ6VXNlcjM3NjYxOTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/3766192?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/conqp",
"html_url": "https://github.com/conqp",
"followers_url": "https://api.github.com/users/conqp/follower... | [] | closed | false | null | [] | null | [
"> I have the problem, that I cannot store Models having a BlobField with binary content since upgrading to the latest version of peewee 5aea8f6.\n\nWhat was the latest version of peewee that worked for you?\n",
"I am not sure, which one it was. But as I mentioned above this problem occured after simultaneously u... | 2015-02-06T13:21:27 | 2015-02-11T02:25:40 | 2015-02-11T02:25:40 | CONTRIBUTOR | null | Hi,
I have the problem, that I cannot store Models having a BlobField with binary content since upgrading to the latest version of peewee 5aea8f6fa405c896884c71262e0b2ac04d8cdaf9.
I am using a MySQL database with peewee over PyMySQL b2ec8287151f8dc54e71e426b41a1b300fb934bb.
How to reproduce:
1) Install peewee and PyM... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/523/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/523/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/522 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/522/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/522/comments | https://api.github.com/repos/coleifer/peewee/issues/522/events | https://github.com/coleifer/peewee/issues/522 | 56,523,109 | MDU6SXNzdWU1NjUyMzEwOQ== | 522 | Inserting record into link table throws OperationalError | {
"login": "rotsj",
"id": 866141,
"node_id": "MDQ6VXNlcjg2NjE0MQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/866141?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rotsj",
"html_url": "https://github.com/rotsj",
"followers_url": "https://api.github.com/users/rotsj/followers"... | [] | closed | false | null | [] | null | [
"The problem is the call to `project_team.save()`. Because this model has a non-auto-incrementing primary key, if you are `INSERT`-ing a row you need to call `save(force_insert=True)`.\n\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html#id3\n",
"Works like a charm, but I guess you'd expect that. Thanks!\n"... | 2015-02-04T12:57:52 | 2015-02-05T08:03:53 | 2015-02-04T15:57:46 | NONE | null | Am trying to insert a record into a link table but getting an OperationalError thrown. I believe my model definitions are correct, but any feedback is welcome.
Output:
```
Traceback (most recent call last):
File "permDb.py", line 129, in <module>
main()
File "permDb.py", line 22, in main
setup()
File "p... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/522/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/522/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/521 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/521/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/521/comments | https://api.github.com/repos/coleifer/peewee/issues/521/events | https://github.com/coleifer/peewee/issues/521 | 56,444,916 | MDU6SXNzdWU1NjQ0NDkxNg== | 521 | [Question] Is there a way to get the display instead of the value for a field with a choices parameter associated with it? | {
"login": "EPadronU",
"id": 829947,
"node_id": "MDQ6VXNlcjgyOTk0Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/829947?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/EPadronU",
"html_url": "https://github.com/EPadronU",
"followers_url": "https://api.github.com/users/EPadron... | [] | closed | false | null | [] | null | [
"It's just Python, there's no magic there. One easy way to accomplish this is to write something like this:\n\n``` python\n\nclass Tweet(Model):\n STATUS_CHOICES = (\n (0, 'Draft'),\n (1, 'Published'),\n (9, 'Deleted'))\n status = IntegerField(choices=STATUS_CHOICES)\n\n def get_status... | 2015-02-03T22:05:17 | 2018-03-14T14:35:35 | 2015-02-03T22:13:57 | NONE | null | Hello, everyone.
In the following code:
```
class Model(db.Model):
field = pw.Charfield(
choices=[1, 'foo']
)
def __unidoce__(self):
return self.<api call I don't know about>
```
I would like to print **foo** instead of **1**. The ORM implements a way to achieve this?
Thanks in advance.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/521/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/521/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/520 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/520/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/520/comments | https://api.github.com/repos/coleifer/peewee/issues/520/events | https://github.com/coleifer/peewee/issues/520 | 56,436,201 | MDU6SXNzdWU1NjQzNjIwMQ== | 520 | Not sure why: OperationalError: near "AS": syntax error | {
"login": "kristofer",
"id": 17994,
"node_id": "MDQ6VXNlcjE3OTk0",
"avatar_url": "https://avatars.githubusercontent.com/u/17994?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kristofer",
"html_url": "https://github.com/kristofer",
"followers_url": "https://api.github.com/users/kristofer/... | [] | closed | false | null | [] | null | [
"It would be really helpful if you could paste the Python code that generated the `File` query.\n",
"The problem appears to be in how you are sorting your files. Maybe try modifying it to be:\n\n``` python\nfiles = File.select().where(File.parent == '/').order_by(File.folder.desc(), File.filename)\n```\n",
"Yes... | 2015-02-03T20:59:22 | 2015-02-03T23:29:38 | 2015-02-03T22:10:43 | NONE | null | So I am getting a syntax error deep inside of peewee.
I'm trying to get the "encrypted-flask-aws" app, pretty much unmodified,
when I try to do a GET on the root of the app,
I get:
```
...venv/lib/python2.7/site-packages/peewee.py", line 2855, in execute_sql
cursor.execute(sql, params or ())
OperationalError: nea... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/520/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/520/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/519 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/519/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/519/comments | https://api.github.com/repos/coleifer/peewee/issues/519/events | https://github.com/coleifer/peewee/issues/519 | 56,152,177 | MDU6SXNzdWU1NjE1MjE3Nw== | 519 | Aggregate rows does not preserve ordering of nested objects. | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [] | 2015-02-01T05:00:13 | 2015-02-01T05:04:38 | 2015-02-01T05:04:38 | OWNER | null | http://stackoverflow.com/questions/28255182/order-by-method-not-working-in-peewee
When using `aggregate_rows()` with multiple order-by clauses, the ordering of nested objects is not preserved.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/519/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/519/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/518 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/518/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/518/comments | https://api.github.com/repos/coleifer/peewee/issues/518/events | https://github.com/coleifer/peewee/issues/518 | 56,116,658 | MDU6SXNzdWU1NjExNjY1OA== | 518 | JDBC support | {
"login": "SamuelMarks",
"id": 807580,
"node_id": "MDQ6VXNlcjgwNzU4MA==",
"avatar_url": "https://avatars.githubusercontent.com/u/807580?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SamuelMarks",
"html_url": "https://github.com/SamuelMarks",
"followers_url": "https://api.github.com/user... | [] | closed | false | null | [] | null | [
"This type of discussion might be more suited for the discussion group: https://groups.google.com/group/peewee-orm\n"
] | 2015-01-31T07:29:57 | 2015-01-31T16:29:19 | 2015-01-31T16:29:13 | NONE | null | Has anyone tried using peewee with JDBC, e.g.: using [this wrapper](https://pypi.python.org/pypi/JayDeBeApi/) ([code](http://bazaar.launchpad.net/~baztian/jaydebeapi/trunk/view/head:/src/jaydebeapi/dbapi2.py)) which exposes DB-API v2.0 support?
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/518/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/518/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/517 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/517/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/517/comments | https://api.github.com/repos/coleifer/peewee/issues/517/events | https://github.com/coleifer/peewee/issues/517 | 55,936,249 | MDU6SXNzdWU1NTkzNjI0OQ== | 517 | Pooled Connections, MasterSlave and closing connections | {
"login": "grvhi",
"id": 1818244,
"node_id": "MDQ6VXNlcjE4MTgyNDQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/1818244?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/grvhi",
"html_url": "https://github.com/grvhi",
"followers_url": "https://api.github.com/users/grvhi/follower... | [] | closed | false | null | [] | null | [
"For a celery task you will probably want to open/close the connections to both databases, if you are going to be using both in the task, e.g.\n\n``` python\nmaster.connect()\nread.connect()\ntry:\n my_code()\nfinally:\n master.close()\n read.close()\n```\n\nThe pool will handle recycling the connections f... | 2015-01-29T18:18:25 | 2015-01-31T09:36:14 | 2015-01-31T01:00:36 | NONE | null | I'm a little confused as to the process of opening and closing connections when using PooledPostgresqlExtDatabase and ReadSlaveModel... Say I have one master and one read. When opening a connection in my app (celery task), do I need to explicitly open a connection to both databases? Or do I open a connection to the mas... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/517/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/517/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/516 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/516/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/516/comments | https://api.github.com/repos/coleifer/peewee/issues/516/events | https://github.com/coleifer/peewee/issues/516 | 55,876,439 | MDU6SXNzdWU1NTg3NjQzOQ== | 516 | "where"-chaining does not work with negated BooleanFields | {
"login": "tfeldmann",
"id": 385566,
"node_id": "MDQ6VXNlcjM4NTU2Ng==",
"avatar_url": "https://avatars.githubusercontent.com/u/385566?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tfeldmann",
"html_url": "https://github.com/tfeldmann",
"followers_url": "https://api.github.com/users/tfel... | [] | closed | false | null | [] | null | [] | 2015-01-29T09:36:31 | 2015-01-31T00:57:50 | 2015-01-31T00:57:50 | NONE | null | Hello,
when chaining ".where()" expressions and using negations the query works only if the negated expression comes last. See the attached example code:
``` python
from peewee import *
db = SqliteDatabase(':memory:')
class Test(Model):
flag = BooleanField()
num = IntegerField()
def __repr__(self):
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/516/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/516/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/515 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/515/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/515/comments | https://api.github.com/repos/coleifer/peewee/issues/515/events | https://github.com/coleifer/peewee/issues/515 | 55,695,383 | MDU6SXNzdWU1NTY5NTM4Mw== | 515 | Subqueries in simple `delete_instance()` calls | {
"login": "coleifer",
"id": 119974,
"node_id": "MDQ6VXNlcjExOTk3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/119974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/coleifer",
"html_url": "https://github.com/coleifer",
"followers_url": "https://api.github.com/users/coleife... | [] | closed | false | null | [] | null | [
"Fixed by 08c595a\n",
"Hi @coleifer,\r\n\r\nHas this issue regressed at some point in version 3.x.x? We're looking to upgrade to the latest version of peewee and we're once again seeing deletion queries of this form when calling recursive deletes:\r\n\r\n```\r\nDELETE FROM \"table2\" WHERE (\"foreign_field\" IN (... | 2015-01-28T00:12:24 | 2018-05-03T16:16:52 | 2018-05-03T16:16:52 | OWNER | null | > We've been using peewee for quite a while now and have noticed from time-to-time that peewee generates delete (and update for nullables) queries of the form:
>
> ``` sql
> UPDATE `table` SET `field` = null
> WHERE (`table`.`field` IN (
> SELECT `t2`.`id` FROM `othertable` AS t2 WHERE (`t2`.`id` = 1234)))
> ```
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/515/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/515/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.