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
sequence | milestone
null | comments
sequence | 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/14 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/14/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/14/comments | https://api.github.com/repos/coleifer/peewee/issues/14/events | https://github.com/coleifer/peewee/issues/14 | 2,246,032 | MDU6SXNzdWUyMjQ2MDMy | 14 | New Model Defaults | {
"login": "jerodsanto",
"id": 8212,
"node_id": "MDQ6VXNlcjgyMTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/8212?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jerodsanto",
"html_url": "https://github.com/jerodsanto",
"followers_url": "https://api.github.com/users/jerodsanto/followers",
"following_url": "https://api.github.com/users/jerodsanto/following{/other_user}",
"gists_url": "https://api.github.com/users/jerodsanto/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jerodsanto/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jerodsanto/subscriptions",
"organizations_url": "https://api.github.com/users/jerodsanto/orgs",
"repos_url": "https://api.github.com/users/jerodsanto/repos",
"events_url": "https://api.github.com/users/jerodsanto/events{/privacy}",
"received_events_url": "https://api.github.com/users/jerodsanto/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2011-11-15T16:32:14 | 2011-11-15T17:34:41 | 2011-11-15T17:34:41 | NONE | null | When you create a model that has default field values they get used when persisting to the db (and subsequently when being initialized from the db) but not when a new object is instantiated. A contrived example:
``` python
class Post(peewee.Model):
comment_count = peewee.IntegerField(default=0)
post = Post()
post.comment_count # => None
post.save()
post.comment_count # => 0
```
I think it'd be more consistent if the defaults were applied to all objects of the class, not just ones that have been persisted or come from the database.
The change is quite simple, I believe. We just need to modify the `Model` class's `__init__` method like so:
``` python
def __init__(self, *args, **kwargs):
self.get_field_dict()
for k, v in kwargs.items():
setattr(self, k, v)
```
If this is something you'd be willing to merge, I'll happily do the work and submit a pull request.
Let me know, thanks.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/14/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/14/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/13 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/13/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/13/comments | https://api.github.com/repos/coleifer/peewee/issues/13/events | https://github.com/coleifer/peewee/issues/13 | 2,170,587 | MDU6SXNzdWUyMTcwNTg3 | 13 | Self-referential foreign key | {
"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/coleifer/followers",
"following_url": "https://api.github.com/users/coleifer/following{/other_user}",
"gists_url": "https://api.github.com/users/coleifer/gists{/gist_id}",
"starred_url": "https://api.github.com/users/coleifer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/coleifer/subscriptions",
"organizations_url": "https://api.github.com/users/coleifer/orgs",
"repos_url": "https://api.github.com/users/coleifer/repos",
"events_url": "https://api.github.com/users/coleifer/events{/privacy}",
"received_events_url": "https://api.github.com/users/coleifer/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [] | 2011-11-08T03:12:09 | 2011-11-09T15:34:46 | 2011-11-09T15:34:46 | OWNER | null | Would like a way to do self-referential foreign keys.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/13/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/13/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/12 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/12/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/12/comments | https://api.github.com/repos/coleifer/peewee/issues/12/events | https://github.com/coleifer/peewee/issues/12 | 1,992,936 | MDU6SXNzdWUxOTkyOTM2 | 12 | tests | {
"login": "madisvain",
"id": 727994,
"node_id": "MDQ6VXNlcjcyNzk5NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/727994?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/madisvain",
"html_url": "https://github.com/madisvain",
"followers_url": "https://api.github.com/users/madisvain/followers",
"following_url": "https://api.github.com/users/madisvain/following{/other_user}",
"gists_url": "https://api.github.com/users/madisvain/gists{/gist_id}",
"starred_url": "https://api.github.com/users/madisvain/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/madisvain/subscriptions",
"organizations_url": "https://api.github.com/users/madisvain/orgs",
"repos_url": "https://api.github.com/users/madisvain/repos",
"events_url": "https://api.github.com/users/madisvain/events{/privacy}",
"received_events_url": "https://api.github.com/users/madisvain/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"As to the first one, I believe that is due to unpredictable ordering with dictionaries. Joins are stored using a dictionary, so whether it joins on Blog first or EntryTag first is up in the air -- this one is a bad test case.\n\nAs to the count failure -- that's pretty odd. Looks like you're ending up with 2 extra entries per blog -- canyou do any more digging?\n",
"Well it's not that simple. I spent some time on this - this seems really weird. There are 10 entries for blog in the database if I check. But somehow it seems to return 12 yes. As I said really odd.\n\nI will look into this as soon as I get some time. I want to help make this project better.\nI think peewee rocks. It's simple, fast ... fantastic. Hope to use it in some of my future projects.\n",
"While the one test failure is obnoxious (sql / dict ordering), I haven't been able to reproduce at all the other. Closing for now, but feel free to reopen if you come up w/any ideas.\n",
"I'm encountering the same failure with `test_count`, with 200 entries expected but 240 found. But the problem isn't that there are two extra blog rows in the database. Rather there are only 10 blog rows, as expected, but the first two get iterated over twice (see the annotated test output at the end of this report).\n\nTo see what's happening, consider the test corresponding test code:\n\n``` python\n # original from tests.py, line ~606\n for blog in SelectQuery(Blog):\n for i in xrange(20):\n self.create_entry(title='entry%d' % i, blog=blog)\n```\n\nThere's an outer loop over the results of a select query and, within this loop, an inner loop that creates 20 Entry rows for the currently selected Blog row. The outer loop is lazy, however, which means the underlying SELECT statement is held open during the entire loop. This has an unfortunate interaction with the inner loop's autocommited INSERT. When `self.create_entry` finally winds its way down to a `peewee.Database.execute` call on the given INSERT statement, the latter method finishes the operation with a `commit` on the database connection. This is where things go wrong.\n\nThe problem is that when certain versions of pysqlite commit a connection, they also [reset all statements _and cursors_ open on that connection](http://article.gmane.org/gmane.comp.python.db.pysqlite.user/2217). That means the SELECT statement behind the outer loop gets reset and replays the first two rows. (Why not just the first row? Because pysqlite fetches one row ahead; by the time the first line of the inner loop executes, the second blog row has already been fetched and so it, too, will get replayed.)\n\nHere are two possible workarounds:\n\n``` python\n # fix 1: read blogs eagerly\n for blog in list(SelectQuery(Blog)):\n for i in xrange(20):\n self.create_entry(title='entry%d' % i, blog=blog)\n\n # fix 2: keep laziness but corral commit w/ explicit transaction\n def create_blog_entries():\n for blog in SelectQuery(Blog):\n for i in xrange(20):\n self.create_entry(title='entry%d' % i, blog=blog)\n test_db.commit_on_success(create_blog_entries)()\n```\n\nI hope that explanation makes sense.\n\nCheers,\nTom\n\nP.S. As promised, here's the debug log that shows what statements get executed when the problem occurs. I've added annotations to make it easier to correlate the statements with the original test code.\n\n```\n\n[thor@helium peewee (master)]$ nosetests -v tests:ModelTestCase\ntest_cloning (tests.ModelTestCase) ... ok\ntest_count (tests.ModelTestCase) ... FAIL\ntest_count_with_joins_issue27 (tests.ModelTestCase) ... ok\ntest_delete (tests.ModelTestCase) ... ok\ntest_inner_joins (tests.ModelTestCase) ... ok\ntest_insert (tests.ModelTestCase) ... ok\ntest_multi_joins (tests.ModelTestCase) ... ok\ntest_outer_joins (tests.ModelTestCase) ... ok\ntest_pagination (tests.ModelTestCase) ... ok\ntest_update (tests.ModelTestCase) ... ok\n\n======================================================================\nFAIL: test_count (tests.ModelTestCase)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/tmp/peewee/tests.py\", line 614, in test_count\n self.assertEqual(count, 200)\nAssertionError: 240 != 200\n-------------------- >> begin captured logging << --------------------\n\npeewee.logger: DEBUG: ('DROP TABLE IF EXISTS \"membership\";', None)\npeewee.logger: DEBUG: ('DROP TABLE IF EXISTS \"member\";', None)\npeewee.logger: DEBUG: ('DROP TABLE IF EXISTS \"team\";', None)\npeewee.logger: DEBUG: ('DROP TABLE IF EXISTS \"relationship\";', None)\npeewee.logger: DEBUG: ('DROP TABLE IF EXISTS \"users\";', None)\npeewee.logger: DEBUG: ('DROP TABLE IF EXISTS \"entrytag\";', None)\npeewee.logger: DEBUG: ('DROP TABLE IF EXISTS \"entry\";', None)\npeewee.logger: DEBUG: ('DROP TABLE IF EXISTS \"blog\";', None)\n\npeewee.logger: DEBUG: ('CREATE TABLE \"blog\" (\"id\" INTEGER NOT NULL PRIMARY KEY, \"title\" VARCHAR(255) NOT NULL);', None)\npeewee.logger: DEBUG: ('CREATE TABLE \"entry\" (\"pk\" INTEGER NOT NULL PRIMARY KEY, \"title\" VARCHAR(50) NOT NULL, \"content\" TEXT NOT NULL, \"pub_date\" DATETIME, \"blog_id\" INTEGER NOT NULL REFERENCES blog (id) ON DELETE CASCADE);', None)\npeewee.logger: DEBUG: ('CREATE INDEX \"entry_blog_id\" ON \"entry\"(\"blog_id\");', None)\npeewee.logger: DEBUG: ('CREATE TABLE \"entrytag\" (\"id\" INTEGER NOT NULL PRIMARY KEY, \"tag\" VARCHAR(50) NOT NULL, \"entry_id\" INTEGER NOT NULL REFERENCES entry (pk));', None)\npeewee.logger: DEBUG: ('CREATE INDEX \"entrytag_entry_id\" ON \"entrytag\"(\"entry_id\");', None)\npeewee.logger: DEBUG: ('CREATE TABLE \"users\" (\"id\" INTEGER NOT NULL PRIMARY KEY, \"username\" VARCHAR(50) NOT NULL, \"blog_id\" INTEGER REFERENCES blog (id), \"active\" SMALLINT NOT NULL);', None)\npeewee.logger: DEBUG: ('CREATE INDEX \"users_blog_id\" ON \"users\"(\"blog_id\");', None)\npeewee.logger: DEBUG: ('CREATE INDEX \"users_active\" ON \"users\"(\"active\");', None)\npeewee.logger: DEBUG: ('CREATE TABLE \"relationship\" (\"id\" INTEGER NOT NULL PRIMARY KEY, \"from_user_id\" INTEGER NOT NULL REFERENCES users (id), \"to_user_id\" INTEGER NOT NULL REFERENCES users (id));', None)\npeewee.logger: DEBUG: ('CREATE INDEX \"relationship_to_user_id\" ON \"relationship\"(\"to_user_id\");', None)\npeewee.logger: DEBUG: ('CREATE INDEX \"relationship_from_user_id\" ON \"relationship\"(\"from_user_id\");', None)\npeewee.logger: DEBUG: ('CREATE TABLE \"team\" (\"id\" INTEGER NOT NULL PRIMARY KEY, \"name\" VARCHAR(255) NOT NULL);', None)\npeewee.logger: DEBUG: ('CREATE TABLE \"member\" (\"id\" INTEGER NOT NULL PRIMARY KEY, \"username\" VARCHAR(255) NOT NULL);', None)\npeewee.logger: DEBUG: ('CREATE TABLE \"membership\" (\"id\" INTEGER NOT NULL PRIMARY KEY, \"team_id\" INTEGER NOT NULL REFERENCES team (id), \"member_id\" INTEGER NOT NULL REFERENCES member (id));', None)\npeewee.logger: DEBUG: ('CREATE INDEX \"membership_member_id\" ON \"membership\"(\"member_id\");', None)\npeewee.logger: DEBUG: ('CREATE INDEX \"membership_team_id\" ON \"membership\"(\"team_id\");', None)\n\n\n\n# From tests.py:\n# for i in xrange(10):\n# self.create_blog(title='a%d' % i)\n\npeewee.logger: DEBUG: ('INSERT INTO \"blog\" (\"title\") VALUES (?)', [u'a0'])\n... 8 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"blog\" (\"title\") VALUES (?)', [u'a9'])\n\n\n# From tests.py:\n# count = SelectQuery(Blog).count()\n# self.assertEqual(count, 10)\n# \n# count = Blog.select().count()\n# self.assertEqual(count, 10)\n\npeewee.logger: DEBUG: ('SELECT COUNT(id) FROM \"blog\"', [])\npeewee.logger: DEBUG: ('SELECT COUNT(id) FROM \"blog\"', [])\n\n\n\n# From tests.py:\n# for blog in SelectQuery(Blog):\n# for i in xrange(20):\n# self.create_entry(title='entry%d' % i, blog=blog)\n\npeewee.logger: DEBUG: ('SELECT \"id\", \"title\" FROM \"blog\"', [])\n\n# NOTE that the first two rows get replayed\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [1, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [2, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [1, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [2, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [3, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [4, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [5, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [6, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [7, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [8, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [9, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('INSERT INTO \"entry\" (\"blog_id\",\"content\",\"pub_date\",\"title\") VALUES (?,?,?,?)', [10, '', None, u'entry0'])\n... 19 lines omitted ...\npeewee.logger: DEBUG: ('SELECT COUNT(pk) FROM \"entry\"', [])\n--------------------- >> end captured logging << ---------------------\n\n----------------------------------------------------------------------\nRan 10 tests in 56.481s\n\nFAILED (failures=1)\n```\n",
"Brilliant! I figured it went somewhere along those lines but could not figure out why just blog 0 & 1 were duplicated -- thank you for the report, it was educational!\n",
"per your suggestion, eb9183529eb7b88e189ebe3447a5299ae2b950a2\n",
"I thought it was something special to do with sqlite but could never figure this out. Thank you very much for explaining this.\n",
"@tmoertel's comment did the trick for me. Thank you.\n"
] | 2011-10-19T11:34:54 | 2014-11-22T03:57:14 | 2011-11-09T02:32:32 | NONE | null | I sometimes get the following Failure:
``` python
======================================================================
FAIL: test_filter_both_directions (tests.FilterQueryTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/diggy/Documents/dev/peewee/tests.py", line 1638, in test_filter_both_directions
self.assertSQLEqual(f.sql(), ('SELECT t1.* FROM entry AS t1 INNER JOIN entrytag AS t2 ON t1.pk = t2.entry_id\nINNER JOIN blog AS t3 ON t1.blog_id = t3.id WHERE t2.tag = ? AND t3.title = ?', ['t1', 'b1']))
File "/Users/diggy/Documents/dev/peewee/tests.py", line 157, in assertSQLEqual
self.assertEqual(lhs[0].replace('?', interpolation), rhs[0].replace('?', interpolation))
AssertionError: 'SELECT t1.* FROM entry AS t1 INNER JOIN blog AS t2 ON t1.blog_id = t2.id\nINNER JOIN entrytag AS t3 ON t1.pk = t3.entry_id WHERE t2.title = ? AND t3.tag = ?' != 'SELECT t1.* FROM entry AS t1 INNER JOIN entrytag AS t2 ON t1.pk = t2.entry_id\nINNER JOIN blog AS t3 ON t1.blog_id = t3.id WHERE t2.tag = ? AND t3.title = ?'
----------------------------------------------------------------------
```
And always this one:
``` python
======================================================================
FAIL: test_count (tests.QueryTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/diggy/Documents/dev/peewee/tests.py", line 495, in test_count
self.assertEqual(count, 200)
AssertionError: 240 != 200
----------------------------------------------------------------------
Ran 56 tests in 4.145s
```
I'm already working on these - but these seme really ODD actually. There is something interesting going on at this
``` python
for blog in SelectQuery(Blog):
print blog
for i in xrange(20):
self.create_entry(title='entry%d' % i, blog=blog)
```
Which outputs:
``` python
<Blog: a0>
<Blog: a1>
<Blog: a0>
<Blog: a1>
<Blog: a2>
<Blog: a3>
<Blog: a4>
<Blog: a5>
<Blog: a6>
<Blog: a7>
<Blog: a8>
<Blog: a9>
```
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/12/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/12/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/11 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/11/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/11/comments | https://api.github.com/repos/coleifer/peewee/issues/11/events | https://github.com/coleifer/peewee/pull/11 | 1,804,881 | MDExOlB1bGxSZXF1ZXN0MzczMTQ2 | 11 | add "is not null" lookup support | {
"login": "jerodsanto",
"id": 8212,
"node_id": "MDQ6VXNlcjgyMTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/8212?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jerodsanto",
"html_url": "https://github.com/jerodsanto",
"followers_url": "https://api.github.com/users/jerodsanto/followers",
"following_url": "https://api.github.com/users/jerodsanto/following{/other_user}",
"gists_url": "https://api.github.com/users/jerodsanto/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jerodsanto/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jerodsanto/subscriptions",
"organizations_url": "https://api.github.com/users/jerodsanto/orgs",
"repos_url": "https://api.github.com/users/jerodsanto/repos",
"events_url": "https://api.github.com/users/jerodsanto/events{/privacy}",
"received_events_url": "https://api.github.com/users/jerodsanto/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"I'm not going to merge this since you can accomplish the same using `Q` objects:\n\n```\nNullModel.select().where(~Q(char_field__is=None))\n```\n\nI added this to the testcase to show how it is possible:\nhttps://github.com/coleifer/peewee/commit/08dabe0d6b82701c48022e5d7a758d29bfaea154\n",
"Fair enough, though you could make the same case for the `ne` operator.\n",
"Q objects don't appear to exist in my version of Peewee. How can I accomplish the same behavior without them? I have models like:\n\nclass Owner(Model):\n ...\nclass Ownable(Model):\n owner = ForeignKeyField(Owner, null=True, default=None)\n\nAnd I wish to obtain a list of all Ownables which do not have an owner.\n",
"You would do `Ownable.select().where(Ownable.owner >> None)` -- if you want not null: `~(Ownable.owner >> None)`\n"
] | 2011-10-03T17:58:48 | 2014-06-25T10:24:45 | 2011-10-03T18:19:37 | NONE | null | You have a way to query for columns with NULL values but not NOT NULL values, so I added it.
I wasn't sure if you'd prefer `__isnt` or `__is_not`, but I went with the latter because it's more explicit.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/11/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/11/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/11",
"html_url": "https://github.com/coleifer/peewee/pull/11",
"diff_url": "https://github.com/coleifer/peewee/pull/11.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/11.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/10 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/10/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/10/comments | https://api.github.com/repos/coleifer/peewee/issues/10/events | https://github.com/coleifer/peewee/issues/10 | 1,644,030 | MDU6SXNzdWUxNjQ0MDMw | 10 | Q() objects cannot be mixed between models | {
"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/coleifer/followers",
"following_url": "https://api.github.com/users/coleifer/following{/other_user}",
"gists_url": "https://api.github.com/users/coleifer/gists{/gist_id}",
"starred_url": "https://api.github.com/users/coleifer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/coleifer/subscriptions",
"organizations_url": "https://api.github.com/users/coleifer/orgs",
"repos_url": "https://api.github.com/users/coleifer/repos",
"events_url": "https://api.github.com/users/coleifer/events{/privacy}",
"received_events_url": "https://api.github.com/users/coleifer/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"This has been fixed in 3f6336bba6d3a0bda691fe3e333767008c2308bb\n"
] | 2011-09-14T14:31:24 | 2011-11-17T19:46:48 | 2011-11-17T19:46:48 | OWNER | null | It is not possible to create an "OR" query comparing columns from two tables. This is due to the way where clauses are created programmatically:
```
# where clauses between models are separated by calls to join() or switch()
Blog.select().where(Q( ??? )).join(Entry).where( Q(???) )
```
With the new .filter() syntax, it is syntactically possible to create these types of queries:
```
Blog.filter(Q(title='my blog') | Q(entry__title='some special entry'))
```
But there is no underlying mechanism to generate the right SQL since where clauses are stored in a dictionary keyed by the model they pertain to.
Fixing this will most likely require significant rewriting.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/10/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/10/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/9 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/9/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/9/comments | https://api.github.com/repos/coleifer/peewee/issues/9/events | https://github.com/coleifer/peewee/issues/9 | 1,564,105 | MDU6SXNzdWUxNTY0MTA1 | 9 | Primary keys that aren't integers | {
"login": "matthewturk",
"id": 89019,
"node_id": "MDQ6VXNlcjg5MDE5",
"avatar_url": "https://avatars.githubusercontent.com/u/89019?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/matthewturk",
"html_url": "https://github.com/matthewturk",
"followers_url": "https://api.github.com/users/matthewturk/followers",
"following_url": "https://api.github.com/users/matthewturk/following{/other_user}",
"gists_url": "https://api.github.com/users/matthewturk/gists{/gist_id}",
"starred_url": "https://api.github.com/users/matthewturk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/matthewturk/subscriptions",
"organizations_url": "https://api.github.com/users/matthewturk/orgs",
"repos_url": "https://api.github.com/users/matthewturk/repos",
"events_url": "https://api.github.com/users/matthewturk/events{/privacy}",
"received_events_url": "https://api.github.com/users/matthewturk/received_events",
"type": "User",
"site_admin": false
} | [
{
"id": 191752,
"node_id": "MDU6TGFiZWwxOTE3NTI=",
"url": "https://api.github.com/repos/coleifer/peewee/labels/Design%20decision",
"name": "Design decision",
"color": "02d7e1",
"default": false,
"description": null
}
] | closed | false | null | [] | null | [
"Well, it really just looks like it's searching for a pk that evaluates to a nonzero...it will be tricky since the postgresql adapter checks the value of a sequence for the last insert id. Otherwise its just that bit in the BaseModel that checks for a PrimaryKeyField.\n\nOn the other hand, a non-integer primary key can be more expensive to query on and join on... might be worthwhile to implement instead the ability to add unique indexes and have something along the lines of the workaround suggested here:\nhttp://stackoverflow.com/questions/3936182/using-a-uuid-as-a-primary-key-in-django-models-generic-relations-impact/3944247#3944247\n",
"Interesting point, and one I didn't know about. I'll take a look into it -- thank you!\n",
"I've added ability to specify a unique keyword arg when creating fields:\nhttps://github.com/coleifer/peewee/commit/c3460e32ae375984c97f28c6ec8f7b65a8ead8cf\n",
"This is awesome -- thank you very much!\n",
"Glad that commit helps -- I'm actually gonna leave this one open for now as I agree it _should_ be possible to use a TextField or something else for a primary key.\n",
"+1 , in some case it would be important, agree it should be possible to use a CharField\n",
"+1 to a primarykey CharField\n",
"Also relevant: biginteger fields\n",
"Started working on this in a branch: feature/non-integer-pk -- there are some interesting ramifications:\n- primary keys may not be autoincrementing which affects default save() and create() behavior\n- primary keys won't necessarily have a sequence so postgresql will need to have different last_insert_id behavior if so\n- foreign keys need to match the column type of the primary key\n",
"Alright! I think I have gotten this working. It can be seen in the field refactor branch:\n\nhttps://github.com/coleifer/peewee/tree/feature/field-refactor\n\nFor a diff:\n\nhttps://github.com/coleifer/peewee/compare/feature/field-refactor\n\nTests are passing in sqlite and postgresql. Saving models is a little bit different when using a non-integer autoincrement pk, basically you have to use the .create() or .save(force_insert=True) to save new instances otherwise the existance of a pk value will make the orm think you have saved it before and want to update it. That is the main gotcha.\n\nWould love to get some feedback before merging, however\n",
"Merged, syntax is\n\n``` python\n\nclass NonIntPK(TestModel):\n id = PrimaryKeyField(column_class=VarCharColumn)\n name = CharField(max_length=10)\n```\n"
] | 2011-09-05T00:09:21 | 2014-07-04T03:45:09 | 2012-03-13T18:08:49 | NONE | null | We're currently using the (hex/char) representation of UUIDs for a database, to use as primary keys. It looks like the current implementation requires Primary Key (and thus the .save() method) be an integer, and this is further checked through the isinstance call during creation of a model. It would be really great if we could use a TextField, or any field, as primary key.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/9/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/9/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/8 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/8/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/8/comments | https://api.github.com/repos/coleifer/peewee/issues/8/events | https://github.com/coleifer/peewee/issues/8 | 1,459,812 | MDU6SXNzdWUxNDU5ODEy | 8 | MyModel.create_table() doesn't use IF NOT EXISTS | {
"login": "jerodsanto",
"id": 8212,
"node_id": "MDQ6VXNlcjgyMTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/8212?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jerodsanto",
"html_url": "https://github.com/jerodsanto",
"followers_url": "https://api.github.com/users/jerodsanto/followers",
"following_url": "https://api.github.com/users/jerodsanto/following{/other_user}",
"gists_url": "https://api.github.com/users/jerodsanto/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jerodsanto/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jerodsanto/subscriptions",
"organizations_url": "https://api.github.com/users/jerodsanto/orgs",
"repos_url": "https://api.github.com/users/jerodsanto/repos",
"events_url": "https://api.github.com/users/jerodsanto/events{/privacy}",
"received_events_url": "https://api.github.com/users/jerodsanto/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"This is now fixed -- https://github.com/coleifer/peewee/commit/2b10102d6e4d41b2d99e16be1d83fcd3983e55a0\n",
"Awesome, thanks so much!\n"
] | 2011-08-22T18:00:21 | 2011-08-23T13:54:10 | 2011-08-22T23:46:35 | NONE | null | The docs say that `MyModel.create_table` will noop if the table already exists, but currently it raises a `sqlite3.OperationalError` instead.
It looks like the Database class method is ready for the `safe` version, but there is no way to use that from models.
It'd be nice if you could pass the `safe` boolean to `MyModel.create_table` like you can to `MyModel.drop_table`
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/8/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/8/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/7 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/7/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/7/comments | https://api.github.com/repos/coleifer/peewee/issues/7/events | https://github.com/coleifer/peewee/issues/7 | 688,851 | MDU6SXNzdWU2ODg4NTE= | 7 | db_table isn't read from Meta class | {
"login": "peterbe",
"id": 26739,
"node_id": "MDQ6VXNlcjI2NzM5",
"avatar_url": "https://avatars.githubusercontent.com/u/26739?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/peterbe",
"html_url": "https://github.com/peterbe",
"followers_url": "https://api.github.com/users/peterbe/followers",
"following_url": "https://api.github.com/users/peterbe/following{/other_user}",
"gists_url": "https://api.github.com/users/peterbe/gists{/gist_id}",
"starred_url": "https://api.github.com/users/peterbe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/peterbe/subscriptions",
"organizations_url": "https://api.github.com/users/peterbe/orgs",
"repos_url": "https://api.github.com/users/peterbe/repos",
"events_url": "https://api.github.com/users/peterbe/events{/privacy}",
"received_events_url": "https://api.github.com/users/peterbe/received_events",
"type": "User",
"site_admin": true
} | [] | closed | false | null | [] | null | [
"cool, pushed a testcase indicating failure, working on fix\n",
"Fix pushed in: https://github.com/coleifer/peewee/commit/981c291a83d6cb1494dfa43845db1fda56fe4028\n\nI'm looking at scrapping the whole Meta thing as a way of munging settings because the whole thing feels fragile and janky. May be an API update coming in the next couple days, but this should work for you.\n"
] | 2011-03-20T16:34:52 | 2011-03-21T16:19:00 | 2011-03-21T16:19:00 | NONE | null | If I do something like this:
```
class User(peewee.Model):
email = peewee.CharField()
class Meta:
db_table = 'users'
```
That doesn't get picked up. It's because none such extra arguments are actually used when creating the `_meta` attribute. See here: https://github.com/coleifer/peewee/blob/master/peewee.py#L1098
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/7/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/7/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/6 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/6/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/6/comments | https://api.github.com/repos/coleifer/peewee/issues/6/events | https://github.com/coleifer/peewee/pull/6 | 592,282 | MDExOlB1bGxSZXF1ZXN0NzE1MDI= | 6 | psycopg2 should be optional | {
"login": "JshWright",
"id": 69920,
"node_id": "MDQ6VXNlcjY5OTIw",
"avatar_url": "https://avatars.githubusercontent.com/u/69920?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JshWright",
"html_url": "https://github.com/JshWright",
"followers_url": "https://api.github.com/users/JshWright/followers",
"following_url": "https://api.github.com/users/JshWright/following{/other_user}",
"gists_url": "https://api.github.com/users/JshWright/gists{/gist_id}",
"starred_url": "https://api.github.com/users/JshWright/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JshWright/subscriptions",
"organizations_url": "https://api.github.com/users/JshWright/orgs",
"repos_url": "https://api.github.com/users/JshWright/repos",
"events_url": "https://api.github.com/users/JshWright/events{/privacy}",
"received_events_url": "https://api.github.com/users/JshWright/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"This would be great. Ubuntu seemed to want Postgres installed in order to satisfy psycopg through pip. I'm currently just commenting out the import locally :(\n",
"Issue fixed in https://github.com/coleifer/peewee/commit/5c5d6933e383748a99cdf5e092076a61884feebb\n\nThanks for reporting!!\n"
] | 2011-02-11T16:55:25 | 2014-07-06T01:52:33 | 2011-02-12T01:50:41 | CONTRIBUTOR | null | This is a pull request to address https://github.com/coleifer/peewee/issues/#issue/5
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/6/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/6/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/6",
"html_url": "https://github.com/coleifer/peewee/pull/6",
"diff_url": "https://github.com/coleifer/peewee/pull/6.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/6.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/5 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/5/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/5/comments | https://api.github.com/repos/coleifer/peewee/issues/5/events | https://github.com/coleifer/peewee/issues/5 | 581,203 | MDU6SXNzdWU1ODEyMDM= | 5 | Peewee shouldn't require multiple database libraries | {
"login": "JshWright",
"id": 69920,
"node_id": "MDQ6VXNlcjY5OTIw",
"avatar_url": "https://avatars.githubusercontent.com/u/69920?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JshWright",
"html_url": "https://github.com/JshWright",
"followers_url": "https://api.github.com/users/JshWright/followers",
"following_url": "https://api.github.com/users/JshWright/following{/other_user}",
"gists_url": "https://api.github.com/users/JshWright/gists{/gist_id}",
"starred_url": "https://api.github.com/users/JshWright/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JshWright/subscriptions",
"organizations_url": "https://api.github.com/users/JshWright/orgs",
"repos_url": "https://api.github.com/users/JshWright/repos",
"events_url": "https://api.github.com/users/JshWright/events{/privacy}",
"received_events_url": "https://api.github.com/users/JshWright/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"https://github.com/coleifer/peewee/commit/5c5d6933e383748a99cdf5e092076a61884feebb\n"
] | 2011-02-07T18:47:56 | 2011-02-12T01:50:55 | 2011-02-12T01:50:55 | CONTRIBUTOR | null | As of 0.3.1, peewee requires _both_ psycopg2 and sqlite3, even if you only intend to use one of them.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/5/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/5/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/4 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/4/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/4/comments | https://api.github.com/repos/coleifer/peewee/issues/4/events | https://github.com/coleifer/peewee/pull/4 | 571,526 | MDExOlB1bGxSZXF1ZXN0NjU5NjE= | 4 | MySQL Adapter | {
"login": "pplante",
"id": 58743,
"node_id": "MDQ6VXNlcjU4NzQz",
"avatar_url": "https://avatars.githubusercontent.com/u/58743?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pplante",
"html_url": "https://github.com/pplante",
"followers_url": "https://api.github.com/users/pplante/followers",
"following_url": "https://api.github.com/users/pplante/following{/other_user}",
"gists_url": "https://api.github.com/users/pplante/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pplante/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pplante/subscriptions",
"organizations_url": "https://api.github.com/users/pplante/orgs",
"repos_url": "https://api.github.com/users/pplante/repos",
"events_url": "https://api.github.com/users/pplante/events{/privacy}",
"received_events_url": "https://api.github.com/users/pplante/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"I noticed some debug statements were left in, got them out. Squashed a few bugs I also introduced.\n",
"i'm having a hard time telling what's new because you changed all my 4-space indentation two 2-space, which effectively shows every line as different.\n\nif i can have the changes in the minimum of patches i'll gladly merge\n",
"I closed this because some of my changes are incompatible right now. I will see if I can find a different way to do some of it.\n",
"For what its worth, I've got MySQL (and postgresql) support in my repo!\n",
"That's awesome to hear. Thanks!\nOn Jul 17, 2011 8:18 PM, \"coleifer\" <\[email protected]>\nwrote:\n\n> For what its worth, I've got MySQL (and postgresql) support in my repo!\n> \n> ## \n> \n> Reply to this email directly or view it on GitHub:\n> https://github.com/coleifer/peewee/pull/4#issuecomment-1592616\n"
] | 2011-02-03T01:31:29 | 2014-07-06T01:52:35 | 2011-02-08T05:31:17 | NONE | null | I added a MySQL Adapter to my fork using the new API. I made some other small changes to integrate the two source trees. Hopefully you can integrate this into the main library for others to enjoy.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/4/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/4/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/4",
"html_url": "https://github.com/coleifer/peewee/pull/4",
"diff_url": "https://github.com/coleifer/peewee/pull/4.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/4.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/3 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/3/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/3/comments | https://api.github.com/repos/coleifer/peewee/issues/3/events | https://github.com/coleifer/peewee/pull/3 | 541,965 | MDExOlB1bGxSZXF1ZXN0NTg5NjQ= | 3 | A small change to allow extra keyword arguments to be passed to sqlite3.connect() | {
"login": "JshWright",
"id": 69920,
"node_id": "MDQ6VXNlcjY5OTIw",
"avatar_url": "https://avatars.githubusercontent.com/u/69920?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JshWright",
"html_url": "https://github.com/JshWright",
"followers_url": "https://api.github.com/users/JshWright/followers",
"following_url": "https://api.github.com/users/JshWright/following{/other_user}",
"gists_url": "https://api.github.com/users/JshWright/gists{/gist_id}",
"starred_url": "https://api.github.com/users/JshWright/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JshWright/subscriptions",
"organizations_url": "https://api.github.com/users/JshWright/orgs",
"repos_url": "https://api.github.com/users/JshWright/repos",
"events_url": "https://api.github.com/users/JshWright/events{/privacy}",
"received_events_url": "https://api.github.com/users/JshWright/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"I applied the keyword args change, thanks!\n",
"The keyword args change uses the \"native\" ternary, so if your goal is to maintain Python 2.4 compatibility (which I assume is the reason for not pulling the other commit), you'll probably want to fix that.\n",
"d'oh. you just couldn't use the old-fashioned one in your patch, could you?\n",
"Or I could have just used the short-circuit like you did... Guess I have ternary on the brain from the previous commit.\n\nIn any case, this certainly meets my needs. Thanks for pulling it.\n"
] | 2011-01-21T17:36:02 | 2014-07-06T01:52:36 | 2011-01-22T04:35:30 | CONTRIBUTOR | null | Thanks for a great little ORM. It does exactly what I need, without getting in the way.
This pull request encompasses two small changes. The first is to use the Python 2.5 style ternary in place of the custom lambda. The second (and more important to me) change is to allow arbitrary keyword arguments to be passed to sqlite3.connect().
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/3/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/3/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/3",
"html_url": "https://github.com/coleifer/peewee/pull/3",
"diff_url": "https://github.com/coleifer/peewee/pull/3.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/3.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/2 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/2/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/2/comments | https://api.github.com/repos/coleifer/peewee/issues/2/events | https://github.com/coleifer/peewee/issues/2 | 470,133 | MDU6SXNzdWU0NzAxMzM= | 2 | Any plan to support MySQL and PostgreSQL? | {
"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",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"repos_url": "https://api.github.com/users/ghost/repos",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"Hmm...good question\n",
"Added support for MySQL and have only one test failure which should be fixed soon.\n",
"postgresql support added. all tests passing on sqlite, mysql and psql!\n"
] | 2010-12-12T08:18:03 | 2011-07-18T02:50:56 | 2011-06-08T13:52:37 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/2/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/2/timeline | null | completed | null | null |
|
https://api.github.com/repos/coleifer/peewee/issues/1 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1/comments | https://api.github.com/repos/coleifer/peewee/issues/1/events | https://github.com/coleifer/peewee/issues/1 | 450,127 | MDU6SXNzdWU0NTAxMjc= | 1 | None/NULL don't work | {
"login": "wearpants",
"id": 505344,
"node_id": "MDQ6VXNlcjUwNTM0NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/505344?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wearpants",
"html_url": "https://github.com/wearpants",
"followers_url": "https://api.github.com/users/wearpants/followers",
"following_url": "https://api.github.com/users/wearpants/following{/other_user}",
"gists_url": "https://api.github.com/users/wearpants/gists{/gist_id}",
"starred_url": "https://api.github.com/users/wearpants/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wearpants/subscriptions",
"organizations_url": "https://api.github.com/users/wearpants/orgs",
"repos_url": "https://api.github.com/users/wearpants/repos",
"events_url": "https://api.github.com/users/wearpants/events{/privacy}",
"received_events_url": "https://api.github.com/users/wearpants/received_events",
"type": "User",
"site_admin": false
} | [] | closed | false | null | [] | null | [
"Good point, this definitely looks like something that'll need fixing. Let me look into it.\n",
"Fixed in https://github.com/coleifer/peewee/commit/466d6d7c41d4f888d6c3db5e7de55785b2c41940\n\nCheck the test case for examples.\n"
] | 2010-12-01T18:13:36 | 2010-12-05T00:33:22 | 2010-12-05T00:33:22 | NONE | null | Stuffing a None into any field returns a False value when retrieved. For example, setting a TextField to None returns '' (empty string), BooleanField returns False, etc..
Dunno if this intentional, (real NULL support would be nice, though IIRC django discourages it). If it is, this sentence in the docs is misleading: "Conversion between python and the database is handled transparently, including the proper handling of None/NULL." As a user of the dbapi directly, I expected storing a None to return a NULL.
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1/timeline | null | completed | null | null |