peewee Questions

1

Solved

Is it possible to access an in-memory SQLite database from different threads? In the following sample code I create a SQLite database in memory and create a table. When I now go to a different exe...
Groundling asked 6/4, 2016 at 10:0

2

Solved

Since joining is not allowed on "delete" queries in Peewee, what is the best way to delete all records in table_2 that match a specific condition in related table_1? Using a simple example, I want...
Endure asked 22/10, 2015 at 20:40

1

Solved

Say that I have a table called TBL_ACCOUNT which contains all of my users, and a table called TBL_EMAIL_SUBSCRIPTION where it contains the feeds that a user is subscribed to. I'm trying to make it ...
Boudreaux asked 3/9, 2015 at 13:2

1

I'm using peewee as ORM and have two classes like this: class A(Model): name = CharField() body = TextField() class B(Model): title = CharField() body = TextField() I would like to get all ...
Pistareen asked 23/5, 2016 at 20:41

1

Solved

I have 2 simple scripts: from sqlalchemy import create_engine, ForeignKey, Table from sqlalchemy import Column, Date, Integer, String, DateTime, BigInteger, event from sqlalchemy.ext.declarative i...
Tonina asked 29/4, 2016 at 20:24

1

Solved

I am looking to select all values from one column which are distinct using Peewee. For example if i had the table Organization Year company_1 2000 company_1 2001 company_2 2000 .... To ...
Workshop asked 16/1, 2016 at 3:19

3

Solved

The documentation shows here how to use the IN operator, but I couldn't find how to use the NOT IN operator. If I put a not << I get a syntax error. If I put a not <FieldName> <&lt...
Determined asked 8/9, 2014 at 23:24

1

Solved

Is there a simple one-line way using peewee in Python of either inserting a record if the primary key does not already exist, or updating the record if it does already exist. Currently i am using...
Weirdo asked 2/11, 2015 at 19:26

1

Solved

Suppose I have a peewee model which looks more or less as follows: class MyModel(peewee.Model): a = peewee.IntegerField() b = peewee.IntegerField() And I wish to add a property to that model a...
Reconvert asked 8/11, 2015 at 13:47

2

Solved

I am trying to query in Peewee with results that should have a specific substring in them. For instance, if I want only activities with "Physics" in the name: schedule = Session.select().join(Act...
Virility asked 14/12, 2013 at 23:29

1

Solved

I am using Python/Mysql and Peewee as ORM. I am stuck in a situation. Suppose i want to insert a row using peewee but check if that row exist skip else insert. Is there any procedure to do so in py...
Enginery asked 22/6, 2015 at 10:25

1

Assuming we have these three models. class Item(BaseModel): title = CharField() class User(BaseModel): name = CharField() class UserAnswer(BaseModel): user = ForeignKeyField(User, 'user_answe...
Venator asked 24/3, 2015 at 22:55

2

Solved

I'm trying to create a model to describe a table with an enum field in peewee. I'm seeing that EnumField was removed from the peewee.py file before the 2.0 version, and I can't find anything in th...
Mooneyham asked 17/12, 2012 at 22:35

3

Solved

I have a Python program which runs on background for weeks, and does database queries every once in a while. For that, I am using the ORM peewee (version 2.2.1). I am using MySQL as a backend. Lat...
Shenitashenk asked 18/2, 2014 at 11:45

1

Solved

I am unable to read the column of another table which is joined. It throws AttributeError class Component(Model): id = IntegerField(primary_key=True) title = CharField() class GroupComponentMap...
Br asked 25/9, 2014 at 12:32

1

Solved

I am working on an app with Cherrypy and Peewee, and I would like to know if my approach is good or wrong and dangerous. All the examples of Peewee classes that I found have only the Meta subclass...
Rover asked 12/9, 2014 at 21:0

4

Solved

I am trying to learn how to use peewee with mysql. I have an existing database on a mysql server with an existing table. The table is currently empty (I am just testing right now). >>>...
Walsh asked 21/3, 2013 at 22:33

0

I'm building a website using the Python Flask framework and the Peewee ORM with PostgreSQL 9.3. So far things are going pretty well, but I now run into some trouble. I sometimes get an InterfaceErr...
Brazen asked 6/4, 2014 at 12:26

1

Solved

I want to dynamically OR multiple clauses when performing a query. I see in the peewee documentation that: import operator or_clauses = reduce(operator.or_, clauses) # OR together all clauses Ho...
Tiemannite asked 6/3, 2014 at 23:11

2

Solved

I want to be able to join multiple tables in peewee. However the scenario is a little difficult for me to figure out how to get it to work with peewee. I have the following tables: Ticket Ticket...
Brynhild asked 25/2, 2014 at 14:14

1

Solved

I'm trying to learn the Peewee ORM in combination with Flask by following the Flask Mega Tutorial. In part 5 of the tutorial I create a login using OpenID. After overcoming a bunch of hurdles alrea...
Parrnell asked 15/1, 2014 at 14:22

1

Solved

I am trying to select two fields from separate tables using peewee. I believe my issue is with iterating over the resulting object. I have the following code in Python: sHeader_Value = (System_He...
Idolatrous asked 14/10, 2013 at 17:46

1

Solved

I have researched this everywhere and can't seem to find an answer. I hope I haven't duplicated this (as it's my first question on SO). I am trying to write a select query with Peewee that would n...
Anlage asked 8/10, 2013 at 22:54

1

Solved

I'm trying to allow null values in some columns of a MySQL database using peewee with bottle. Looking at the docs here I thought that would be quite easy. I set up a class like this: class TestCla...
Ivetteivetts asked 20/9, 2013 at 22:27

1

Solved

Im using flask-peewee to make an API and I'd like to return back a 404 json if user doesn't exist in the table but seems like it's throwing 500 error instead of 404 error json: Here is the Error ...
Rabi asked 18/9, 2013 at 20:38

© 2022 - 2024 — McMap. All rights reserved.