Questions tagged [flask-peewee]

A flask web framework extension that provides a layer of integration between flask and the peewee orm.

Website for Flask-Peewee: https://flask-peewee.readthedocs.io/en/latest/

Website for the peewee ORM: https://peewee.readthedocs.io/en/latest/

104 questions
0
votes
0 answers

unexpected Integrity Error (peewee)

the following code is supposed to be the view of an edit profile page , when the form is submitted the app checks and finds if the username or email already exists , if so it will raise an Integrity exception. but the program doesn't work as…
A. S.
  • 143
  • 2
  • 12
0
votes
1 answer

peewee get_or_create and then save: error binding

Is there an easy way to update a field on a get of a get_or_create? I have a class ItemCategory and I want to either create a new entry or get the already created entry and update a field (update_date). What I do is: item,created=…
maugch
  • 1,276
  • 3
  • 22
  • 46
0
votes
1 answer

Get SQL query count in peewee

Is it possible to count queries in peewee? Make it in Django as follows: from django.db import connection print len(connection.queries)
jonsbox
  • 472
  • 1
  • 6
  • 13
0
votes
1 answer

create_or_get with data from user input

Trying to implement a user registration form on a website I can't make user input to be added as a new user to the database. I'm using Flask with Peewee, and have: nUser ={ 'email': request.form['e_mail'], 'uname':…
adamczi
  • 343
  • 1
  • 7
  • 24
0
votes
1 answer

Encoding id and storing it as a unique code and store in table on creation of row

Essentially, I'm trying to eliminate the need to show the id of a 'listing' to the user. I'm using Hashids to encode the automatically created id as a unique code. To show a single listing, I've been currently doing…
TomHill
  • 614
  • 1
  • 10
  • 26
0
votes
1 answer

What i have use to replace flask_pewee get_fields

Issue come after flask_pewee update I have following line in /usr/lib/python2.6/site-packages/flask_peewee/filters.py for field_obj in model._meta.get_fields(): And error is: File "/usr/lib/python2.6/site-packages/flask_peewee/filters.py", line…
arheops
  • 15,544
  • 1
  • 21
  • 27
0
votes
1 answer

Python Peewee class TypeError when trying to select/where

I'm trying to get a hashed password in a Postgresql DB using the select() and where() function in peewee, but I'm getting the class TypeError. The email is getting received from a json then decoded. function: person_decode =…
sls
  • 1
0
votes
1 answer

Peewee rank() method giving negative scores. Is it designed to do so?

from the peewee docs: Generate an expression that will calculate and return the quality of the search match. This rank can be used to sort the search results. The lower the rank, the better the match. I am currently testing the full-text…
Wagdet
  • 287
  • 2
  • 7
0
votes
1 answer

Replace flask_peewee.db with plain peewee module?

I have a flask app that's using flask_peewee.db in it's app module: from flask_peewee.db import Database Is it possible to replace the flask_peewee Database module with a plain peewee module? The author of flask_peewee says it's in maintenance mode…
David Watson
  • 3,394
  • 2
  • 36
  • 51
0
votes
1 answer

How do I Access One Column of a Peewee ForeignKeyField

I'm trying to access the id column of a ForeignKeyField to my UserAccount table through my Like table with various queries such as: if models.Like.select().where(models.Like.user.id==current_user.id,models.Like.post.id==post_id).exists(): I've been…
TomHill
  • 614
  • 1
  • 10
  • 26
0
votes
2 answers

How do I connect to MySQL database on WebFaction using Peewee ORM?

I successfully uploaded my webapp onto webfaction, but I noticed, when using peewee to connect to a MySQL database on my webfaction account, I got this error: ProgrammingError: (1146, "Table 'TABLEGOESHERE' doesn't exist") Exact error is in the…
Guled
  • 659
  • 1
  • 5
  • 18
0
votes
1 answer

how to insert an new element into an ArrayField in peewee

can I user Model.update(...) to insert an new element into an ArrrayField in peewee? What's more, what about JSONField?
木士羽
  • 151
  • 1
  • 1
  • 5
0
votes
0 answers

How can I make this mysql query to django model?

I'd like to convert the following query intto django query model. We have a products table which has subcategory_id. with this query we'll able to get 3 products per each category. Please help us convert this mysql query to Django query model. ID :…
Alex Seifi
  • 80
  • 1
  • 7
0
votes
0 answers

Where are flask-peewee's admin files?

I'm trying to deploy a website I made to my own server, and am almost done, except that the admin page for flask-peewee has no css styling. Where are the css files for the admin page stored, so I can serve them with apache? If you don't know what…
natebot13
  • 167
  • 3
  • 11
0
votes
0 answers

Flask app runs fine locally, but error accessing db on Heroku

I have a small Flask app (code below) that's basically just using peewee to access a Postgres database. It works fine when I run it locally, but I get a generic 500 Internal Server Error when I try to run it on Heroku. Here's the code from flask…
grautur
  • 29,955
  • 34
  • 93
  • 128