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/1918 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1918/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1918/comments | https://api.github.com/repos/coleifer/peewee/issues/1918/events | https://github.com/coleifer/peewee/issues/1918 | 438,960,401 | MDU6SXNzdWU0Mzg5NjA0MDE= | 1,918 | [Question] Nested execution_context replacement in peewee 3 | {
"login": "petroprotsakh",
"id": 29977583,
"node_id": "MDQ6VXNlcjI5OTc3NTgz",
"avatar_url": "https://avatars.githubusercontent.com/u/29977583?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/petroprotsakh",
"html_url": "https://github.com/petroprotsakh",
"followers_url": "https://api.githu... | [] | closed | false | null | [] | null | [
"Oh, interesting, I hadn't thought of nested execution contexts but I can see how that might happen in a large enough codebase.\r\n\r\nSo when you use nested execution context, you expect a transaction to cover the outermost block, right?",
"Basically my thought was that inner `__exit__` commits it's transaction,... | 2019-04-30T20:22:04 | 2019-05-01T14:18:31 | 2019-05-01T13:48:17 | NONE | null | Having existing codebase using peewee 2.x, I recently performed an upgrade to peewee 3.9.3 and ran into some troubles regarding connection context usage. According to [breaking changes doc](http://docs.peewee-orm.com/en/latest/peewee/changes.html#database), all `execution_context()` calls were replaced with database it... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1918/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1918/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1917 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1917/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1917/comments | https://api.github.com/repos/coleifer/peewee/issues/1917/events | https://github.com/coleifer/peewee/issues/1917 | 438,761,153 | MDU6SXNzdWU0Mzg3NjExNTM= | 1,917 | Documentation: playhouse.reflection module does not contain generate_models | {
"login": "erezmarmor",
"id": 16885498,
"node_id": "MDQ6VXNlcjE2ODg1NDk4",
"avatar_url": "https://avatars.githubusercontent.com/u/16885498?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/erezmarmor",
"html_url": "https://github.com/erezmarmor",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"False.\r\n\r\n```python\r\nIn [1]: from playhouse.reflection import generate_models\r\n\r\nIn [2]: from peewee import PostgresqlDatabase\r\n\r\nIn [3]: db = PostgresqlDatabase('my_app')\r\n\r\nIn [4]: models = generate_models(db) # models is now a dict of table name -> model class.\r\n```",
":
- http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#reflection
- http://docs.peewee-orm.com/en/latest/peewee/interactive.html#interactive
the documentation provides this import as an example:
`from playhouse.reflection impo... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1917/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1917/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1916 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1916/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1916/comments | https://api.github.com/repos/coleifer/peewee/issues/1916/events | https://github.com/coleifer/peewee/issues/1916 | 438,578,462 | MDU6SXNzdWU0Mzg1Nzg0NjI= | 1,916 | peewee update thrown exception 'UnknownField' object has no attribute 'get_sort_key' | {
"login": "0xxfu",
"id": 11550519,
"node_id": "MDQ6VXNlcjExNTUwNTE5",
"avatar_url": "https://avatars.githubusercontent.com/u/11550519?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/0xxfu",
"html_url": "https://github.com/0xxfu",
"followers_url": "https://api.github.com/users/0xxfu/follow... | [] | closed | false | null | [] | null | [
"You are clearly using models generated using the `pwiz` tool. If pwiz cannot determine the right field type to use for a column, it uses a placeholder \"UnknownField\". You will need to edit your model definitions and replace the UnknownField with an appropriate field type (e.g. TextField, IntegerField, whatever) ... | 2019-04-30T02:16:46 | 2019-05-01T15:01:04 | 2019-04-30T13:38:53 | NONE | null | code:
```
query = Order.update(is_review=1, review_time=review_time).where(Order.order_sn == order_sn)
query.execute()
```
exception:
```
cursor = database.execute(self)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\peewee.py", line 2952, in execute
sql, params =... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1916/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1916/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1915 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1915/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1915/comments | https://api.github.com/repos/coleifer/peewee/issues/1915/events | https://github.com/coleifer/peewee/issues/1915 | 438,024,168 | MDU6SXNzdWU0MzgwMjQxNjg= | 1,915 | ValueError: invalid literal for int() with base 10: 'f5W1vg' | {
"login": "mouday",
"id": 24365682,
"node_id": "MDQ6VXNlcjI0MzY1Njgy",
"avatar_url": "https://avatars.githubusercontent.com/u/24365682?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mouday",
"html_url": "https://github.com/mouday",
"followers_url": "https://api.github.com/users/mouday/fo... | [] | closed | false | null | [] | null | [
"Well, for one, that's quite an old version of Peewee.\r\n\r\nThe other issue is the use of \"#\" in the password. Peewee's db_url module uses the stdlib url parsing library, which seems to choke on the \"#\" in the password for whatever reason.\r\n\r\nI'd suggest opening a bug on the Python bug-tracker, if one doe... | 2019-04-28T07:22:42 | 2019-04-28T16:51:16 | 2019-04-28T16:51:16 | NONE | null | peewee 2.8.2
python 2.7.5
```python
from playhouse.db_url import connect
db_url = "mysql://root:f5W1vg##123@127.0.0.1:3306/demo"
db = connect(db_url)
```
```
Traceback (most recent call last):
db = connect(db_url)
line 85, in connect
connect_kwargs = parseresult_to_dict(parsed)
line 49, ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1915/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1915/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1914 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1914/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1914/comments | https://api.github.com/repos/coleifer/peewee/issues/1914/events | https://github.com/coleifer/peewee/issues/1914 | 437,889,234 | MDU6SXNzdWU0Mzc4ODkyMzQ= | 1,914 | Join on expression raises AttributeError: 'Expression' object has no attribute 'name' | {
"login": "mikedrawback",
"id": 2569501,
"node_id": "MDQ6VXNlcjI1Njk1MDE=",
"avatar_url": "https://avatars.githubusercontent.com/u/2569501?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mikedrawback",
"html_url": "https://github.com/mikedrawback",
"followers_url": "https://api.github.com... | [] | closed | false | null | [] | null | [
"Well, part of the issue is that you are creating foreign-key constraints to a composite primary key -- but the fk constraints are to the individual columns that comprise the primary key rather than the (model_number, color) tuple. So, your schema is actually pretty broken.\r\n\r\nYou would instead do something lik... | 2019-04-27T00:57:03 | 2019-04-27T19:29:21 | 2019-04-27T13:13:14 | NONE | null | When joining two models on an expression, I started getting an error on 3.9.4 and 3.9.5.
My models:
```
import peewee
db = peewee.SqliteDatabase(':memory:')
class Product(peewee.Model):
model_number = peewee.CharField()
color = peewee.CharField()
class Meta:
database = db
p... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1914/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1914/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1913 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1913/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1913/comments | https://api.github.com/repos/coleifer/peewee/issues/1913/events | https://github.com/coleifer/peewee/issues/1913 | 437,758,553 | MDU6SXNzdWU0Mzc3NTg1NTM= | 1,913 | Using a BlobField with a context manager results in a AttributeError on 3.9.4 | {
"login": "poljar",
"id": 552026,
"node_id": "MDQ6VXNlcjU1MjAyNg==",
"avatar_url": "https://avatars.githubusercontent.com/u/552026?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/poljar",
"html_url": "https://github.com/poljar",
"followers_url": "https://api.github.com/users/poljar/follow... | [] | closed | false | null | [] | null | [
"Fixed. Pushing 3.9.5",
"Thanks for the quick response."
] | 2019-04-26T16:49:15 | 2019-04-27T12:41:32 | 2019-04-27T12:41:32 | NONE | null | The following code snippet results in an AttributeError on 3.9.4, 3.9.3 worked as expected:
```python
from peewee import SqliteDatabase, Model, BlobField
db = SqliteDatabase(":memory:")
class Table(Model):
field = BlobField()
models = [Table]
with db.bind_ctx(models):
db.create_tables(models)
```... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1913/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1913/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1912 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1912/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1912/comments | https://api.github.com/repos/coleifer/peewee/issues/1912/events | https://github.com/coleifer/peewee/issues/1912 | 436,022,434 | MDU6SXNzdWU0MzYwMjI0MzQ= | 1,912 | bulk_update failed when using composite primary keys | {
"login": "Raysmond",
"id": 4071863,
"node_id": "MDQ6VXNlcjQwNzE4NjM=",
"avatar_url": "https://avatars.githubusercontent.com/u/4071863?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Raysmond",
"html_url": "https://github.com/Raysmond",
"followers_url": "https://api.github.com/users/Raysm... | [] | closed | false | null | [] | null | [
"Thanks for reporting.",
"MySQL doesn't appear to support that syntax, as far as I can tell. [Docs](https://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html#operator_case) for 5.7. One would need to write:\r\n```\r\nCASE\r\n WHEN site_id = X1 AND id = Y1 THEN ...\r\n WHEN site_id = X2 AND id = Y2 THE... | 2019-04-23T06:38:44 | 2019-04-23T17:23:16 | 2019-04-23T15:59:03 | NONE | null | ```python
class RawArticle(BaseModel):
id = CharField()
site_id = IntegerField(null=False)
link_title = CharField(null=True)
class Meta:
table_name = 'dl_raw_article'
primary_key = CompositeKey('site_id', 'id')
```
I'm using MySQL.
```python
articles = [a for a in RawA... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1912/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1912/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1911 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1911/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1911/comments | https://api.github.com/repos/coleifer/peewee/issues/1911/events | https://github.com/coleifer/peewee/issues/1911 | 435,429,222 | MDU6SXNzdWU0MzU0MjkyMjI= | 1,911 | [Question] Extending Query class to add new query clause | {
"login": "DpodDani",
"id": 11577512,
"node_id": "MDQ6VXNlcjExNTc3NTEy",
"avatar_url": "https://avatars.githubusercontent.com/u/11577512?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/DpodDani",
"html_url": "https://github.com/DpodDani",
"followers_url": "https://api.github.com/users/Dpo... | [] | closed | false | null | [] | null | [
"Well, the easiest way of course is just to use the `SQL()` helper to insert the sql literal directly (SQL() also supports parameterization):\r\n\r\n```python\r\n\r\nquery = MyModel.select(SQL('TOP 10'))\r\n\r\nquery = MyModel.select(SQL('TOP %s', (10,)))\r\n```\r\n\r\nBut more generally to be able to translate a c... | 2019-04-20T19:08:37 | 2019-04-22T14:20:28 | 2019-04-22T14:07:35 | NONE | null | Hey,
First of all, thank you for creating this wonderful Python database interface API, it has been fun and educating tinkering around in the code base.
This is not really an issue, but more of a question. I am trying to extend Peewee to work with a SQL Server database, however I cannot seem to figure out how to ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1911/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1911/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1910 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1910/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1910/comments | https://api.github.com/repos/coleifer/peewee/issues/1910/events | https://github.com/coleifer/peewee/issues/1910 | 434,952,531 | MDU6SXNzdWU0MzQ5NTI1MzE= | 1,910 | Optional Limit after Query Object was Created | {
"login": "r0bc94",
"id": 9255088,
"node_id": "MDQ6VXNlcjkyNTUwODg=",
"avatar_url": "https://avatars.githubusercontent.com/u/9255088?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/r0bc94",
"html_url": "https://github.com/r0bc94",
"followers_url": "https://api.github.com/users/r0bc94/foll... | [] | closed | false | null | [] | null | [
"With method chaining, we like to act that the queries at each step are immutable, so a copy is returned whenever the query is changed. You just need to reassign:\r\n\r\n```python\r\nentries = entries.limit(limit)\r\n```\r\n\r\nBut your code is gross on just about every possible level for such a short piece of code... | 2019-04-18T20:45:47 | 2019-04-19T15:38:57 | 2019-04-18T20:59:26 | NONE | null | Consider that you have a wrapper method, which obtains a list of all `Entry` objects from a table.
This method has an optional `limit` parameter that limits the fetched results. If the `limit` parameter is set to -1, all rows should be selected.
When defining this wrapper function like so:
```Python
def getEn... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1910/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1910/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1909 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1909/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1909/comments | https://api.github.com/repos/coleifer/peewee/issues/1909/events | https://github.com/coleifer/peewee/issues/1909 | 434,910,778 | MDU6SXNzdWU0MzQ5MTA3Nzg= | 1,909 | Postgres UUID as Primary Key, last_id not returned on save or create. | {
"login": "Ryanb58",
"id": 3086302,
"node_id": "MDQ6VXNlcjMwODYzMDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/3086302?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Ryanb58",
"html_url": "https://github.com/Ryanb58",
"followers_url": "https://api.github.com/users/Ryanb58/... | [] | closed | false | null | [] | null | [
"Historically Peewee hasn't really offered much support for fields whose defaults are generated on the server. Postgresql has a nice RETURNING clause support which we can use to obtain the server-generated values without incurring an additional query, but no such thing exists for MySQL or Sqlite at the time of writ... | 2019-04-18T18:54:39 | 2019-04-18T20:45:43 | 2019-04-18T20:33:25 | NONE | null | Hello, I am running python 3.7 with pee wee 3.9.3.
My model seems to not have the primary key attached to the instance after saving the record to the database.
Setup:
```
DATABASE = PostgresqlDatabase(None)
class BaseModel(Model):
class Meta:
database = DATABASE
class EmailAddresses(BaseMod... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1909/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1909/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1908 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1908/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1908/comments | https://api.github.com/repos/coleifer/peewee/issues/1908/events | https://github.com/coleifer/peewee/issues/1908 | 433,819,516 | MDU6SXNzdWU0MzM4MTk1MTY= | 1,908 | [Question] how to insert literal sql fragment to query | {
"login": "james-lawrence",
"id": 2835871,
"node_id": "MDQ6VXNlcjI4MzU4NzE=",
"avatar_url": "https://avatars.githubusercontent.com/u/2835871?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/james-lawrence",
"html_url": "https://github.com/james-lawrence",
"followers_url": "https://api.gith... | [] | closed | false | null | [] | null | [
"For the first one, depends on the data-type of the timestamp column, the database driver and the db you're using. You can try using `.where(MyModel.timestamp > float('-inf'))` but it may or may not work. A much saner way would be to use `datetime.datetime.min` instead of \"-infinity\".\r\n\r\nFor insert / on confl... | 2019-04-16T14:41:49 | 2019-04-16T20:12:57 | 2019-04-16T15:25:34 | CONTRIBUTOR | null | how does one express:
`SELECT * FROM table WHERE timestamp > '-infinity';`
or
`INSERT INTO table (...., col1) VALUES (....) ON CONFLICT (id) DO UPDATE SET col1 = DEFAULT;`
w/ peewee? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1908/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1908/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1907 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1907/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1907/comments | https://api.github.com/repos/coleifer/peewee/issues/1907/events | https://github.com/coleifer/peewee/issues/1907 | 432,766,727 | MDU6SXNzdWU0MzI3NjY3Mjc= | 1,907 | Add truncate_table back into v3 | {
"login": "caidanw",
"id": 9907093,
"node_id": "MDQ6VXNlcjk5MDcwOTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/9907093?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/caidanw",
"html_url": "https://github.com/caidanw",
"followers_url": "https://api.github.com/users/caidanw/... | [] | closed | false | null | [] | null | [
"Fixed.",
"Thank you so much!"
] | 2019-04-12T22:23:40 | 2019-04-13T23:23:42 | 2019-04-13T14:10:13 | NONE | null | I would love to see this functionality in v3 as it was available in v2. It doesn't make sense to omit this simple and very useful function. I would prefer to truncate over drop tables when I don't need a table structure change.
I saw your previous comments on a [related issue](https://github.com/coleifer/peewee/issu... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1907/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1907/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1906 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1906/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1906/comments | https://api.github.com/repos/coleifer/peewee/issues/1906/events | https://github.com/coleifer/peewee/issues/1906 | 431,968,690 | MDU6SXNzdWU0MzE5Njg2OTA= | 1,906 | don't release lock when update failed | {
"login": "sison-yuan",
"id": 18308699,
"node_id": "MDQ6VXNlcjE4MzA4Njk5",
"avatar_url": "https://avatars.githubusercontent.com/u/18308699?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sison-yuan",
"html_url": "https://github.com/sison-yuan",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"You probably need to run that in a transaction and rollback the transaction in the event an integrity error occurs:\r\n\r\n```python\r\n try:\r\n with database.atomic():\r\n if grouping_key_id:\r\n grouping_key_obj = hook_log.query_grouping_key_by_id(grouping_key_id)\r\n ... | 2019-04-11T11:21:05 | 2019-04-12T04:00:47 | 2019-04-11T15:57:34 | NONE | null | I use mysqldb + peewee, when I update a row to trigger an IntegrityError on an unique key filed, first time, it is normal, but when second, it is in a mysql lock wait until timeout.
when i open the autocommit flag in the mysqldb, the problem is not appear recurrence, I think it is a bug.
i run the mysql 5.7.25 READ-C... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1906/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1906/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1905 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1905/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1905/comments | https://api.github.com/repos/coleifer/peewee/issues/1905/events | https://github.com/coleifer/peewee/issues/1905 | 431,115,771 | MDU6SXNzdWU0MzExMTU3NzE= | 1,905 | Allow disabling lazy loading - 3.x | {
"login": "brendanblackwood",
"id": 207637,
"node_id": "MDQ6VXNlcjIwNzYzNw==",
"avatar_url": "https://avatars.githubusercontent.com/u/207637?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/brendanblackwood",
"html_url": "https://github.com/brendanblackwood",
"followers_url": "https://api.... | [] | closed | false | null | [] | null | [
"Sure - `ForeignKeyField` has an `accessor_class`, which is `ForeignKeyAccessor`. This is a descriptor and it implements a `get_rel_instance()` method, which is what does the actual query for the related obj.\r\n\r\nI haven't tested this, but probably something like this ought to work:\r\n\r\n```python\r\nclass NoQ... | 2019-04-09T18:36:13 | 2019-04-14T15:40:53 | 2019-04-09T20:02:25 | NONE | null | I'm upgrading from 2.x to 3.x (finally) and had previously disabled lazy loading of foreign keys via method 2 from #1248. It looks like descriptors have changed/been removed in 3.x. Is there a way to achieve a similar behavior now? Thanks. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1905/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1905/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1904 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1904/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1904/comments | https://api.github.com/repos/coleifer/peewee/issues/1904/events | https://github.com/coleifer/peewee/issues/1904 | 430,395,633 | MDU6SXNzdWU0MzAzOTU2MzM= | 1,904 | Set statement_timeout per connection or per transaction | {
"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 | [
"Peewee uses a special hook, `Database._initialize_connection(self, conn)`, which you can subclass and override to implement special logic when a new connection is opened.\r\n\r\nUntested, but presumably something like this:\r\n\r\n```python\r\nclass PgBouncerPostgresqlDatabase(PostgresqlDatabase):\r\n def _init... | 2019-04-08T11:23:06 | 2019-04-29T07:38:45 | 2019-04-08T16:30:11 | NONE | null | Using peewee with postgres, you can normally set `statement_timeout` like this:
```python
conn = PostgresqlExtDatabase(
...
options='-c statement_timeout=1ms'
)
```
However, `pgbouncer` doesn't allow `options` (you can ignore it, but it just doesn't have effect then). So I'm planning to do something ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1904/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1904/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1903 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1903/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1903/comments | https://api.github.com/repos/coleifer/peewee/issues/1903/events | https://github.com/coleifer/peewee/pull/1903 | 429,977,906 | MDExOlB1bGxSZXF1ZXN0MjY3OTk4Nzk4 | 1,903 | Add note to quickstart about deferring database initialization | {
"login": "carlwgeorge",
"id": 12187228,
"node_id": "MDQ6VXNlcjEyMTg3MjI4",
"avatar_url": "https://avatars.githubusercontent.com/u/12187228?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/carlwgeorge",
"html_url": "https://github.com/carlwgeorge",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"The quick-start is supposed to be just that -- a quick start. It is nowhere near comprehensive.\r\n\r\nThe [database](http://docs.peewee-orm.com/en/latest/peewee/database.html) documentation contains tons of information:\r\n\r\n* [run-time database configuration](http://docs.peewee-orm.com/en/latest/peewee/databas... | 2019-04-06T00:35:18 | 2019-04-06T04:07:48 | 2019-04-06T04:07:48 | CONTRIBUTOR | null | I'm new to peewee, and must admit I spent way too much time trying to figure out how to make my application use a temporary database during tests. I'm generating the database path with [appdirs](https://github.com/ActiveState/appdirs) and changing the environment during tests with [pytest's monkeypatch](https://docs.p... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1903/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1903/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1903",
"html_url": "https://github.com/coleifer/peewee/pull/1903",
"diff_url": "https://github.com/coleifer/peewee/pull/1903.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1903.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1902 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1902/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1902/comments | https://api.github.com/repos/coleifer/peewee/issues/1902/events | https://github.com/coleifer/peewee/issues/1902 | 427,721,284 | MDU6SXNzdWU0Mjc3MjEyODQ= | 1,902 | regexp not working with database proxy (sqlite) | {
"login": "wice90",
"id": 9954078,
"node_id": "MDQ6VXNlcjk5NTQwNzg=",
"avatar_url": "https://avatars.githubusercontent.com/u/9954078?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/wice90",
"html_url": "https://github.com/wice90",
"followers_url": "https://api.github.com/users/wice90/foll... | [] | closed | false | null | [] | null | [
"How are you initializing your proxy? i.e., what is the database instance you are passing to it to initialize it?\r\n\r\nAdditionally, Peewee does not automatically register a user-defined regexp implementation for sqlite.",
"The `playhouse.sqlite_ext.SqliteExtDatabase` *does* allow you to register a REGEXP user-... | 2019-04-01T13:58:16 | 2019-04-01T14:50:16 | 2019-04-01T14:49:55 | NONE | null | When I try to execute a query with regex (using the regex() method) on a database with proxy I get an error.
This is the table I am operating on:
```from peewee import *
proxy = Proxy()
class BaseModel(Model):
class Meta:
database = proxy
class Table2(BaseModel):
column1= TextField(null=Tr... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1902/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1902/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1901 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1901/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1901/comments | https://api.github.com/repos/coleifer/peewee/issues/1901/events | https://github.com/coleifer/peewee/issues/1901 | 427,526,493 | MDU6SXNzdWU0Mjc1MjY0OTM= | 1,901 | When joining subquery, the .get() model instance result doesn't contain that attribute. | {
"login": "eric-spitfire",
"id": 46429515,
"node_id": "MDQ6VXNlcjQ2NDI5NTE1",
"avatar_url": "https://avatars.githubusercontent.com/u/46429515?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eric-spitfire",
"html_url": "https://github.com/eric-spitfire",
"followers_url": "https://api.githu... | [] | closed | false | null | [] | null | [
"Uhh, this example is damn near inscrutable. Can you make another minimal example? Like wtf is A, B, C and D, and how are they related? It seems like C and B have an \"a_id\", and then D has a \"order_id\"?",
"OK, I think I've made an example that is clear.\r\n\r\n```python\r\nclass User(Base):\r\n username = ... | 2019-04-01T06:04:30 | 2019-04-02T04:10:47 | 2019-04-01T15:22:48 | NONE | null | When joining a subquery into a Model query, I can only retrieve the subquery column via `.dicts` but not `.get`.
I'd like to be able to get the value from the model instance `.get` so as to not flatten the result / foreign key objects that might also be retrieved in the same query into a single dictionary.
Does ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1901/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1901/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1900 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1900/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1900/comments | https://api.github.com/repos/coleifer/peewee/issues/1900/events | https://github.com/coleifer/peewee/pull/1900 | 427,388,572 | MDExOlB1bGxSZXF1ZXN0MjY2MDA4NDIw | 1,900 | Make sure pwiz take care of camelCase | {
"login": "eggachecat",
"id": 18111656,
"node_id": "MDQ6VXNlcjE4MTExNjU2",
"avatar_url": "https://avatars.githubusercontent.com/u/18111656?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eggachecat",
"html_url": "https://github.com/eggachecat",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [
"I appreciate the patch. I've chosen to implement it slightly differently (default to using snake case, more tests, factored table-naming into a function to use in both places it is used)."
] | 2019-03-31T11:57:56 | 2019-03-31T17:36:12 | 2019-03-31T17:36:12 | NONE | null | Add feature/testcases so that if original table/column name is camelCase the autogenerated one by pwiz will be snake_case
Let's say we have a table named `CamelCaseTableName` who has a column named `camelCase`, with `pwiz`,
## Before
```python
class Camelcasetablename(BaseModel):
camelcase = CharField(colu... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1900/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1900/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1900",
"html_url": "https://github.com/coleifer/peewee/pull/1900",
"diff_url": "https://github.com/coleifer/peewee/pull/1900.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1900.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1899 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1899/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1899/comments | https://api.github.com/repos/coleifer/peewee/issues/1899/events | https://github.com/coleifer/peewee/pull/1899 | 427,384,984 | MDExOlB1bGxSZXF1ZXN0MjY2MDA1OTI1 | 1,899 | Make sure pwiz take care of camelCase | {
"login": "eggachecat",
"id": 18111656,
"node_id": "MDQ6VXNlcjE4MTExNjU2",
"avatar_url": "https://avatars.githubusercontent.com/u/18111656?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eggachecat",
"html_url": "https://github.com/eggachecat",
"followers_url": "https://api.github.com/use... | [] | closed | false | null | [] | null | [] | 2019-03-31T11:12:14 | 2019-03-31T11:30:25 | 2019-03-31T11:29:26 | NONE | null | Add feature/testcases so that if original table/column name is camelCase the autogenerated one by pwiz will be snake_case
Let's say we have a table named `CamelCaseTableName` who has a column named `camelCase`, with `pwiz`,
## Before
```python
class Camelcasetablename(BaseModel):
camelcase = CharField(colu... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1899/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1899/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1899",
"html_url": "https://github.com/coleifer/peewee/pull/1899",
"diff_url": "https://github.com/coleifer/peewee/pull/1899.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1899.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1898 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1898/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1898/comments | https://api.github.com/repos/coleifer/peewee/issues/1898/events | https://github.com/coleifer/peewee/issues/1898 | 426,827,128 | MDU6SXNzdWU0MjY4MjcxMjg= | 1,898 | Use Result from Select Query will create a connection | {
"login": "DoubleX69",
"id": 28057284,
"node_id": "MDQ6VXNlcjI4MDU3Mjg0",
"avatar_url": "https://avatars.githubusercontent.com/u/28057284?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/DoubleX69",
"html_url": "https://github.com/DoubleX69",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Select queries are lazily evaluated in peewee. How else do you think it would work, given that peewee uses method chaining to build a query?\r\n\r\nSo when you are building your query -- nothing happens until you:\r\n\r\n* iterate over it\r\n* call .get() / .first() / .count() etc on it\r\n* explicitly call .execu... | 2019-03-29T05:46:48 | 2019-03-29T16:28:32 | 2019-03-29T16:28:32 | NONE | null | Example:
```python
class User(BaseModel):
username = CharField(unique=True)
class Meta:
db_table = 'user'
@classmethod
def query_user(cls):
with DATABASE.connection_context():
query = User.select()
return query
q = User.query_user()
print... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1898/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1898/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1897 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1897/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1897/comments | https://api.github.com/repos/coleifer/peewee/issues/1897/events | https://github.com/coleifer/peewee/issues/1897 | 426,690,164 | MDU6SXNzdWU0MjY2OTAxNjQ= | 1,897 | Can you elaborate more on why AutoField doesn't add 'AUTOINCREMENT' to the column definition in SQLite? | {
"login": "dougthor42",
"id": 5386897,
"node_id": "MDQ6VXNlcjUzODY4OTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/5386897?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dougthor42",
"html_url": "https://github.com/dougthor42",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"You can use this, from the sqlite extension: http://docs.peewee-orm.com/en/latest/peewee/sqlite_ext.html#AutoIncrementField\r\n\r\nThe info in #147 is for a very old version."
] | 2019-03-28T20:21:59 | 2019-03-28T21:12:00 | 2019-03-28T21:12:00 | NONE | null | Let me preface by saying that I was originally going to ask if this was intended behavior, but I did *at least some* research 😆.
I'm well aware of how SQLite handles `INTEGER PRIMARY KEY` (alias for the int64 `ROWID`) and how adding `AUTOINCREMENT` modifies that. https://www.sqlite.org/autoinc.html which you and ot... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1897/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1897/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1896 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1896/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1896/comments | https://api.github.com/repos/coleifer/peewee/issues/1896/events | https://github.com/coleifer/peewee/issues/1896 | 426,002,590 | MDU6SXNzdWU0MjYwMDI1OTA= | 1,896 | Playhouse migrate MySQL DESCRIBE does not escape the table name | {
"login": "arnulfojr",
"id": 1023023,
"node_id": "MDQ6VXNlcjEwMjMwMjM=",
"avatar_url": "https://avatars.githubusercontent.com/u/1023023?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arnulfojr",
"html_url": "https://github.com/arnulfojr",
"followers_url": "https://api.github.com/users/ar... | [] | closed | false | null | [] | null | [
"Thanks, I don't know how I missed that before. Fixed.",
"Thanks for the quick fix!"
] | 2019-03-27T14:44:56 | 2019-05-18T08:39:10 | 2019-03-27T19:31:14 | NONE | null | Hello,
Logs of `migrator.add_column` when a table name is not escaped, e.g., `order`
```bash
('ALTER TABLE `order` ADD COLUMN `type` VARCHAR(255)', [])
[2019-03-27 14:37:27 +0000] [1] [DEBUG] ('UPDATE `order` SET `type` = %s', ['RECURRING_FEE'])
[2019-03-27 14:37:27 +0000] [1] [DEBUG] ('DESCRIBE order;', None)
[2... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1896/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1896/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1895 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1895/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1895/comments | https://api.github.com/repos/coleifer/peewee/issues/1895/events | https://github.com/coleifer/peewee/pull/1895 | 425,687,795 | MDExOlB1bGxSZXF1ZXN0MjY0NzI1NDAz | 1,895 | Update app.py | {
"login": "abhikrni",
"id": 35332154,
"node_id": "MDQ6VXNlcjM1MzMyMTU0",
"avatar_url": "https://avatars.githubusercontent.com/u/35332154?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/abhikrni",
"html_url": "https://github.com/abhikrni",
"followers_url": "https://api.github.com/users/abh... | [] | closed | false | null | [] | null | [
"Huh?"
] | 2019-03-26T23:07:40 | 2019-03-27T03:56:01 | 2019-03-27T03:56:00 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1895/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1895/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1895",
"html_url": "https://github.com/coleifer/peewee/pull/1895",
"diff_url": "https://github.com/coleifer/peewee/pull/1895.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1895.patch",
"merged_at": null
} | |
https://api.github.com/repos/coleifer/peewee/issues/1894 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1894/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1894/comments | https://api.github.com/repos/coleifer/peewee/issues/1894/events | https://github.com/coleifer/peewee/pull/1894 | 425,052,590 | MDExOlB1bGxSZXF1ZXN0MjY0MjM4MjUw | 1,894 | Add support for Postgres's plainto_tsquery | {
"login": "kkinder",
"id": 1115018,
"node_id": "MDQ6VXNlcjExMTUwMTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1115018?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kkinder",
"html_url": "https://github.com/kkinder",
"followers_url": "https://api.github.com/users/kkinder/... | [] | closed | false | null | [] | null | [
"I've made a slightly more compact patch for the actual implementation, plus some improvements to the docs and added a couple tests:\r\n\r\nfa8fc729f37b1ab4da420fb51f8bbc90d4074fb7"
] | 2019-03-25T18:28:10 | 2019-03-25T21:21:14 | 2019-03-25T21:21:14 | NONE | null | peewee's `TSVectorField` helpfully includes a `match` method to add a `tsquery` to a query using `to_tsquery`. However, `to_tsquery` is one of two ways you can convert a string to a `tsquery`, per the [Postgres docs](https://www.postgresql.org/docs/9.1/textsearch-controls.html):
> PostgreSQL provides the functions t... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1894/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1894/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1894",
"html_url": "https://github.com/coleifer/peewee/pull/1894",
"diff_url": "https://github.com/coleifer/peewee/pull/1894.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1894.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1893 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1893/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1893/comments | https://api.github.com/repos/coleifer/peewee/issues/1893/events | https://github.com/coleifer/peewee/issues/1893 | 424,650,498 | MDU6SXNzdWU0MjQ2NTA0OTg= | 1,893 | ForeignKeyField(..., primary_key=True) | {
"login": "fredrikchabot",
"id": 4558741,
"node_id": "MDQ6VXNlcjQ1NTg3NDE=",
"avatar_url": "https://avatars.githubusercontent.com/u/4558741?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/fredrikchabot",
"html_url": "https://github.com/fredrikchabot",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"Just add a `property` or whatever:\r\n\r\n```python\r\nclass Rone(Model):\r\n @property\r\n def r2(self):\r\n return self.rtwo.get()\r\n```"
] | 2019-03-24T19:30:24 | 2019-03-25T03:05:10 | 2019-03-25T03:05:10 | NONE | null | When defining a ForeignKeyField who is also the Primary key for the table, It would make sense to have the backref to be a reference to the record and not a select instance as there can be only one record it is referring to.
class Rone(BaseModel):
xxx = CharField(primary_key=True)
name = CharField(null=Tru... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1893/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1893/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1892 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1892/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1892/comments | https://api.github.com/repos/coleifer/peewee/issues/1892/events | https://github.com/coleifer/peewee/issues/1892 | 424,497,585 | MDU6SXNzdWU0MjQ0OTc1ODU= | 1,892 | Does "Model.ForeignKey.id IN subquery" work? | {
"login": "PicoSushi",
"id": 37548801,
"node_id": "MDQ6VXNlcjM3NTQ4ODAx",
"avatar_url": "https://avatars.githubusercontent.com/u/37548801?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/PicoSushi",
"html_url": "https://github.com/PicoSushi",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"You want \r\n\r\n```python\r\n# Moved to its own line for clarity.\r\nlectures = Lecture.select(Lecture.id).order_by(Lecture.created.desc()).limit(5)\r\nquery = (Attend\r\n .select()\r\n .where(Attend.lecture.in_(lectures)))\r\n```\r\n\r\nIf you plan on accessing attributes on either the `Lecture` ... | 2019-03-23T12:52:04 | 2019-03-24T07:00:32 | 2019-03-23T15:01:59 | NONE | null | I wrote code as below...
```python
import datetime
from peewee import SqliteDatabase, Model, TextField, DateTimeField, ForeignKeyField, IntegerField, JOIN
DATABASE = "example.db"
db = SqliteDatabase(DATABASE)
class BaseModel(Model):
class Meta:
legacy_table_names = False
database ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1892/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1892/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1891 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1891/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1891/comments | https://api.github.com/repos/coleifer/peewee/issues/1891/events | https://github.com/coleifer/peewee/issues/1891 | 424,226,437 | MDU6SXNzdWU0MjQyMjY0Mzc= | 1,891 | insert_many fails on sqlite 3.9.2 | {
"login": "mining8",
"id": 24619927,
"node_id": "MDQ6VXNlcjI0NjE5OTI3",
"avatar_url": "https://avatars.githubusercontent.com/u/24619927?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mining8",
"html_url": "https://github.com/mining8",
"followers_url": "https://api.github.com/users/mining... | [] | closed | false | null | [] | null | [
"Holy shit, Sqlite 3.6? That's like 10 years old.\r\n\r\nIt doesn't support bulk insert, so you will need to use a loop in this case."
] | 2019-03-22T14:06:43 | 2019-03-22T14:58:42 | 2019-03-22T14:58:41 | NONE | null | hi, Thank you for your great project.
On peewee version 3.9.2, I'm trying to use insert_many with sqite 3.6.21, python 2.7.10:
Test code:
=========================
from peewee import *
db = SqliteDatabase('test.db')
class BaseModel(Model):
class Meta:
database = db
class TestDB(BaseModel):
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1891/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1891/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1890 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1890/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1890/comments | https://api.github.com/repos/coleifer/peewee/issues/1890/events | https://github.com/coleifer/peewee/issues/1890 | 424,057,249 | MDU6SXNzdWU0MjQwNTcyNDk= | 1,890 | Order by FIELD function of MySQL | {
"login": "SparkleBo",
"id": 31443274,
"node_id": "MDQ6VXNlcjMxNDQzMjc0",
"avatar_url": "https://avatars.githubusercontent.com/u/31443274?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SparkleBo",
"html_url": "https://github.com/SparkleBo",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"You should be able to just use `fn.FIELD()`, since FIELD is a sql function:\r\n\r\n```python\r\nmy_query = User.select().order_by(fn.FIELD(User.id, 4, 1, 3, 2))\r\n```"
] | 2019-03-22T05:50:57 | 2019-03-22T14:57:14 | 2019-03-22T14:57:14 | NONE | null | MySQL support FIELD function to sort result with specified order. But I didn't find the usage in peewee. I wonder that if peewee support that? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1890/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1890/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1889 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1889/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1889/comments | https://api.github.com/repos/coleifer/peewee/issues/1889/events | https://github.com/coleifer/peewee/issues/1889 | 423,426,903 | MDU6SXNzdWU0MjM0MjY5MDM= | 1,889 | Peewee doesn't resolve DeferredForeignKey if class being referred to is already instanciated | {
"login": "kkinder",
"id": 1115018,
"node_id": "MDQ6VXNlcjExMTUwMTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1115018?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kkinder",
"html_url": "https://github.com/kkinder",
"followers_url": "https://api.github.com/users/kkinder/... | [] | closed | false | null | [] | null | [
"> The reason is that when you're splitting up a dozen or more tables, where each model gets its own file, it becomes too hard to figure out what's created first and what isn't. It's far easier to always use DeferredForeignKey and put dependent imports at the bottom.\r\n\r\nWhat you're saying, in effect, is \"I hav... | 2019-03-20T19:12:05 | 2019-03-25T21:52:31 | 2019-03-21T19:34:59 | NONE | null | Here's a quick example:
```
# models.py
import peewee
database = peewee.PostgresqlDatabase("foobar")
database.execute_sql('CREATE EXTENSION IF NOT EXISTS "uuid-ossp"')
class Artist(peewee.Model):
id = peewee.UUIDField(primary_key=True)
name = peewee.CharField()
class Meta:
databa... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1889/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1889/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1888 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1888/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1888/comments | https://api.github.com/repos/coleifer/peewee/issues/1888/events | https://github.com/coleifer/peewee/issues/1888 | 423,221,043 | MDU6SXNzdWU0MjMyMjEwNDM= | 1,888 | How to realize `count + distinct + group_by` query? | {
"login": "hustlibraco",
"id": 5344453,
"node_id": "MDQ6VXNlcjUzNDQ0NTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/5344453?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hustlibraco",
"html_url": "https://github.com/hustlibraco",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Pretty straightforward:\r\n\r\n```python\r\nquery = (PortInfo\r\n .select(PortInfo.state, fn.COUNT(PortInfo.ip.distinct(), PortInfo.port))\r\n .group_by(PortInfo.state))\r\n```\r\n\r\nTranslates into:\r\n\r\n```sql\r\nSELECT \"t1\".\"state\", COUNT(DISTINCT \"t1\".\"ip\", \"t1\".\"port\") \r\nFROM ... | 2019-03-20T12:18:59 | 2019-03-21T19:38:29 | 2019-03-21T19:38:29 | NONE | null | SQL like this:
```
-- portinfo: ip port state
SELECT
state,
count( DISTINCT ip, port )
FROM
port_info
GROUP BY
state
```
I have tried 2 method, use `concat_ws` or `subquery`. Is there a more elegant way to write this sql in peewee? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1888/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1888/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1887 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1887/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1887/comments | https://api.github.com/repos/coleifer/peewee/issues/1887/events | https://github.com/coleifer/peewee/issues/1887 | 421,504,671 | MDU6SXNzdWU0MjE1MDQ2NzE= | 1,887 | Make None a default when initializing SqliteDatabase | {
"login": "impredicative",
"id": 566650,
"node_id": "MDQ6VXNlcjU2NjY1MA==",
"avatar_url": "https://avatars.githubusercontent.com/u/566650?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/impredicative",
"html_url": "https://github.com/impredicative",
"followers_url": "https://api.github.co... | [] | closed | false | null | [] | null | [
"If you don't initialize your `SqliteDatabase` instance with a database parameter, then you have to call `.init()` at a later time. By explicitly requiring `None`, it reinforces the idea that the database is not initialized yet, and the actual initialization is happening later in a call to `.init()`.",
"A very cl... | 2019-03-15T12:53:23 | 2019-03-26T04:24:47 | 2019-03-15T16:55:38 | NONE | null | Instead of me having to do `SqliteDatabase(None)`, can `None` be made a default? I should then just be able to do `SqliteDatabase()`. Currently it raises `TypeError`. It seems needlessly noisy to have to specify `None` explicitly. Thanks. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1887/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1887/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1886 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1886/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1886/comments | https://api.github.com/repos/coleifer/peewee/issues/1886/events | https://github.com/coleifer/peewee/issues/1886 | 421,000,589 | MDU6SXNzdWU0MjEwMDA1ODk= | 1,886 | 'column_name' argument of DeferredForeignKey field is ignored | {
"login": "droserasprout",
"id": 10263434,
"node_id": "MDQ6VXNlcjEwMjYzNDM0",
"avatar_url": "https://avatars.githubusercontent.com/u/10263434?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/droserasprout",
"html_url": "https://github.com/droserasprout",
"followers_url": "https://api.githu... | [] | closed | false | null | [] | null | [
"Thanks for the excellent ticket -- I'll take a look.",
"I cannot replicate this issue. I've added some tests which I would have thought would reveal the problem, but they are passing without issue: ea12dadf5f370e470e05c760c02be4e7dca1edcd\r\n\r\nIf you can comment / share a test-case that replicates the problem,... | 2019-03-14T12:51:27 | 2019-03-15T16:54:12 | 2019-03-15T16:53:45 | NONE | null | ```
class Task(Model):
[...]
CreateUser = DeferredForeignKey('User', column_name='createuser', null=True, field='ID', index=False)
UpdateUser = DeferredForeignKey('User', column_name='updateuser', null=True, field='ID', index=False)
>>> Task.select().first()
2019-03-14 12:41:03,109 DEBUG [peewee.... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1886/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1886/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1885 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1885/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1885/comments | https://api.github.com/repos/coleifer/peewee/issues/1885/events | https://github.com/coleifer/peewee/issues/1885 | 420,896,007 | MDU6SXNzdWU0MjA4OTYwMDc= | 1,885 | ForeignKeyField error | {
"login": "vannesspeng",
"id": 11361345,
"node_id": "MDQ6VXNlcjExMzYxMzQ1",
"avatar_url": "https://avatars.githubusercontent.com/u/11361345?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vannesspeng",
"html_url": "https://github.com/vannesspeng",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"First: format your code. PLEASE. Here is a link: https://guides.github.com/features/mastering-markdown/\r\n\r\nSecond: you have two foreign-keys pointing to `User`. You need to specify a name for the back-reference that doesn't collide.\r\n\r\nIn your example, I would do something like:\r\n\r\n```python\r\nsender ... | 2019-03-14T08:51:47 | 2019-03-14T17:33:48 | 2019-03-14T17:33:47 | NONE | null | class Message(BaseModel):
sender = ForeignKeyField(User, verbose_name="发送者")
receiver = ForeignKeyField(User, verbose_name="接受者")
message_type = IntegerField(choices=MESSAGES_TYPES, verbose_name="类别")
message = CharField(max_length=500, verbose_name="内容", null=True)
parent_content = CharField(m... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1885/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1885/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1884 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1884/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1884/comments | https://api.github.com/repos/coleifer/peewee/issues/1884/events | https://github.com/coleifer/peewee/issues/1884 | 420,742,584 | MDU6SXNzdWU0MjA3NDI1ODQ= | 1,884 | Binding to EXCLUDED in upsert WHERE expression | {
"login": "brandond",
"id": 370103,
"node_id": "MDQ6VXNlcjM3MDEwMw==",
"avatar_url": "https://avatars.githubusercontent.com/u/370103?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/brandond",
"html_url": "https://github.com/brandond",
"followers_url": "https://api.github.com/users/brandon... | [] | closed | false | null | [] | null | [
"Seems like I can do this, but I'm not sure if this is correct or not:\r\n\r\n```python\r\nEXCLUDED = Entity('EXCLUDED') \r\n```",
"I mistakenly thought that `EXCLUDED` only applied to the SET part...didn't realize it could also be used in the `WHERE` portion. Thanks, I will put together a fix.",
"Fixed. Docs a... | 2019-03-13T22:10:34 | 2019-03-14T04:43:25 | 2019-03-14T04:41:25 | NONE | null | For languages with upsert support, the row that would have been inserted if not for the conflict can be addressed in SQL as 'excluded':
```Column names in the expressions of a DO UPDATE refer to the original unchanged value of the column, before the attempted INSERT. To use the value that would have been inserted ha... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1884/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1884/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1883 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1883/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1883/comments | https://api.github.com/repos/coleifer/peewee/issues/1883/events | https://github.com/coleifer/peewee/issues/1883 | 420,663,883 | MDU6SXNzdWU0MjA2NjM4ODM= | 1,883 | Playhouse PooledPostgresqlDatabase | {
"login": "cypmaster14",
"id": 18011557,
"node_id": "MDQ6VXNlcjE4MDExNTU3",
"avatar_url": "https://avatars.githubusercontent.com/u/18011557?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cypmaster14",
"html_url": "https://github.com/cypmaster14",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"Peewee ```3.9.2``` \r\nPsycopg2 ```2.7.7```\r\n",
"Are you messing with `._connections` in any way? The `._connections` list is a heap of `(timestamp, conn)` 2-tuples.\r\n\r\nPerhaps the issue is that there are two connections in the `_connections` heap with the exact same timestamp (down to the microsecond?).\r... | 2019-03-13T18:50:49 | 2019-03-15T23:49:03 | 2019-03-15T23:49:03 | NONE | null | Hello,
Some unexpected error occurs when the pooled connection is used for a Postgresql database.
```
File "D:\Python36_x64\test_project\lib\site-packages\playhouse\pool.py", line 125, in _connect
ts, conn = heapq.heappop(self._connections)
TypeError: '<' not supported between instances of 'psycopg2.extensio... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1883/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1883/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1882 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1882/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1882/comments | https://api.github.com/repos/coleifer/peewee/issues/1882/events | https://github.com/coleifer/peewee/issues/1882 | 420,453,592 | MDU6SXNzdWU0MjA0NTM1OTI= | 1,882 | auto field for postgres but not primary key | {
"login": "ra-esmith",
"id": 24212262,
"node_id": "MDQ6VXNlcjI0MjEyMjYy",
"avatar_url": "https://avatars.githubusercontent.com/u/24212262?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ra-esmith",
"html_url": "https://github.com/ra-esmith",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"I am going to try\r\n\r\nfrom playhouse.signals import Model, pre_save\r\n\r\nclass MyModel(Model):\r\n data = IntegerField()\r\n\r\n@pre_save(sender=MyModel)\r\ndef on_save_handler(model_class, instance, created):\r\n # find max value of temp_id in model\r\n # increment it by one and assign it to model i... | 2019-03-13T11:38:32 | 2019-03-13T12:27:52 | 2019-03-13T12:27:51 | NONE | null | Good Morning,
How would I, using the current version of peewee.
Define a field on my table which is an integer, serially increases in value, and is not a primary key field. Auto Field gets the serial, but always looks to be primary. I have some old code which already has a primary key, but it the primary key is n... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1882/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1882/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1881 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1881/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1881/comments | https://api.github.com/repos/coleifer/peewee/issues/1881/events | https://github.com/coleifer/peewee/issues/1881 | 419,859,760 | MDU6SXNzdWU0MTk4NTk3NjA= | 1,881 | MaxConnectionsExceeded: Exceeded maximum connections. | {
"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 | [
"Sry,I miss applying the wrapper in some functions.",
"Running each request in a new thread is kinda silly...but ok? Presumably your wsgi server would handle all that. So you're probably running threads-in-threads?\r\n\r\nAnyway...ok?"
] | 2019-03-12T08:34:12 | 2019-03-12T12:51:39 | 2019-03-12T08:45:12 | NONE | null | I wrote a wrapper to handle each request I received. Each request is in a separate thread.
Code Samples:
```
t = Thread(target=handle_request)
t.start()
```
The db config and wrapper:
```
peewee_database = PooledMySQLDatabase(mysql_config['db'], host=mysql_config['host'], user=mysql_config['user'],
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1881/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1881/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1880 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1880/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1880/comments | https://api.github.com/repos/coleifer/peewee/issues/1880/events | https://github.com/coleifer/peewee/issues/1880 | 419,801,552 | MDU6SXNzdWU0MTk4MDE1NTI= | 1,880 | pool.map cannot pickle database or results object | {
"login": "tsikerdekis",
"id": 232134,
"node_id": "MDQ6VXNlcjIzMjEzNA==",
"avatar_url": "https://avatars.githubusercontent.com/u/232134?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tsikerdekis",
"html_url": "https://github.com/tsikerdekis",
"followers_url": "https://api.github.com/user... | [] | closed | false | null | [] | null | [
"Pickle doesn't like the fact that you've nested your `User` model inside the `class Database`. Consider reorganizing your code. It will work fine to pickle Peewee model classes and instances (though this is really not advisable!), but not in the way you have written your code.\r\n\r\nA couple other things to menti... | 2019-03-12T04:54:39 | 2019-03-15T12:39:59 | 2019-03-12T15:46:22 | NONE | null | I have a db file:
```
from datetime import datetime, timezone
import pickle
import os
from peewee import *
# Global database object
DB = SqliteDatabase(None)
class Database:
# db is meant to be a dict
# contains object User and indexed by a user's user_id
# Why set it as None? See below:
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1880/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1880/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1879 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1879/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1879/comments | https://api.github.com/repos/coleifer/peewee/issues/1879/events | https://github.com/coleifer/peewee/issues/1879 | 419,203,044 | MDU6SXNzdWU0MTkyMDMwNDQ= | 1,879 | defining table_name dynamically in _meta database not functioning properly | {
"login": "eliteuser26",
"id": 31997745,
"node_id": "MDQ6VXNlcjMxOTk3NzQ1",
"avatar_url": "https://avatars.githubusercontent.com/u/31997745?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eliteuser26",
"html_url": "https://github.com/eliteuser26",
"followers_url": "https://api.github.com/... | [] | closed | false | null | [] | null | [
"```python\r\nWeathervalue._meta.table_name = self.selectedstation+'_weathervalue'\r\ndel Weathervalue._meta.table # Remove cached table property, will regenerate\r\n```\r\n\r\nCan you test making the addition above?",
"Issue resolved. According to the documentation, I needed to create a table model for each tab... | 2019-03-10T16:15:38 | 2019-03-10T19:36:09 | 2019-03-10T18:54:25 | NONE | null | I am trying to define the table_name in the _meta database dynamically in the Python code. When defining the default table to use for a select query it doesn't access the proper table when it has been defined at the start even do the connection to the database was closed.
Used this command for defining the table_na... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1879/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1879/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1878 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1878/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1878/comments | https://api.github.com/repos/coleifer/peewee/issues/1878/events | https://github.com/coleifer/peewee/pull/1878 | 419,030,096 | MDExOlB1bGxSZXF1ZXN0MjU5NjYzMTM1 | 1,878 | Update peewee.py | {
"login": "jieshukai",
"id": 38142715,
"node_id": "MDQ6VXNlcjM4MTQyNzE1",
"avatar_url": "https://avatars.githubusercontent.com/u/38142715?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jieshukai",
"html_url": "https://github.com/jieshukai",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"I'll pass. Plus you've got tests failing due to unbound fields not having a `model` attribute."
] | 2019-03-09T03:54:07 | 2019-03-09T04:26:30 | 2019-03-09T04:26:30 | NONE | null | support mysql comment | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1878/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1878/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1878",
"html_url": "https://github.com/coleifer/peewee/pull/1878",
"diff_url": "https://github.com/coleifer/peewee/pull/1878.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1878.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1877 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1877/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1877/comments | https://api.github.com/repos/coleifer/peewee/issues/1877/events | https://github.com/coleifer/peewee/issues/1877 | 418,737,931 | MDU6SXNzdWU0MTg3Mzc5MzE= | 1,877 | NULLS not supported on SQLite | {
"login": "mkoura",
"id": 2352619,
"node_id": "MDQ6VXNlcjIzNTI2MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/2352619?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mkoura",
"html_url": "https://github.com/mkoura",
"followers_url": "https://api.github.com/users/mkoura/foll... | [] | closed | false | null | [] | null | [
"NULLS is not supported by Sqlite. For SQLite you can use a case expression, however: http://docs.peewee-orm.com/en/latest/peewee/api.html#Case",
"I've added a feature check and compatibility layer so that you can specify ``nulls='first'`` or ``nulls='last'`` with any database, and Peewee will generate the approp... | 2019-03-08T10:56:57 | 2019-03-10T16:13:17 | 2019-03-09T04:12:51 | NONE | null | Syntax like `ORDER BY somevalue DESC NULLS LAST` doesn't work on SQLite. We are using `column.desc(nulls='LAST')` in one of our models and when using SQLite (for unit testing), this fails with
```
Traceback (most recent call last):
File "<venv>/lib64/python3.7/site-packages/peewee.py", line 2835, in execute_sql
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1877/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1877/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1876 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1876/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1876/comments | https://api.github.com/repos/coleifer/peewee/issues/1876/events | https://github.com/coleifer/peewee/issues/1876 | 417,698,604 | MDU6SXNzdWU0MTc2OTg2MDQ= | 1,876 | AttributeError: 'Connection' object has no attribute 'server_version' | {
"login": "strongbugman",
"id": 16114285,
"node_id": "MDQ6VXNlcjE2MTE0Mjg1",
"avatar_url": "https://avatars.githubusercontent.com/u/16114285?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/strongbugman",
"html_url": "https://github.com/strongbugman",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"Thanks for the quick report. This should be fixed -- I had been testing against pymysql and neglected to handle `MySQLdb` correctly.\r\n\r\nI've pushed 3.9.1 which contains the fix."
] | 2019-03-06T09:17:47 | 2019-03-06T13:10:32 | 2019-03-06T13:08:07 | NONE | null | Help! I got a problem when I call `create_tables` function with 3.90 version:
```
../../../.local/share/virtualenvs/shanbay_sea/lib/python3.6/site-packages/peewee.py:2989: in create_tables
model.create_table(**options)
../../../.local/share/virtualenvs/shanbay_sea/lib/python3.6/site-packages/peewee.py:5999: i... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1876/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1876/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1875 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1875/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1875/comments | https://api.github.com/repos/coleifer/peewee/issues/1875/events | https://github.com/coleifer/peewee/issues/1875 | 416,955,253 | MDU6SXNzdWU0MTY5NTUyNTM= | 1,875 | Inserting a timestamp value of 0 or "1970-01-01 00:00:00" followed by a get returns None | {
"login": "dougthor42",
"id": 5386897,
"node_id": "MDQ6VXNlcjUzODY4OTc=",
"avatar_url": "https://avatars.githubusercontent.com/u/5386897?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dougthor42",
"html_url": "https://github.com/dougthor42",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"This relates to the following code:\r\n\r\n```python\r\n def python_value(self, value):\r\n if value is not None and isinstance(value, (int, float, long)):\r\n if value == 0:\r\n return\r\n```\r\n\r\nI suppose this is a bug, so I've removed the \"if value == 0\" conditional.\r\n... | 2019-03-04T19:24:41 | 2019-03-04T22:28:46 | 2019-03-04T20:38:06 | NONE | null | # Summary
The `.get` method on a model with a `TimestampField` field will return `None` if the value stored is the POSIX epoch `1970-01-01 00:00:00` (POSIX timestamp `0`).
# Steps to reproduce:
Here's a short example program:
```python
# example.py
from datetime import datetime
from peewee import *
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1875/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1875/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1874 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1874/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1874/comments | https://api.github.com/repos/coleifer/peewee/issues/1874/events | https://github.com/coleifer/peewee/issues/1874 | 416,874,080 | MDU6SXNzdWU0MTY4NzQwODA= | 1,874 | SSL and peewee | {
"login": "ra-esmith",
"id": 24212262,
"node_id": "MDQ6VXNlcjI0MjEyMjYy",
"avatar_url": "https://avatars.githubusercontent.com/u/24212262?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ra-esmith",
"html_url": "https://github.com/ra-esmith",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"From the [docs](http://docs.peewee-orm.com/en/latest/peewee/database.html):\r\n\r\n> The Database initialization method expects the name of the database as the first parameter. Subsequent keyword arguments are passed to the underlying database driver when establishing the connection, allowing you to pass vendor-sp... | 2019-03-04T16:06:52 | 2019-04-04T23:11:45 | 2019-03-04T18:48:09 | NONE | null | Hello,
Not sure if this is something peewee can help with.
I have been using peewee for a few years now, works great. Oddly this morning I am getting lots of errors from heroku related to SSL
The docs from heroku suggest that I should say "sslmode='require' in my connection to the database. As heroku says SS... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1874/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1874/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1873 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1873/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1873/comments | https://api.github.com/repos/coleifer/peewee/issues/1873/events | https://github.com/coleifer/peewee/issues/1873 | 415,328,107 | MDU6SXNzdWU0MTUzMjgxMDc= | 1,873 | Unexpected results when using insert_many | {
"login": "tornikenats",
"id": 1811195,
"node_id": "MDQ6VXNlcjE4MTExOTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/1811195?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tornikenats",
"html_url": "https://github.com/tornikenats",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Yes, this is expected. You need to provide dictionaries with the *same* keys and values (or tuples of the same length). When you issue a SQL bulk insert, you list the expected columns, then the tuples of values, e.g.:\r\n\r\n```sql\r\ninsert into tbl_name (cola, colb, colc) values (?, ?, ?), (?, ?, ?), (?, ?, ?)\r... | 2019-02-27T21:09:50 | 2019-02-27T21:36:14 | 2019-02-27T21:36:14 | NONE | null | When you try to insert_many, different first objects lead to different results. See below:
```python
#models.py
from peewee import (
MySQLDatabase,
Model,
CharField
)
from playhouse.db_url import connect
db_url = 'mysql://root@localhost/test'
db = connect(db_url)
class TestAccount(Model):
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1873/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1873/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1872 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1872/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1872/comments | https://api.github.com/repos/coleifer/peewee/issues/1872/events | https://github.com/coleifer/peewee/issues/1872 | 415,131,019 | MDU6SXNzdWU0MTUxMzEwMTk= | 1,872 | [PostgreSQL - Connection pooling] No results to fetch at restart of application | {
"login": "edebernis",
"id": 2584209,
"node_id": "MDQ6VXNlcjI1ODQyMDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/2584209?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/edebernis",
"html_url": "https://github.com/edebernis",
"followers_url": "https://api.github.com/users/ed... | [] | closed | false | null | [] | null | [
"So if you are exiting/terminating your Python process, there's no need to call `close_idle()` because the process will exit anyways, closing everything.\r\n\r\nI'm not sure what's going on as far as when the subprocesses are getting forked (before or after the connection pool is initialized? hopefully before). Or ... | 2019-02-27T13:43:13 | 2019-02-27T21:52:16 | 2019-02-27T21:52:16 | NONE | null | Hello,
I am using Peewee in combination with Bottle web framework, uWSGI and Docker.
I have 10 uWSGI workers running in a Docker container. Each worker connects to a PostgreSQL database using connection pooling :
```
from playhouse.pool import *
database = PooledPostgresqlDatabase(None)
database.init(db_name, m... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1872/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1872/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1871 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1871/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1871/comments | https://api.github.com/repos/coleifer/peewee/issues/1871/events | https://github.com/coleifer/peewee/issues/1871 | 414,240,532 | MDU6SXNzdWU0MTQyNDA1MzI= | 1,871 | Dropping foreign key constraints | {
"login": "arel",
"id": 153497,
"node_id": "MDQ6VXNlcjE1MzQ5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/153497?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arel",
"html_url": "https://github.com/arel",
"followers_url": "https://api.github.com/users/arel/followers",
... | [] | closed | false | null | [] | null | [
"For reference (for anyone googling this) if you want to drop a table in MySQL without regard to its foreign key constraints, you can temporarily [`SET FOREIGN_KEY_CHECKS = 0`](https://stackoverflow.com/a/8538716/2438538). Something like this:\r\n\r\n```python\r\n# disable foreign key checks (lasts for this session... | 2019-02-25T18:21:13 | 2019-02-27T21:24:17 | 2019-02-27T21:24:17 | NONE | null | I have a situation with [circular foreign key dependencies](http://docs.peewee-orm.com/en/latest/peewee/models.html#circular-foreign-key-dependencies), and I followed the approach of using a `DeferredForeignKey`. I am using MySQL.
As mentioned in the docs, in order to use this approach I need to explicitly create fo... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1871/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1871/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1870 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1870/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1870/comments | https://api.github.com/repos/coleifer/peewee/issues/1870/events | https://github.com/coleifer/peewee/issues/1870 | 413,927,519 | MDU6SXNzdWU0MTM5Mjc1MTk= | 1,870 | _in_use size exceed Maximum connections despite calling db.close_idle(), db.manual_close() or db.close_stale(60) | {
"login": "ernest-andela",
"id": 46436012,
"node_id": "MDQ6VXNlcjQ2NDM2MDEy",
"avatar_url": "https://avatars.githubusercontent.com/u/46436012?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ernest-andela",
"html_url": "https://github.com/ernest-andela",
"followers_url": "https://api.githu... | [] | closed | false | null | [] | null | [
"`is_closed` is implemented on `peewee.Database` in `peewee.py`. What it does is check whether there is a connection already open (for the current thread, if you're using multiple threads).\r\n\r\nThe logic of `manual_close` could be described in this way:\r\n\r\n1. does the current thread have a connection open? I... | 2019-02-25T04:26:48 | 2019-02-28T04:53:52 | 2019-02-28T04:53:52 | NONE | null | Calling the manual_close() method always return False because of this line in the code https://github.com/coleifer/peewee/blob/master/playhouse/pool.py#L194 . Where can l find the method is_closed() on this line https://github.com/coleifer/peewee/blob/master/playhouse/pool.py#L194?
**Below is my initials for the cr... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1870/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1870/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1869 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1869/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1869/comments | https://api.github.com/repos/coleifer/peewee/issues/1869/events | https://github.com/coleifer/peewee/pull/1869 | 413,801,880 | MDExOlB1bGxSZXF1ZXN0MjU1NjcxODg4 | 1,869 | Travis CI recommends removing the sudo tag | {
"login": "cclauss",
"id": 3709715,
"node_id": "MDQ6VXNlcjM3MDk3MTU=",
"avatar_url": "https://avatars.githubusercontent.com/u/3709715?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/cclauss",
"html_url": "https://github.com/cclauss",
"followers_url": "https://api.github.com/users/cclauss/... | [] | closed | false | null | [] | null | [
"So this change completely fucks the 3.8 tests and the solution is to mark it as \"allow failures\"? Nope.",
"OK, I owe you an apology actually, as the psycopg2 driver installation seems to be failing on 3.8 regardless of any other changes. Sorry about that."
] | 2019-02-24T09:33:12 | 2019-02-27T21:40:31 | 2019-02-27T21:13:20 | NONE | null | [Travis are now recommending removing the __sudo__ tag](https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration).
"_If you currently specify __sudo: false__ in your __.travis.yml__, we recommend removing that configuration_" | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1869/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1869/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1869",
"html_url": "https://github.com/coleifer/peewee/pull/1869",
"diff_url": "https://github.com/coleifer/peewee/pull/1869.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1869.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1868 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1868/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1868/comments | https://api.github.com/repos/coleifer/peewee/issues/1868/events | https://github.com/coleifer/peewee/issues/1868 | 413,779,102 | MDU6SXNzdWU0MTM3NzkxMDI= | 1,868 | a | {
"login": "efake2002",
"id": 37454883,
"node_id": "MDQ6VXNlcjM3NDU0ODgz",
"avatar_url": "https://avatars.githubusercontent.com/u/37454883?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/efake2002",
"html_url": "https://github.com/efake2002",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"I think that I have a solution to your problem. But I warn you, I'm quite a inexperienced programmer and this is monkey patching (I know, I know, shame on me, but it works!). So take this solution with a grain of salt.\r\n\r\nI have implemented this months ago, so I don't really know what it is doing under the hoo... | 2019-02-24T04:05:30 | 2022-03-03T19:23:09 | 2019-02-25T00:06:46 | NONE | null | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1868/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1868/timeline | null | completed | null | null | |
https://api.github.com/repos/coleifer/peewee/issues/1867 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1867/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1867/comments | https://api.github.com/repos/coleifer/peewee/issues/1867/events | https://github.com/coleifer/peewee/issues/1867 | 413,438,113 | MDU6SXNzdWU0MTM0MzgxMTM= | 1,867 | CentOS 6 support | {
"login": "goooroooX",
"id": 27283908,
"node_id": "MDQ6VXNlcjI3MjgzOTA4",
"avatar_url": "https://avatars.githubusercontent.com/u/27283908?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/goooroooX",
"html_url": "https://github.com/goooroooX",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"Those test failures are likely due to your using an absolutely ancient version of sqlite. This ancient version of sqlite does not seem to support bulk insert. That is the problem. Upgrade sqlite to a newer version."
] | 2019-02-22T14:52:50 | 2019-02-22T15:27:24 | 2019-02-22T15:27:24 | NONE | null | Hi,
It seems peewee module is lack of CentOS 6 support. I have tried it in docker container and normal CentOS 6.8/6.9 installation, and in all cases I have the same exception (Python 2.6/2.7, x86/x64):
` File "/app/base.py", line 233, in feed
LogSourceModel.insert_many(batch).execute()
File "/app/libs/pe... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1867/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1867/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1866 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1866/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1866/comments | https://api.github.com/repos/coleifer/peewee/issues/1866/events | https://github.com/coleifer/peewee/pull/1866 | 413,313,778 | MDExOlB1bGxSZXF1ZXN0MjU1MzI1MTk4 | 1,866 | Removed incorrect import. ManyToManyField is in peewee module | {
"login": "oscarcp",
"id": 462631,
"node_id": "MDQ6VXNlcjQ2MjYzMQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/462631?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/oscarcp",
"html_url": "https://github.com/oscarcp",
"followers_url": "https://api.github.com/users/oscarcp/fo... | [] | closed | false | null | [] | null | [] | 2019-02-22T09:25:08 | 2019-02-22T22:05:21 | 2019-02-22T22:05:21 | CONTRIBUTOR | null | Sorry, this line in the docs has been bugging me for years. It's been a while since ManyToManyField has been moved to the peewee core and is not located in the playhouse module anymore. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1866/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1866/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1866",
"html_url": "https://github.com/coleifer/peewee/pull/1866",
"diff_url": "https://github.com/coleifer/peewee/pull/1866.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1866.patch",
"merged_at": "2019-02-22T22:05:21"
} |
https://api.github.com/repos/coleifer/peewee/issues/1865 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1865/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1865/comments | https://api.github.com/repos/coleifer/peewee/issues/1865/events | https://github.com/coleifer/peewee/issues/1865 | 412,727,563 | MDU6SXNzdWU0MTI3Mjc1NjM= | 1,865 | Update multiple rows by id | {
"login": "gurland",
"id": 30530987,
"node_id": "MDQ6VXNlcjMwNTMwOTg3",
"avatar_url": "https://avatars.githubusercontent.com/u/30530987?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gurland",
"html_url": "https://github.com/gurland",
"followers_url": "https://api.github.com/users/gurlan... | [] | closed | false | null | [] | null | [
"If you're using Postgres or a recent-ish sqlite, you can try to use the `ValuesList` with a common table expression in an UPDATE query. Postgres also supports UPDATE FROM which could also work. You can see an example here, as I've added a testcase: c1b6e5f8c5a2b6799f24b2df8788f43a0ba8811d"
] | 2019-02-21T03:08:03 | 2019-02-21T16:56:25 | 2019-02-21T16:56:25 | NONE | null | I have list of dicts `[{"pk": 1, "value": 12}, ...]`, how could I update all rows by their `id`?
Only way I found is:
```
m = MyModel.get(id=pk)
m.value = value
m.save()
```
But that is very slow | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1865/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1865/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1864 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1864/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1864/comments | https://api.github.com/repos/coleifer/peewee/issues/1864/events | https://github.com/coleifer/peewee/issues/1864 | 412,382,656 | MDU6SXNzdWU0MTIzODI2NTY= | 1,864 | UnboundLocalError when doing join().join_from() | {
"login": "Defman21",
"id": 7100645,
"node_id": "MDQ6VXNlcjcxMDA2NDU=",
"avatar_url": "https://avatars.githubusercontent.com/u/7100645?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Defman21",
"html_url": "https://github.com/Defman21",
"followers_url": "https://api.github.com/users/Defma... | [] | closed | false | null | [] | null | [
"Nevermind, I made a mistake in my code and `ModelAModelB` was not `ModelAModelB`."
] | 2019-02-20T11:40:16 | 2019-02-20T14:05:09 | 2019-02-20T14:05:09 | NONE | null | I have a query that looks like this:
```
ModelAModelB
.select(ModelA, ModelB)
.join(ModelC, on=(ModelC.some_field == ModelAModelB.some_field))
.join_from(ModelAModelB, ModelA) # Exception occurs on this line
.join_from(ModelAModelB, ModelB)
```
For some reason, today I got an error:
```
2019-02-20T11:... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1864/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1864/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1863 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1863/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1863/comments | https://api.github.com/repos/coleifer/peewee/issues/1863/events | https://github.com/coleifer/peewee/issues/1863 | 411,606,754 | MDU6SXNzdWU0MTE2MDY3NTQ= | 1,863 | TypeError: type str doesn't define __round__ method | {
"login": "faulander",
"id": 38588197,
"node_id": "MDQ6VXNlcjM4NTg4MTk3",
"avatar_url": "https://avatars.githubusercontent.com/u/38588197?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/faulander",
"html_url": "https://github.com/faulander",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"The error occurs because you're passing a string as the value of a `TimestampField`. I'm not sure where your data is coming from or what form it is in, but you should probably convert it to either a python `datetime.datetime` object or an integer/float timestamp."
] | 2019-02-18T18:53:16 | 2019-02-18T19:02:03 | 2019-02-18T19:02:02 | NONE | null | Class Definition:
```
class Update(Model):
date = TimestampField()
model = TextField()
provider = TextField()
title = TextField()
filename = TextField()
collected = BooleanField()
class Meta:
database = db
```
Call:
```
Update.get_or_create(
date=up['date'], ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1863/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1863/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1862 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1862/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1862/comments | https://api.github.com/repos/coleifer/peewee/issues/1862/events | https://github.com/coleifer/peewee/issues/1862 | 411,560,674 | MDU6SXNzdWU0MTE1NjA2NzQ= | 1,862 | KeyError / AttributeError | {
"login": "databe",
"id": 10868706,
"node_id": "MDQ6VXNlcjEwODY4NzA2",
"avatar_url": "https://avatars.githubusercontent.com/u/10868706?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/databe",
"html_url": "https://github.com/databe",
"followers_url": "https://api.github.com/users/databe/fo... | [] | closed | false | null | [] | null | [
"You're using \"colon\" to separate the parameters? Is this just a typo in the code you've provided? You need equals signs.\r\n\r\nYour code:\r\n\r\n```python\r\nclass Driver(Model):\r\n SiteId: BigIntegerField(null=True)\r\n DriverId: IntegerField(null=False)\r\n```\r\n\r\nCorrect code:\r\n\r\n```python\r\nc... | 2019-02-18T16:34:45 | 2019-02-18T16:58:23 | 2019-02-18T16:44:54 | NONE | null | Hi, I'm using peewee because I'm retrieving data from an API and want to put it into a postgres database. First I tried with 'create()', 'insert()' and 'get_or_create()' and everything worked fine. But now I'm working with a biggest data table and I have to work with 'insert_many()'. Appart of that function, the rest o... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1862/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1862/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1861 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1861/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1861/comments | https://api.github.com/repos/coleifer/peewee/issues/1861/events | https://github.com/coleifer/peewee/issues/1861 | 411,203,880 | MDU6SXNzdWU0MTEyMDM4ODA= | 1,861 | 0.5 second connection overhead | {
"login": "willgdjones",
"id": 1719848,
"node_id": "MDQ6VXNlcjE3MTk4NDg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1719848?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/willgdjones",
"html_url": "https://github.com/willgdjones",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Your snippet is opening and closing a database connection at every request. There is an overhead time built into it (You can't escape it). Maybe you should consider altering the way in which you manage connections. Something like:\r\n\r\nOpen a connection at startup.\r\n\r\nOn `@app.before_request` verify that the... | 2019-02-17T16:10:20 | 2019-02-18T12:32:40 | 2019-02-17T17:25:18 | NONE | null | I'm having some issues with my connection requests ever since I have followed the best practices defined in the docs:
Code in docs:
```
from flask import Flask
from peewee import *
database = SqliteDatabase('my_app.db')
app = Flask(__name__)
# This hook ensures that a connection is opened to handle any que... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1861/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1861/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1860 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1860/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1860/comments | https://api.github.com/repos/coleifer/peewee/issues/1860/events | https://github.com/coleifer/peewee/issues/1860 | 411,130,967 | MDU6SXNzdWU0MTExMzA5Njc= | 1,860 | PostgreSQL support for on_conflict with partial indexes | {
"login": "iamyohann",
"id": 1330242,
"node_id": "MDQ6VXNlcjEzMzAyNDI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1330242?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/iamyohann",
"html_url": "https://github.com/iamyohann",
"followers_url": "https://api.github.com/users/ia... | [] | closed | false | null | [] | null | [
"Yes you're right, I didn't think about partial indexes when designing the API. To fix this, I've added a new parameter, `conflict_where`, which should take the expression(s) that comprise the WHERE clause of the partial index.",
"That was quick! Cheers",
"@coleifer \r\nIs there a way to ignore duplicates that ... | 2019-02-17T00:24:57 | 2021-07-02T13:00:26 | 2019-02-17T21:10:20 | NONE | null | I'm attempting to upsert multiple records into a PostgreSQL table containing a partial index.
The insert statement looks something like this in plain SQL
```
INSERT INTO abc (a, b, c, value1, value2) VALUES (1, 1, null, '0.2'::numeric, '0.02'::numeric)
ON CONFLICT (b, c) where a is null
DO UPDATE
SET value1 =... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1860/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1860/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1859 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1859/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1859/comments | https://api.github.com/repos/coleifer/peewee/issues/1859/events | https://github.com/coleifer/peewee/issues/1859 | 411,101,597 | MDU6SXNzdWU0MTExMDE1OTc= | 1,859 | Isssue with varchar fiels in postgres | {
"login": "dorel14",
"id": 10910133,
"node_id": "MDQ6VXNlcjEwOTEwMTMz",
"avatar_url": "https://avatars.githubusercontent.com/u/10910133?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dorel14",
"html_url": "https://github.com/dorel14",
"followers_url": "https://api.github.com/users/dorel1... | [] | closed | false | null | [] | null | [
"That doesn't make any sense to me. Peewee doesn't automatically convert anything to ArrayField. People use their model classes with both SQLite and Postgres (ie Sqlite for tests, Postgres for production), and I've never heard of such an issue.\r\n\r\nIf you can provide instructions on how to reproduce this, I'll t... | 2019-02-16T18:59:03 | 2019-02-16T23:08:32 | 2019-02-16T21:37:07 | NONE | null | Hello
I change my database from sqlite to postgres and varchar column are converted in array fields so all the new text i insert are embraced with brackets
How can i deactivate this ?
THX | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1859/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1859/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1858 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1858/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1858/comments | https://api.github.com/repos/coleifer/peewee/issues/1858/events | https://github.com/coleifer/peewee/issues/1858 | 410,941,270 | MDU6SXNzdWU0MTA5NDEyNzA= | 1,858 | For Update in Subquery Fails with PostgreSQL | {
"login": "href",
"id": 273163,
"node_id": "MDQ6VXNlcjI3MzE2Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/273163?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/href",
"html_url": "https://github.com/href",
"followers_url": "https://api.github.com/users/href/followers",
... | [] | closed | false | null | [] | null | [
"Well, the reason your specific example is bad is because you need to associate `User` model with a Postgres database instance. But the error is the same even after adding the database, just for different reasons. Fixed.",
"Thanks for fixing this so super quickly 🙂"
] | 2019-02-15T20:58:06 | 2019-02-15T22:02:19 | 2019-02-15T21:21:17 | NONE | null | I'm trying to use SELECT .. FOR UPDATE SKIP LOCKED in a subquery to delete some records concurrently, and I think I stumbled upon a bug. Usually, my FOR UPDATE selects work fine in my Postgres Database, but this query cannot be rendered by Peewee.
When I run this example code:
```python
from peewee import Model
f... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1858/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1858/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1857 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1857/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1857/comments | https://api.github.com/repos/coleifer/peewee/issues/1857/events | https://github.com/coleifer/peewee/issues/1857 | 410,856,608 | MDU6SXNzdWU0MTA4NTY2MDg= | 1,857 | save_optimistic misbehaving when foreign key is assigned before saved | {
"login": "NicolasCaous",
"id": 24411365,
"node_id": "MDQ6VXNlcjI0NDExMzY1",
"avatar_url": "https://avatars.githubusercontent.com/u/24411365?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/NicolasCaous",
"html_url": "https://github.com/NicolasCaous",
"followers_url": "https://api.github.c... | [] | closed | false | null | [] | null | [
"Well, for what its worth, this seems like a very silly and inefficient way to use Peewee... As you are essentially doing two INSERTs and an UPDATE when you only need to be doing two INSERTs. I'd suggest that the right way would be to first create the `Phone` object, then to create the `Person`...not creating the `... | 2019-02-15T16:52:03 | 2019-02-15T19:06:37 | 2019-02-15T18:49:24 | NONE | null | I'm not sure if this is intended behavior or a valid issue. @coleifer please help :)
# The Issue
Assume [Optimistic Locking](http://docs.peewee-orm.com/en/3.6.0/peewee/hacks.html#optimistic-locking) is in place as in the docs
When a foreign key is assigned before it exists on the database, it results in a None... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1857/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1857/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1856 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1856/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1856/comments | https://api.github.com/repos/coleifer/peewee/issues/1856/events | https://github.com/coleifer/peewee/issues/1856 | 410,854,847 | MDU6SXNzdWU0MTA4NTQ4NDc= | 1,856 | Passing single model to bind_ctx causes uninitialized Proxy error | {
"login": "MushuEE",
"id": 7189267,
"node_id": "MDQ6VXNlcjcxODkyNjc=",
"avatar_url": "https://avatars.githubusercontent.com/u/7189267?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MushuEE",
"html_url": "https://github.com/MushuEE",
"followers_url": "https://api.github.com/users/MushuEE/... | [] | closed | false | null | [] | null | [
"`(Testbed)` is not a tuple.\r\n\r\n`(Testbed,)` is a tuple.\r\n\r\nThis is your problem.",
"Yes, I mentioned that, I opened because the Error message received was misleading. Hopefully others might find this helpful if they hit the same issue, thanks."
] | 2019-02-15T16:47:53 | 2019-02-15T18:13:21 | 2019-02-15T18:09:04 | NONE | null | I was trying to make a fixture to do some unit testing for my Peewee methods when I hit this issue:
```
@pytest.fixture()
def test_db():
"""Test to check db."""
_db = SqliteDatabase(":memory:")
dbs = (Testbed)
with _db.bind_ctx(dbs):
_db.create_tables(dbs)
yield _db
_db... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1856/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1856/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1855 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1855/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1855/comments | https://api.github.com/repos/coleifer/peewee/issues/1855/events | https://github.com/coleifer/peewee/issues/1855 | 409,473,029 | MDU6SXNzdWU0MDk0NzMwMjk= | 1,855 | Bulk Upsert | {
"login": "takehaya",
"id": 10973623,
"node_id": "MDQ6VXNlcjEwOTczNjIz",
"avatar_url": "https://avatars.githubusercontent.com/u/10973623?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/takehaya",
"html_url": "https://github.com/takehaya",
"followers_url": "https://api.github.com/users/tak... | [] | closed | false | null | [] | null | [
"Questions like this belong on StackOverflow.\r\n\r\nThe documentation in peewee:\r\n\r\n* http://docs.peewee-orm.com/en/latest/peewee/querying.html#upsert\r\n* http://docs.peewee-orm.com/en/latest/peewee/api.html#Insert.on_conflict\r\n\r\nConsult the manual for the SQL database you are using to get a better idea o... | 2019-02-12T19:54:48 | 2019-02-13T13:02:17 | 2019-02-12T20:58:28 | NONE | null | hi. I want to use update and preserve with bulk upsert.
I would like to run the following code. How should I do?
```
Book.insert_many(books).on_conflict(preserve=[Book.disposal], update=books).execute()
``` | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1855/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1855/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1854 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1854/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1854/comments | https://api.github.com/repos/coleifer/peewee/issues/1854/events | https://github.com/coleifer/peewee/issues/1854 | 409,414,408 | MDU6SXNzdWU0MDk0MTQ0MDg= | 1,854 | UNION query is not using parenthesis | {
"login": "Polsaker",
"id": 2000719,
"node_id": "MDQ6VXNlcjIwMDA3MTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/2000719?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Polsaker",
"html_url": "https://github.com/Polsaker",
"followers_url": "https://api.github.com/users/Polsa... | [] | closed | false | null | [] | null | [
"So the issue (I didn't realize this, just saw it in [the mysql docs](https://dev.mysql.com/doc/refman/8.0/en/union.html)) is that MySQL wants parentheses when either of the subqueries contains an order by clause.\r\n\r\nIn the meantime, is it possible for you to avoid ordering the subqueries, and simply apply the ... | 2019-02-12T17:27:06 | 2019-09-17T02:40:23 | 2019-02-12T20:56:32 | NONE | null | Hello, I'm doing the following query (on mysql):
```
s1 = SiteLog.select(SiteLog.time).order_by(SiteLog.time.desc())
s2 = SubLog.select(SubLog.time).order_by(SubLog.time.desc())
final = (s1 | s2)
```
and the sql result is
```
SELECT `t1`.`time` FROM `site_log` AS `t1` ORDER BY `t1`.`time` DESC... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1854/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1854/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1853 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1853/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1853/comments | https://api.github.com/repos/coleifer/peewee/issues/1853/events | https://github.com/coleifer/peewee/issues/1853 | 409,327,080 | MDU6SXNzdWU0MDkzMjcwODA= | 1,853 | v3 multiple databases support | {
"login": "tyfncn",
"id": 5200913,
"node_id": "MDQ6VXNlcjUyMDA5MTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/5200913?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tyfncn",
"html_url": "https://github.com/tyfncn",
"followers_url": "https://api.github.com/users/tyfncn/foll... | [] | closed | false | null | [] | null | [
"Yes, you can use `database.bind_ctx()`, or `Model.bind_ctx()`:\r\n\r\n* http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.bind_ctx\r\n* http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.bind_ctx"
] | 2019-02-12T14:28:45 | 2019-02-12T17:24:30 | 2019-02-12T17:24:30 | NONE | null | First thank you for such a great software. I've been using it for almost 3 years now. My issue is missing "Using()" context manager. It was very useful while backing up to a new sqlite database of same models. It seems it is deprecated in v3. Is there any replacement for this?
Old docs was here: http://docs.peewee-or... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1853/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1853/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1852 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1852/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1852/comments | https://api.github.com/repos/coleifer/peewee/issues/1852/events | https://github.com/coleifer/peewee/issues/1852 | 409,151,329 | MDU6SXNzdWU0MDkxNTEzMjk= | 1,852 | Avoid quoting of table/column names | {
"login": "ananis25",
"id": 16446513,
"node_id": "MDQ6VXNlcjE2NDQ2NTEz",
"avatar_url": "https://avatars.githubusercontent.com/u/16446513?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ananis25",
"html_url": "https://github.com/ananis25",
"followers_url": "https://api.github.com/users/ana... | [] | closed | false | null | [] | null | [
"Just saw this 5ff2d8a where @coleifer moved from a tuple of characters to strings, so clearly Cython must provide speedup better than 50 p/c. \r\n\r\nDo you think it'd still be useful to allow a tuple for the above use-case?\r\n\r\nInternet also helped me with a simple way to get around this, so the cython method ... | 2019-02-12T07:07:45 | 2019-02-13T14:05:43 | 2019-02-12T18:10:37 | NONE | null | I couldn't quite figure how to create table and column names without quote characters. Needed since I haven't created the SQL tables I'm reading from. Is there a way to achieve this without monkey patching?
Suggestion:
A possible way to do this could be to use a modified Database class with quote variable set to a ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1852/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1852/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1851 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1851/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1851/comments | https://api.github.com/repos/coleifer/peewee/issues/1851/events | https://github.com/coleifer/peewee/issues/1851 | 408,803,896 | MDU6SXNzdWU0MDg4MDM4OTY= | 1,851 | Field class doesn't have an `index_type` attribute | {
"login": "ananis25",
"id": 16446513,
"node_id": "MDQ6VXNlcjE2NDQ2NTEz",
"avatar_url": "https://avatars.githubusercontent.com/u/16446513?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ananis25",
"html_url": "https://github.com/ananis25",
"followers_url": "https://api.github.com/users/ana... | [] | closed | false | null | [] | null | [
"This is only used internally by some special fields in the `playhouse.postgres_ext` module. However you *can* specify a custom index type via the `using=` parameter of `ModelIndex`:\r\n\r\n```python\r\nclass Table(Model):\r\n timestamp = DateTimeField()\r\n\r\nTable.add_index(Table.index('timestamp', using='BRI... | 2019-02-11T14:20:52 | 2019-02-12T03:26:03 | 2019-02-11T21:52:56 | NONE | null | The ModelIndex class looks for the index_type argument in the definition of a Field when creating an index for it, but it is not defined as an attribute for the Field class.
```
class ModelIndex(Index):
def __init__(self, model, fields, unique=False, safe=True, where=None,
using=None, name=No... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1851/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1851/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1850 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1850/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1850/comments | https://api.github.com/repos/coleifer/peewee/issues/1850/events | https://github.com/coleifer/peewee/issues/1850 | 408,502,553 | MDU6SXNzdWU0MDg1MDI1NTM= | 1,850 | Add support for column name option in ForeignKeyField | {
"login": "michaellzc",
"id": 8373004,
"node_id": "MDQ6VXNlcjgzNzMwMDQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/8373004?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/michaellzc",
"html_url": "https://github.com/michaellzc",
"followers_url": "https://api.github.com/users... | [] | closed | false | null | [] | null | [
"ForeignKeyField *does* support `column_name`. What are you talking about?"
] | 2019-02-10T05:22:08 | 2019-02-10T16:52:18 | 2019-02-10T16:52:18 | NONE | null | ```py
class User(Model):
user_id = IntegerField(primary_key=true)
class Tweet(Model):
tweet_id = IntegerField(primary_key=true)
reply_to = ForeignKeyField('self') # Reference to itself
```
Current behaviour of the above snippet will automatically change column name of `reply_to` to `reply_to_id`. AFAIK `For... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1850/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1850/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1849 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1849/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1849/comments | https://api.github.com/repos/coleifer/peewee/issues/1849/events | https://github.com/coleifer/peewee/pull/1849 | 408,415,599 | MDExOlB1bGxSZXF1ZXN0MjUxNjY0MzAw | 1,849 | [docs]fix optimistic locking document in hacks.rst | {
"login": "ymym3412",
"id": 9605058,
"node_id": "MDQ6VXNlcjk2MDUwNTg=",
"avatar_url": "https://avatars.githubusercontent.com/u/9605058?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ymym3412",
"html_url": "https://github.com/ymym3412",
"followers_url": "https://api.github.com/users/ymym3... | [] | closed | false | null | [] | null | [] | 2019-02-09T09:37:57 | 2019-02-15T02:28:23 | 2019-02-10T16:55:35 | CONTRIBUTOR | null | In peewee3, Model class has no attribute `_dict` , but has `__dict__` .
And in hack.rst, there is no definition of `ConflictDetectedException` .
Reffered to this blog post.
http://charlesleifer.com/blog/optimistic-locking-in-peewee-orm/
Thx. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1849/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1849/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1849",
"html_url": "https://github.com/coleifer/peewee/pull/1849",
"diff_url": "https://github.com/coleifer/peewee/pull/1849.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1849.patch",
"merged_at": "2019-02-10T16:55:35"
} |
https://api.github.com/repos/coleifer/peewee/issues/1848 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1848/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1848/comments | https://api.github.com/repos/coleifer/peewee/issues/1848/events | https://github.com/coleifer/peewee/issues/1848 | 408,244,925 | MDU6SXNzdWU0MDgyNDQ5MjU= | 1,848 | Map result of raw query to a model | {
"login": "IvaYan",
"id": 2164810,
"node_id": "MDQ6VXNlcjIxNjQ4MTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/2164810?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/IvaYan",
"html_url": "https://github.com/IvaYan",
"followers_url": "https://api.github.com/users/IvaYan/foll... | [] | closed | false | null | [] | null | [
"In that case you can do:\r\n\r\n```python\r\nresult = MyModel.raw('SELECT value1, value2 FROM ...')\r\nfor m in result:\r\n print(m.value1, m.value2)\r\n```"
] | 2019-02-08T17:12:29 | 2019-02-08T17:52:02 | 2019-02-08T17:52:02 | NONE | null | Hello!
Is it possible to map result of a raw query to a particular Model, assuming that I know the structure of the values returned by the query? Something like this:
```py
class MyModel(Model):
# declare fields here, as usual
value1 = peewee.IntegerField()
value2 = peewee.IntegerField()
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1848/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1848/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1847 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1847/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1847/comments | https://api.github.com/repos/coleifer/peewee/issues/1847/events | https://github.com/coleifer/peewee/issues/1847 | 408,054,759 | MDU6SXNzdWU0MDgwNTQ3NTk= | 1,847 | Support for different blob types in mysql | {
"login": "maxnoe",
"id": 5488440,
"node_id": "MDQ6VXNlcjU0ODg0NDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/5488440?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/maxnoe",
"html_url": "https://github.com/maxnoe",
"followers_url": "https://api.github.com/users/maxnoe/foll... | [] | closed | false | null | [] | null | [
"Just subclass and specify the data-storage class:\r\n\r\n```python\r\nclass LongBlogField(BlobField):\r\n field_type = 'LONGBLOB'\r\n```",
"This is not compatible with using a proxy that can either be a sqlite or mysql, as sqlite has no longblob type, or am I mistaken?",
"https://www.sqlite.org/datatype3.ht... | 2019-02-08T08:43:08 | 2019-02-08T17:51:24 | 2019-02-08T16:04:33 | NONE | null | I would need to store some binary data larger then 65kb in a mysql database.
peewee only seems to support one `BlobField`, which maps to mysqls `blob` which is max 65kb.
How can I make sure, the table is created with a `MEDBLOB` or `LONGBLOB` datatype while also maintaining sqlite compatiblity for local testing? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1847/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1847/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1846 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1846/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1846/comments | https://api.github.com/repos/coleifer/peewee/issues/1846/events | https://github.com/coleifer/peewee/issues/1846 | 408,007,557 | MDU6SXNzdWU0MDgwMDc1NTc= | 1,846 | readonly field support | {
"login": "SteveByerly",
"id": 1393464,
"node_id": "MDQ6VXNlcjEzOTM0NjQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/1393464?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SteveByerly",
"html_url": "https://github.com/SteveByerly",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"Not exactly answering the issue, but rather than use `bulk_create()` why not just use `insert_many()`?",
"I tend to prefer creating the instances of my objects directly. It's easier for me to see which object I'm creating and see that I'm assigning values properly. I also find this method a bit easier to search ... | 2019-02-08T05:04:57 | 2019-02-20T20:00:31 | 2019-02-20T20:00:31 | NONE | null | I created a `BaseTrackingModel` to capture some tracking data on insert/update.
```python
class BaseTrackingModel(BaseModel):
created_at = DateTimeField(null=False, constraints=[SQL('DEFAULT CURRENT_TIMESTAMP')])
updated_at = DateTimeField(null=True, constraints=[SQL('ON UPDATE CURRENT_TIMESTAMP')])
```
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1846/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1846/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1845 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1845/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1845/comments | https://api.github.com/repos/coleifer/peewee/issues/1845/events | https://github.com/coleifer/peewee/issues/1845 | 407,211,453 | MDU6SXNzdWU0MDcyMTE0NTM= | 1,845 | Get timestamp from database as int | {
"login": "jansedlon",
"id": 13948180,
"node_id": "MDQ6VXNlcjEzOTQ4MTgw",
"avatar_url": "https://avatars.githubusercontent.com/u/13948180?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jansedlon",
"html_url": "https://github.com/jansedlon",
"followers_url": "https://api.github.com/users/... | [] | closed | false | null | [] | null | [
"So you should:\r\n\r\n* Use `DateTimeField` if you want to work with `datetime` in python and store the data using the `datetime` data-type in your sql db.\r\n* Use `TimestampField` if you want to work with `datetime` in python and store the data using an integer in your sql db.\r\n* Use `IntegerField` if you want... | 2019-02-06T12:25:54 | 2019-02-06T15:18:28 | 2019-02-06T15:18:28 | NONE | null | I have a column of type Timestamp (or DateTime). If I save it to database, it's saved as integer, but when I want to get it from the database, it's returned as datetime. Is there any way to get it as it is in the database (integer) ? | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1845/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1845/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1844 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1844/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1844/comments | https://api.github.com/repos/coleifer/peewee/issues/1844/events | https://github.com/coleifer/peewee/issues/1844 | 406,665,304 | MDU6SXNzdWU0MDY2NjUzMDQ= | 1,844 | Expose serialization options in sqlite_ext.JSONField (or use better defaults) | {
"login": "zmwangx",
"id": 4149852,
"node_id": "MDQ6VXNlcjQxNDk4NTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/4149852?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zmwangx",
"html_url": "https://github.com/zmwangx",
"followers_url": "https://api.github.com/users/zmwangx/... | [] | closed | false | null | [] | null | [
"The `sqlite_ext.JSONField` relies on SQLite's `json1` extension. We convert Python data-types to JSON strings, but it's up to sqlite to parse, validate and then store the resulting JSON data. Sqlite efficiently stores this, so there's nothing to worry about:\r\n\r\n```\r\nsqlite> create table foo (data json);\r\ns... | 2019-02-05T07:52:52 | 2022-11-09T13:58:42 | 2019-02-05T18:16:54 | CONTRIBUTOR | null | Currently, `sqlite_ext.py` seems to use `json.dumps` without any options, which means the defaults `separators=(', ', ': ')` and `ensure_ascii=True` are assumed. These are a waste of space, and `ensure_ascii` also reduces human readability of non-ASCII text without real world benefit (since SQLite is Unicode-safe).
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1844/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1844/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1843 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1843/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1843/comments | https://api.github.com/repos/coleifer/peewee/issues/1843/events | https://github.com/coleifer/peewee/pull/1843 | 406,338,175 | MDExOlB1bGxSZXF1ZXN0MjUwMDU3ODgw | 1,843 | Implement connection_connection for Proxy, fixes #1842 | {
"login": "maxnoe",
"id": 5488440,
"node_id": "MDQ6VXNlcjU0ODg0NDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/5488440?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/maxnoe",
"html_url": "https://github.com/maxnoe",
"followers_url": "https://api.github.com/users/maxnoe/foll... | [] | closed | false | null | [] | null | [
"Implementation in 91f18c6, as described in #1842."
] | 2019-02-04T13:50:28 | 2019-02-04T15:11:11 | 2019-02-04T15:11:11 | NONE | null | A fix for #1842, also adding a test case | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1843/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1843/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1843",
"html_url": "https://github.com/coleifer/peewee/pull/1843",
"diff_url": "https://github.com/coleifer/peewee/pull/1843.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1843.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1842 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1842/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1842/comments | https://api.github.com/repos/coleifer/peewee/issues/1842/events | https://github.com/coleifer/peewee/issues/1842 | 406,327,877 | MDU6SXNzdWU0MDYzMjc4Nzc= | 1,842 | Cannot use Proxy connection_context decorator. | {
"login": "maxnoe",
"id": 5488440,
"node_id": "MDQ6VXNlcjU0ODg0NDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/5488440?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/maxnoe",
"html_url": "https://github.com/maxnoe",
"followers_url": "https://api.github.com/users/maxnoe/foll... | [] | closed | false | null | [] | null | [
"While `Proxy` is primarily indicated for use with deferred database objects, it is in a sense a general abstraction. Adding such a method to `Proxy` produces a bit more tight-coupling to `Database`, which I'd prefer to avoid.\r\n\r\nThe issue is that `database.connection_context()` is evaluated as an import-time s... | 2019-02-04T13:24:19 | 2019-02-04T15:10:44 | 2019-02-04T15:10:44 | NONE | null | Defining methods or functions with the `connection_context` decorator does not work with Proxies.
It throws `AttributeError: Cannot use uninitialized Proxy`.
Although I see no reason, why this should be necessary at definition time.
```python
from peewee import Proxy, Model, TextField
database = Proxy()
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1842/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1842/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1841 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1841/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1841/comments | https://api.github.com/repos/coleifer/peewee/issues/1841/events | https://github.com/coleifer/peewee/issues/1841 | 406,110,357 | MDU6SXNzdWU0MDYxMTAzNTc= | 1,841 | WHERE TRUE condition | {
"login": "againagainst",
"id": 654455,
"node_id": "MDQ6VXNlcjY1NDQ1NQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/654455?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/againagainst",
"html_url": "https://github.com/againagainst",
"followers_url": "https://api.github.com/u... | [] | closed | false | null | [] | null | [
"Eh, you can do `Value(1) == Value(1)`...but the way I would handle that is to accumulate a list and then use `reduce`, e.g.:\r\n\r\n```python\r\nfrom functools import reduce\r\nimport operator\r\n\r\n# ...\r\n\r\nexpr_list = []\r\nif removed:\r\n expr_list.append(User.removed.is_null(False))\r\nif deactived:\r\... | 2019-02-03T17:28:20 | 2019-02-04T01:54:19 | 2019-02-04T01:54:19 | NONE | null | Is there any possibility to make the simple `TRUE` condition for where clause? I would like to use it as an initial condition and combine with some extra conditions if necessary:
```
def get_users(self, removed=False, deactivated=False):
cond = Model.TRUE
if removed:
cond &= ~(Users... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1841/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1841/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1840 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1840/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1840/comments | https://api.github.com/repos/coleifer/peewee/issues/1840/events | https://github.com/coleifer/peewee/issues/1840 | 405,183,585 | MDU6SXNzdWU0MDUxODM1ODU= | 1,840 | LEFT OUTER JOIN not match item exception | {
"login": "serkandaglioglu",
"id": 1669906,
"node_id": "MDQ6VXNlcjE2Njk5MDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1669906?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/serkandaglioglu",
"html_url": "https://github.com/serkandaglioglu",
"followers_url": "https://api.g... | [] | closed | false | null | [] | null | [
"It's joining on the company quota id field. Please share your model definitions, as I can't tell what \"intern_request\" is, and how it may differ from the company_quota_id field.",
"```\r\nclass AppInternRequest(BaseModel):\r\n\tid = AutoField()\r\n\r\n\tschool = ForeignKeyField(AppSchool,column_name=\"school_i... | 2019-01-31T10:42:26 | 2019-01-31T21:22:26 | 2019-01-31T15:41:28 | NONE | null | I use JOIN.LEFT_OUTER in my query. When I print x.intern_request I see two runned query in debug console.
**My Query**
```
items = (AppInternPreference
.select(AppInternPreference, AppInternRequest)
.join(AppInternRequest, peewee.JOIN.LEFT_OUTER)
)
for x in items:
print x.intern_r... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1840/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1840/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1839 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1839/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1839/comments | https://api.github.com/repos/coleifer/peewee/issues/1839/events | https://github.com/coleifer/peewee/pull/1839 | 404,870,668 | MDExOlB1bGxSZXF1ZXN0MjQ4OTU1Mzk2 | 1,839 | Add support for subselects with CTEs. | {
"login": "iksteen",
"id": 1001206,
"node_id": "MDQ6VXNlcjEwMDEyMDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1001206?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/iksteen",
"html_url": "https://github.com/iksteen",
"followers_url": "https://api.github.com/users/iksteen/... | [] | closed | false | null | [] | null | [
"I've merged an equivalent patch, which expands on your own and adds comments and test-cases: 6707199769e0f8878988242bca347f577e3f0e7b\r\n\r\nThank you very much for digging into this and finding such a concise solution."
] | 2019-01-30T17:04:23 | 2019-01-30T18:25:02 | 2019-01-30T18:25:02 | NONE | null | By delaying the emission of CTEs and emitting them in the subquery's context, they are contained within its surrouding parentheses. To avoid adding extra parentheses to the CTE queries, force the context for the CTE list to not have the subquery flag.
This fixes #1809. | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1839/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1839/timeline | null | null | false | {
"url": "https://api.github.com/repos/coleifer/peewee/pulls/1839",
"html_url": "https://github.com/coleifer/peewee/pull/1839",
"diff_url": "https://github.com/coleifer/peewee/pull/1839.diff",
"patch_url": "https://github.com/coleifer/peewee/pull/1839.patch",
"merged_at": null
} |
https://api.github.com/repos/coleifer/peewee/issues/1838 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1838/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1838/comments | https://api.github.com/repos/coleifer/peewee/issues/1838/events | https://github.com/coleifer/peewee/issues/1838 | 404,392,846 | MDU6SXNzdWU0MDQzOTI4NDY= | 1,838 | Common Table Expression and prefetch | {
"login": "iksteen",
"id": 1001206,
"node_id": "MDQ6VXNlcjEwMDEyMDY=",
"avatar_url": "https://avatars.githubusercontent.com/u/1001206?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/iksteen",
"html_url": "https://github.com/iksteen",
"followers_url": "https://api.github.com/users/iksteen/... | [] | closed | false | null | [] | null | [
"This is probably a duplicate of #1809, but I'll leave it open for @coleifer to judge.",
"Thanks for reporting. Ive taken the description from this issue and added it as a comment to #1809. I'll deal with this as a single issue."
] | 2019-01-29T17:04:17 | 2019-01-29T20:22:03 | 2019-01-29T20:22:03 | NONE | null | Consider the following example (note that this is obviously a silly example, but just enough to show the problem):
```
from peewee import *
db = PostgresqlDatabase('scoreboard')
class Base(Model):
class Meta:
database = db
class Challenge(Base):
pass
class Attachment(Base):
challenge... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1838/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1838/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1837 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1837/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1837/comments | https://api.github.com/repos/coleifer/peewee/issues/1837/events | https://github.com/coleifer/peewee/issues/1837 | 403,573,052 | MDU6SXNzdWU0MDM1NzMwNTI= | 1,837 | PooledPostgresqlExtDatabase is imported as None | {
"login": "LearnedVector",
"id": 8495552,
"node_id": "MDQ6VXNlcjg0OTU1NTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/8495552?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LearnedVector",
"html_url": "https://github.com/LearnedVector",
"followers_url": "https://api.github.... | [] | closed | false | null | [] | null | [
"You need to install psycopg2.",
"awesome! thank you for the super fast response."
] | 2019-01-27T17:10:55 | 2019-01-27T17:23:27 | 2019-01-27T17:14:56 | NONE | null | ```python
from playhouse.pool import PooledPostgresqlExtDatabase
print(PooledPostgresqlDatabase) # returns None
```
digging into the code it looks like there is an import error causing this. any idea why?
https://github.com/coleifer/peewee/blob/master/playhouse/pool.py#L282
| {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1837/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1837/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1836 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1836/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1836/comments | https://api.github.com/repos/coleifer/peewee/issues/1836/events | https://github.com/coleifer/peewee/issues/1836 | 403,566,178 | MDU6SXNzdWU0MDM1NjYxNzg= | 1,836 | select from multiple subqueries | {
"login": "michalchrzastek",
"id": 38867528,
"node_id": "MDQ6VXNlcjM4ODY3NTI4",
"avatar_url": "https://avatars.githubusercontent.com/u/38867528?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/michalchrzastek",
"html_url": "https://github.com/michalchrzastek",
"followers_url": "https://api... | [] | closed | false | null | [] | null | [
"Your code is completely unreadable. Please reduce to a minimal, clear example if you think there is a bug.\r\n\r\nHowever this does not seem like a bug report, but rather like a question. In that case, the proper place to post is StackOverflow or you can try asking in the IRC channel (peewee on freenode), or on th... | 2019-01-27T16:03:07 | 2019-01-31T17:33:59 | 2019-01-27T16:40:05 | NONE | null | Hi, trying to combine multiple subqueries into one, but can't see any guide for this, can you advise please.
```
SELECT q5.grpby,
q5.cat AS category,
q5.sumallmonths AS total,
q4.avg12month AS avg12mnt,
FROM (
SELECT tag_list."groupName" AS cat,
tag_list."tagGroup" AS grpby,
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1836/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1836/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1835 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1835/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1835/comments | https://api.github.com/repos/coleifer/peewee/issues/1835/events | https://github.com/coleifer/peewee/issues/1835 | 403,482,195 | MDU6SXNzdWU0MDM0ODIxOTU= | 1,835 | Model.get() method fails silently | {
"login": "arel",
"id": 153497,
"node_id": "MDQ6VXNlcjE1MzQ5Nw==",
"avatar_url": "https://avatars.githubusercontent.com/u/153497?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arel",
"html_url": "https://github.com/arel",
"followers_url": "https://api.github.com/users/arel/followers",
... | [] | closed | false | null | [] | null | [
"This gets translated into:\r\n\r\n```sql\r\nselect * from image where 1442\r\n```\r\n\r\nSo the db interprets that, most likely, as simply `true` and returns the first row of this arbitrarily-large result set.\r\n\r\nI'm aware of this issue, but not positive about the best way to fix it. Python is highly dynamic, ... | 2019-01-26T20:53:18 | 2019-01-28T13:20:45 | 2019-01-27T14:17:10 | NONE | null | I came across a behavior with [`Model.get`](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.get) I found confusing and could be improved or at least better documented.
Calling `Model.get()` is a shorthand for "selecting with a limit of 1", which is clear. When you provide it filters, such as `.get(id=1442... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1835/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1835/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1834 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1834/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1834/comments | https://api.github.com/repos/coleifer/peewee/issues/1834/events | https://github.com/coleifer/peewee/issues/1834 | 401,512,324 | MDU6SXNzdWU0MDE1MTIzMjQ= | 1,834 | Mariadb 10.3.3+ change on values() function | {
"login": "altunyurt",
"id": 126674,
"node_id": "MDQ6VXNlcjEyNjY3NA==",
"avatar_url": "https://avatars.githubusercontent.com/u/126674?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/altunyurt",
"html_url": "https://github.com/altunyurt",
"followers_url": "https://api.github.com/users/altu... | [] | closed | false | null | [] | null | [
"Thanks for the heads-up. This looks like a pain.\r\n\r\n* MySQL uses VALUES: https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html\r\n* MariaDB's changes do not appear to be backwards-compatible: https://mariadb.com/kb/en/library/values-value/"
] | 2019-01-21T21:14:08 | 2019-01-22T01:10:21 | 2019-01-22T01:10:21 | NONE | null | This is more like a heads up! issue.
https://mariadb.com/kb/en/library/values-value/ states that
```
INSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)
ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);
```
should be written as
```
INSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)
ON DUPLICATE KEY UPDATE c=VALUE... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1834/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1834/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1833 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1833/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1833/comments | https://api.github.com/repos/coleifer/peewee/issues/1833/events | https://github.com/coleifer/peewee/issues/1833 | 399,576,409 | MDU6SXNzdWUzOTk1NzY0MDk= | 1,833 | Feature Request: Restore `Query` __repr__/__str__ functionality | {
"login": "ibushong",
"id": 9298422,
"node_id": "MDQ6VXNlcjkyOTg0MjI=",
"avatar_url": "https://avatars.githubusercontent.com/u/9298422?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ibushong",
"html_url": "https://github.com/ibushong",
"followers_url": "https://api.github.com/users/ibush... | [] | closed | false | null | [] | null | [
"That has been replaced by calling the `.sql()` method on a query."
] | 2019-01-15T23:09:19 | 2019-01-16T01:11:31 | 2019-01-16T01:11:31 | NONE | null | In peewee v2 it was convenient when debugging to print out the raw sql of a query with just `print query`, but in v3 this just gives the generic `<peewee.ModelSelect object at 0x10abce150>`. For now I've just added it to my base peewee model, leveraging `sql()`, but I think this might be a nice feature to add back in ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1833/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1833/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1832 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1832/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1832/comments | https://api.github.com/repos/coleifer/peewee/issues/1832/events | https://github.com/coleifer/peewee/issues/1832 | 399,569,209 | MDU6SXNzdWUzOTk1NjkyMDk= | 1,832 | When create_tables: OperationalError: near "AS": syntax error | {
"login": "rafaleo",
"id": 25869026,
"node_id": "MDQ6VXNlcjI1ODY5MDI2",
"avatar_url": "https://avatars.githubusercontent.com/u/25869026?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rafaleo",
"html_url": "https://github.com/rafaleo",
"followers_url": "https://api.github.com/users/rafale... | [] | closed | false | null | [] | null | [
"This class is there - it's not the case. It doesn't work even if I pass only [Student] table.\r\n```\r\nclass User(BaseModel):\r\n username = pw.CharField(unique=True)\r\n```",
"What tutorial are you referring to? Please share the link.\r\n\r\nThe problem is your usage of `IdentityField`. You are using a `Sql... | 2019-01-15T22:45:36 | 2019-01-15T22:55:06 | 2019-01-15T22:48:42 | NONE | null | Hi. I've just installed peewee for the first time and try to execute some example. Based on your tutorial one (which works) I've created this simple code:
```
import peewee as pw
db = pw.SqliteDatabase('my_students.db')
class BaseModel(pw.Model):
class Meta:
database = db
class Student(BaseMo... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1832/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1832/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1831 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1831/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1831/comments | https://api.github.com/repos/coleifer/peewee/issues/1831/events | https://github.com/coleifer/peewee/issues/1831 | 399,390,724 | MDU6SXNzdWUzOTkzOTA3MjQ= | 1,831 | postgresql: create doesn't support returning | {
"login": "james-lawrence",
"id": 2835871,
"node_id": "MDQ6VXNlcjI4MzU4NzE=",
"avatar_url": "https://avatars.githubusercontent.com/u/2835871?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/james-lawrence",
"html_url": "https://github.com/james-lawrence",
"followers_url": "https://api.gith... | [] | closed | false | null | [] | null | [
"I've discovered how to do it.... mainly by happenstance. but my original two issues still hold.\r\n\r\n```\r\nins = Example.insert(title = details.title).returning(Example).objects(Example).execute()\r\n```",
"Correct. `create()` is not intended to be used with `returning()` since the return value of `create()` ... | 2019-01-15T15:14:54 | 2019-01-15T18:49:14 | 2019-01-15T18:41:11 | CONTRIBUTOR | null | was attempting to insert records into the database and ran into this issue.
problem is two fold:
- create doesn't support returning afaik.
- documentation around returning is [rather sparse](http://docs.peewee-orm.com/en/latest/peewee/querying.html#returning-clause).
```python
m = Example.create(title = detai... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1831/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1831/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1830 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1830/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1830/comments | https://api.github.com/repos/coleifer/peewee/issues/1830/events | https://github.com/coleifer/peewee/issues/1830 | 399,230,734 | MDU6SXNzdWUzOTkyMzA3MzQ= | 1,830 | Does Peewee supports mysql Date() function? | {
"login": "littledemon",
"id": 6930793,
"node_id": "MDQ6VXNlcjY5MzA3OTM=",
"avatar_url": "https://avatars.githubusercontent.com/u/6930793?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/littledemon",
"html_url": "https://github.com/littledemon",
"followers_url": "https://api.github.com/us... | [] | closed | false | null | [] | null | [
"```python\r\nquery = (ShopTable\r\n .select(\r\n fn.DATE(ShopTable.mydate).alias('date_value'), \r\n fn.SUM(ShopTable.price).alias('price_sum'),\r\n ShopTable.username)\r\n .where(fn.DATE(ShopTable.mydate) > '2011-01-07')\r\n .group_by(fn.DATE(ShopTable.mydate), ShopTable.username))\r\n```"... | 2019-01-15T08:13:30 | 2019-01-15T17:24:39 | 2019-01-15T17:24:16 | NONE | null | I have below command :
```
SELECT Date(mydate),sum(price),username
from shop_table
where Date(mydate)>'2011-01-07'
GROUP BY Date(mydate),username
```
Because the dates include the time, I convert them into 'only date' using Date() function, so regardless of hours I can understand the total amount of sales... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1830/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1830/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1829 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1829/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1829/comments | https://api.github.com/repos/coleifer/peewee/issues/1829/events | https://github.com/coleifer/peewee/issues/1829 | 398,755,793 | MDU6SXNzdWUzOTg3NTU3OTM= | 1,829 | Issue with `Meta.table_alias` (or `Meta.alias`) | {
"login": "ibushong",
"id": 9298422,
"node_id": "MDQ6VXNlcjkyOTg0MjI=",
"avatar_url": "https://avatars.githubusercontent.com/u/9298422?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ibushong",
"html_url": "https://github.com/ibushong",
"followers_url": "https://api.github.com/users/ibush... | [] | closed | false | null | [] | null | [
"I ran into this issue with peewee 3.8.0/3.8.1. 3.7.1 (< 3.8.0) works as expected.",
"Thanks for reporting. I will look into this.",
"This seems like it will not be very easy to resolve, given the architecture of the query-builder and the way I've chosen to implement the current `table_alias` functionality.\r\n... | 2019-01-14T05:45:55 | 2019-01-16T13:43:20 | 2019-01-15T22:09:51 | NONE | null | I'm encountering this issue when trying to migrate from v2 to v3.
Let's say I have a DB table called `tag2` that I want to reference with a peewee model call `Tag`. If I set `Meta.table_name = 'tag2'`, everything works fine. But if I add `Meta.table_alias = 'tag_alias'`, then UPDATE queries come out like this:
```
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1829/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1829/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1828 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1828/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1828/comments | https://api.github.com/repos/coleifer/peewee/issues/1828/events | https://github.com/coleifer/peewee/issues/1828 | 398,599,726 | MDU6SXNzdWUzOTg1OTk3MjY= | 1,828 | Prefetch many to many fields | {
"login": "Behoston",
"id": 7823689,
"node_id": "MDQ6VXNlcjc4MjM2ODk=",
"avatar_url": "https://avatars.githubusercontent.com/u/7823689?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Behoston",
"html_url": "https://github.com/Behoston",
"followers_url": "https://api.github.com/users/Behos... | [] | closed | false | null | [] | null | [
"Because you're still going through the many-to-many accessor, you're incurring a query each time you list the tags.\r\n\r\nYou might check out the `prefetch` helper: http://docs.peewee-orm.com/en/latest/peewee/relationships.html#using-prefetch\r\n\r\nBut the problem is this is a relational database, and it doesn't... | 2019-01-12T22:51:04 | 2021-03-01T18:42:46 | 2019-01-13T15:35:00 | NONE | null | I have a problem with prefetching many-to-many field.
I want to Fetch FieldOfStudy with all tags. I found https://github.com/coleifer/peewee/issues/1707 but it's not applicable for my case. I want to have redy to use object.
My models:
```python
class Model(peewee.Model):
class Meta:
abstract = T... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1828/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1828/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1827 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1827/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1827/comments | https://api.github.com/repos/coleifer/peewee/issues/1827/events | https://github.com/coleifer/peewee/issues/1827 | 396,915,930 | MDU6SXNzdWUzOTY5MTU5MzA= | 1,827 | Window function in order_by causes syntax error | {
"login": "zmwangx",
"id": 4149852,
"node_id": "MDQ6VXNlcjQxNDk4NTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/4149852?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zmwangx",
"html_url": "https://github.com/zmwangx",
"followers_url": "https://api.github.com/users/zmwangx/... | [] | closed | false | null | [] | null | [
"Thanks for reporting. This should be fixed by 55f515b."
] | 2019-01-08T13:52:21 | 2019-01-10T21:17:52 | 2019-01-10T21:17:41 | CONTRIBUTOR | null | Consider the following simple example:
```py
import logging
import peewee
db = peewee.SqliteDatabase("/tmp/test.db")
class Transaction(peewee.Model):
user_id = peewee.IntegerField()
class Meta:
database = db
db.create_tables([Transaction], safe=True)
Transaction.insert_many(
dict... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1827/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1827/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1826 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1826/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1826/comments | https://api.github.com/repos/coleifer/peewee/issues/1826/events | https://github.com/coleifer/peewee/issues/1826 | 396,289,529 | MDU6SXNzdWUzOTYyODk1Mjk= | 1,826 | Bug in bm25 ranking function with more than one term | {
"login": "simonw",
"id": 9599,
"node_id": "MDQ6VXNlcjk1OTk=",
"avatar_url": "https://avatars.githubusercontent.com/u/9599?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/simonw",
"html_url": "https://github.com/simonw",
"followers_url": "https://api.github.com/users/simonw/followers",
... | [] | closed | false | null | [] | null | [
"I think the correct formula for that line is:\r\n\r\n x = X_O + ((i * term_count) + j) * 3\r\n\r\nIf I make that single line change to my example script I get the following output, which I think is correct:\r\n\r\n```\r\nsearch = dog cat\r\n============\r\n('both of them', 'both dog dog and cat here')\r\n[2, 2,... | 2019-01-06T20:04:37 | 2019-01-07T16:33:32 | 2019-01-07T16:08:54 | NONE | null | I think I've found a bug in the bm25 implementation:
https://github.com/coleifer/peewee/blob/a24b36da3a101458a854e6a4319f4bb8d8cb478f/playhouse/sqlite_ext.py#L1160-L1175
The specific problem is here:
https://github.com/coleifer/peewee/blob/a24b36da3a101458a854e6a4319f4bb8d8cb478f/playhouse/sqlite_ext.py#L1173-... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1826/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1826/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1825 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1825/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1825/comments | https://api.github.com/repos/coleifer/peewee/issues/1825/events | https://github.com/coleifer/peewee/issues/1825 | 396,097,318 | MDU6SXNzdWUzOTYwOTczMTg= | 1,825 | sqlite_ext.FTSModel: MATCH'ing a single column | {
"login": "zmwangx",
"id": 4149852,
"node_id": "MDQ6VXNlcjQxNDk4NTI=",
"avatar_url": "https://avatars.githubusercontent.com/u/4149852?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zmwangx",
"html_url": "https://github.com/zmwangx",
"followers_url": "https://api.github.com/users/zmwangx/... | [] | closed | false | null | [] | null | [
"Correct, one needed to use the `match()` helper. I've added a method to `SearchField` as you suggested.",
"Thanks for the quick fix!"
] | 2019-01-04T23:06:07 | 2019-01-05T14:31:01 | 2019-01-05T01:58:41 | CONTRIBUTOR | null | SQLite FTS allows MATCH'ing a single column instead of the full table. An example from https://www.sqlite.org/fts3.html:
```sql
-- Example schema
CREATE VIRTUAL TABLE mail USING fts3(subject, body);
-- Example table population
INSERT INTO mail(docid, subject, body) VALUES(1, 'software feedback', 'found it too ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1825/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1825/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1824 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1824/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1824/comments | https://api.github.com/repos/coleifer/peewee/issues/1824/events | https://github.com/coleifer/peewee/issues/1824 | 395,637,053 | MDU6SXNzdWUzOTU2MzcwNTM= | 1,824 | db_value() doesn't work fine as expected | {
"login": "handalin",
"id": 2045180,
"node_id": "MDQ6VXNlcjIwNDUxODA=",
"avatar_url": "https://avatars.githubusercontent.com/u/2045180?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/handalin",
"html_url": "https://github.com/handalin",
"followers_url": "https://api.github.com/users/handa... | [] | closed | false | null | [] | null | [
"I have no idea what \"refresh the page\" implies. If you can produce a test-case that replicates this I will re-open. At the moment my sense is that the problem is in your code somewhere."
] | 2019-01-03T16:26:27 | 2019-01-03T18:12:06 | 2019-01-03T18:12:06 | NONE | null | This is my DB configuration:
```
database = MySQLDatabase('creditCardManager',
**{
'host': 'localhost',
'password': 'xxx',
'user': 'yyy',
'use_unicode': True,
'charset': 'utf8',
'autorollback': True,
})
```
and I define an custom field:
```
cla... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1824/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1824/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1823 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1823/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1823/comments | https://api.github.com/repos/coleifer/peewee/issues/1823/events | https://github.com/coleifer/peewee/issues/1823 | 395,554,139 | MDU6SXNzdWUzOTU1NTQxMzk= | 1,823 | insert_many(), KeyError: '"-" is not a recognized field.' | {
"login": "michalchrzastek",
"id": 38867528,
"node_id": "MDQ6VXNlcjM4ODY3NTI4",
"avatar_url": "https://avatars.githubusercontent.com/u/38867528?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/michalchrzastek",
"html_url": "https://github.com/michalchrzastek",
"followers_url": "https://api... | [] | closed | false | null | [] | null | [
"You don't need to quote the values. Peewee creates a parameterized query and the driver will handle all that for you.",
"That's what I thought, so why this error:\r\n```\r\nraise KeyError('\"%s\" is not a recognized field.' % field)\r\nKeyError: '\"-\" is not a recognized field.'\r\n```",
"Perhaps the data you... | 2019-01-03T12:21:02 | 2019-01-03T19:34:47 | 2019-01-03T18:13:46 | NONE | null | Hello,
I'm trying to insert multiple rows, but get this error:
`KeyError: '"-" is not a recognized field.'`
I figured its the minus before the figures, I was able to go around it using concatenation:
`transAmnt = "'" + data[1] + "'"`
But then I get this error:
... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1823/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1823/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1822 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1822/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1822/comments | https://api.github.com/repos/coleifer/peewee/issues/1822/events | https://github.com/coleifer/peewee/issues/1822 | 395,151,721 | MDU6SXNzdWUzOTUxNTE3MjE= | 1,822 | primary_key=True not working | {
"login": "dyadav7",
"id": 8121360,
"node_id": "MDQ6VXNlcjgxMjEzNjA=",
"avatar_url": "https://avatars.githubusercontent.com/u/8121360?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dyadav7",
"html_url": "https://github.com/dyadav7",
"followers_url": "https://api.github.com/users/dyadav7/... | [] | closed | false | null | [] | null | [
"It is clearly explained here:\r\n\r\nhttp://docs.peewee-orm.com/en/latest/peewee/models.html#id4\r\n\r\nYou need to specify `force_insert=True` when saving with a non-integer primary key. Please read the docs."
] | 2019-01-02T05:19:16 | 2019-01-02T18:49:54 | 2019-01-02T18:49:54 | NONE | null | What is the issue with below Model ?
class Tags(BaseModel):
tag = CharField(primary_key=True)
cmd = CharField()
I am unable to save to database. Run attached script to see the issue.
I am unable to find the issues by checking docs.
[peewe_issue.py.txt](https://github.com/coleifer/peew... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1822/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1822/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1821 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1821/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1821/comments | https://api.github.com/repos/coleifer/peewee/issues/1821/events | https://github.com/coleifer/peewee/issues/1821 | 394,978,907 | MDU6SXNzdWUzOTQ5Nzg5MDc= | 1,821 | Prefetch with limit might give unexpected results (at least with SQLite3) | {
"login": "moubctez",
"id": 12608048,
"node_id": "MDQ6VXNlcjEyNjA4MDQ4",
"avatar_url": "https://avatars.githubusercontent.com/u/12608048?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/moubctez",
"html_url": "https://github.com/moubctez",
"followers_url": "https://api.github.com/users/mou... | [] | closed | false | null | [] | null | [
"This is mentioned here: http://docs.peewee-orm.com/en/latest/peewee/relationships.html#using-prefetch",
"> sometimes does not work, when there are more Invoices with the same number.\r\n\r\nWell of course. You're limiting the selection to a single `Invoice` but multiple exist that match the `WHERE` clause. If yo... | 2018-12-31T13:14:05 | 2019-01-03T21:12:51 | 2019-01-02T18:52:36 | NONE | null | I have tables called **Invoice** and **Item**, which essentially look like this:
```
class Invoice(Base):
number = IntegerField(index=True)
class Item(Base):
invoice_id = ForeignKeyField(Invoice, backref='items', on_delete='CASCADE')
```
While executing this: `Invoice.select().where(Invoice.number == ... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1821/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1821/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1820 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1820/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1820/comments | https://api.github.com/repos/coleifer/peewee/issues/1820/events | https://github.com/coleifer/peewee/issues/1820 | 394,210,324 | MDU6SXNzdWUzOTQyMTAzMjQ= | 1,820 | Ask: can we close a connection in pool automatically? | {
"login": "likang",
"id": 850711,
"node_id": "MDQ6VXNlcjg1MDcxMQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/850711?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/likang",
"html_url": "https://github.com/likang",
"followers_url": "https://api.github.com/users/likang/follow... | [] | closed | false | null | [] | null | [
"I don't see how closing immediately would be faster in the long run. I suppose if a burst of requests was received very quickly you might save time because you are opening fewer new connections, as they get recycled faster.\r\n\r\nIn my opinion its foolish to override the transaction APIs. Should you wish to run t... | 2018-12-26T17:34:18 | 2018-12-26T21:38:09 | 2018-12-26T21:38:09 | NONE | null | One of the best practices about connection management is close it when you are done. Normally a hook after request will take this job. like this:
```Python
@hook('after_request')
def _close_db():
if not db.is_closed():
db.close()
```
But I am wondering can we close the connection as soon as possi... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1820/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1820/timeline | null | completed | null | null |
https://api.github.com/repos/coleifer/peewee/issues/1819 | https://api.github.com/repos/coleifer/peewee | https://api.github.com/repos/coleifer/peewee/issues/1819/labels{/name} | https://api.github.com/repos/coleifer/peewee/issues/1819/comments | https://api.github.com/repos/coleifer/peewee/issues/1819/events | https://github.com/coleifer/peewee/issues/1819 | 393,926,350 | MDU6SXNzdWUzOTM5MjYzNTA= | 1,819 | Deriving model classes with ManyToManyField | {
"login": "mried",
"id": 9843448,
"node_id": "MDQ6VXNlcjk4NDM0NDg=",
"avatar_url": "https://avatars.githubusercontent.com/u/9843448?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mried",
"html_url": "https://github.com/mried",
"followers_url": "https://api.github.com/users/mried/follower... | [] | closed | false | null | [] | null | [
"Ahh, yeah, `ManyToManyField` may not play nicely with inheritance without some additional effort. Can you not just replicate the definition of the `ManyToManyField`, as you have it commented-out currently?",
"Whoops... I must admit, the super simple example works after removing the comment-`#`. The example was w... | 2018-12-24T20:08:07 | 2019-01-15T18:46:20 | 2019-01-02T19:04:10 | NONE | null | Hi!
I recently switched from peewee 2.8.5 to 3.8.0 (and from Python 2.7 to Python 3.7 but I don't think, this is the reason for the problem described below). After doing so, I've got a problem with derived model classes, if they contain a `ManyToManyField`. This is a super simple (and stupid) example, which raises a... | {
"url": "https://api.github.com/repos/coleifer/peewee/issues/1819/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/coleifer/peewee/issues/1819/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.