I have a simple statement,
Points.create(user=bt.user,match=m,value=2,datecreated=date.today())
I expect it to create one record but sometimes it creates mutliple records. Not sure what's going on.
Complete code is like below:
from utils.models…
I have set up an API using the Flask-Peewee API library:
class ActivityResource(RestResource):
exclude = ('id', 'course')
class CourseResource(RestResource):
exclude = ('id')
class SessionResource(RestResource):
def get_query(self):
…
I'd like to run the following query by flask-peewee,
merchant_name LIKE 'seaside%'
SELECT *
FROM `merchant_details`
WHERE `merchant_name` LIKE 'seaside%'
Here is the return JSON of the below URL and I need to filter the merhcnat_name…
I have the following models in a flask application with the Peewee ORM:
class Course(db.Model):
name = CharField()
class Activity(db.Model):
course = ForeignKeyField(Course)
name = CharField()
I want to generate a multiple select…
I need convert a SQL query to peewee instructions.
My SQL is:
parts_test = db.execute('''
SELECT tokenID, rewardCount FROM Loot
INNER JOIN Quests ON Loot.questID = Quests.questID
INNER JOIN Rewards ON Loot.rewardID =…
I'm trying to create a tables in Flask app.
For creating DB I use peewee library.
When run func, I receive an error: NOT NULL constraint failed: Time.start
Can some one explain how to insert data in to database correctly
models.py
from peewee import…
I am new to flask and I have created a flask api where user can upload recipe and also like recipes. To get the top recipe, I want sort recipe by the highest number of likes.
@app.route('/top_recipe', methods=['GET'])
def top_recipe():
recipes =…
Hello.
When i'm trying to create new record in model, i'm getting
AttributeError: 'dict' object has no attribute 'compiler'
Possible, that i'm getting this error because using Proxy class, but can't find mistake in my code.
init.py
from flask…
the classes:
class User(flask_db.Model, UserMixin):
id = PrimaryKeyField()
social_id = CharField(null=False, unique=True)
nickname = CharField(null=False)
email = CharField(null=True)
class Feed(flask_db.Model):
id =…
I've been trying to use peewee orm to insert values to db for my project, problem is that it inserts a blank value for one of the columns for seemingly no reason, I have a for loop inserting these values and it only ignores the url value, heres my…
I have two tables:
select * from patient WHERE name = 'Dharam';
+----+--------+----------+---------------+-----+--------+
| id | name | townCity | contactnumber | age | gender |
+----+--------+----------+---------------+-----+--------+
| 5 |…
I'm using flask-peewee, and I'm trying to run a query and filter by a DateTime field. However something like this does not seem to work:
http://127.0.0.1:5000/api/obj/?group=1&at_date=Thu,%2021%20Jul%202016%2012:28:29%20GMT
Nor do the other formats…
I have a simple website made with Flask and Peewee as the ORM that annotates the drinks everyone in the office gets to then, once a week or so, check who drink what, how much and when. I have a simple table named orders that looks like this:
Orders…