176 questions
0
votes
0
answers
133
views
date conversion and any() in Pony ORM with SQLite
I am building a web application tutorial using Pony ORM. My Python is working, but feels very clunky: in particular, I'm managing date conversion by hand after fetching records, and am doing ...
0
votes
1
answer
266
views
How to 'SELECT *...' (select ALL) in Pony ORM?
community!
I work with MySQL and need to 'translate' query to Pony ORM.
I have a big table 'clients' with a lot of columns and my problem is to write each column in methods for work with database. So ...
1
vote
0
answers
68
views
I can't establish connection between db container and my backend, I am using flask with poney orm
I think that everything should be working just as expected but I get this eror:
The database object is not bound with a provider yet
I don't know where the issue is coming from, I attached the full ...
0
votes
2
answers
71
views
About Process Of Char type of Oracel in PonyORM
I used the PonyORM with Oracle, I found that it can not support the CHAR type of ORACLE well.
for example, I have a field whose type is CHAR(15), and I fill it up with 1234567890 after it is saved ...
0
votes
1
answer
562
views
Azure Functions Python Vx - ModuleNotFound Exception with ORM
Context
I am using Azure Functions (I have tried both v1, and v2) to coordinate a set of scripts that trigger on HTTP. These scripts will pull data from an API, transform, then upload to a PostgreSQL ...
1
vote
1
answer
623
views
How to create a pytest fixture to clean a database
I'm working on a Python project with FastAPI and Pony ORM. We're creating unit tests for each module of the program, and we want to be able to run all the tests together (there's one test file for ...
0
votes
1
answer
99
views
Can I use pony orm with models in separate files?
Is it possible to use Pony with a file structure like this?
-project/
-start.py
-controller/
-view/
-model/
__init__.py
-person.py
-category.py
All examples I ...
0
votes
0
answers
35
views
when __init__ is directly run, it can import a module, but when __init__ is imported, it cannot import the module
I have 3 script structured as below
server.py
database/__init__.py
database/databaseConfig.py
__init__.py imported databaseConfig.py. When __init__.py is ran directly, it executes successfully. in ...
0
votes
1
answer
147
views
PonyORM reverse attribute not found error only on one class
I have three table as follow:
class User(db.Entity):
_table_ = "tbl_user"
idUser = PrimaryKey(uuid.UUID,default = uuid.uuid4 ,column = 'id_user')
username = Required(str, unique =...
3
votes
0
answers
709
views
Unsupported operation RETURN_GENERATOR on select()
I'm new at ponyorm and was trying to learn how to use ponyorm. I have the following script
from pony.orm import Database,PrimaryKey,select,Required
db = Database()
db.bind(
provider='postgres',
...
0
votes
2
answers
3k
views
merge multiple tables together
i seem to be a little confused on what to do. I have 3 csv files, each have the the common rows of name age and sex. First csv file shows the common data of the 3 and proceeds to have card details ...
0
votes
2
answers
151
views
any idea how to save a data string of int which is more than the max length into sql database?
IBAN = Required(str)
Credit_Card_number = Required(int)
CV2 = Required(int)
"credit_card_number": "2221597849919620",
with db_session:
with open('user_data.json') as f:...
0
votes
1
answer
629
views
How to add a unique constraint on two fields with PonyORM
I use PonyORM, and I want to add a unique constraint on a combination of two fields.
Here's an example (PonyEditor link : https://editor.ponyorm.com/user/lial_slasher/DoubleConstraint).
I have two ...
1
vote
0
answers
3k
views
Why I am getting this error? pydantic.error_wrappers.ValidationError: 2 validation errors for DishMenus
model.py
class Dish(db.Entity):
id = PrimaryKey(UUID, auto=True)
dish_name = Required(str, unique =True)
price = Required(float, default=0)
created_at = Required(date)
dish_menus =...
1
vote
0
answers
107
views
Can we declare PonyORM models without using a database global variable?
Declaring classes that map the db in ponyORM inherits from database as a global variable.
from pony.orm import *
db = Database()
class MyEntity(db.Entity):
attr1 = Required(str)
Is there a way ...