Skip to content
Advertisement

Tag: postgresql

Pydantic created at and updated at fields

I’m new to using Pydantic and I’m using it to set up the models for FastAPI to integrate with my postgres database. I want to make a model that has an updated_at and created_at field which store the last datetime the model was updated and the datetime the model was created. I figured created_at could be something like this: How

Django query for column value search?

What is the Django query for this? DB data – I only need record that contain “1.2.3” values not like – (“Cat 1.2.3” or “1.2.3-XY2” or any such value). And pattern “1.2.3” can be anywhere in column where column value can have comma separated values too. Desired Result – When i am performing below Django query – Getting all record

Python re.findall regex and text processing

I’m looking to find and modify some sql syntax around the convert function. I want basically any convert(A,B) or CONVERT(A,B) in all my files to be selected and converted to B::A. So far I tried selecting them with re.findall(r”bconvertb(.*?,.*)”, l, re.IGNORECASE) But it’s only returning a small selection out of what I want and I also have trouble actually manipulating

Django csv upload to db works but throws error

I have created an app named customer within a project named Website using django. I have created a csv upload in the admin area which is connected to the Postgres db. However the CSV file is still added to the db but the error screen is displayed. Even more strangely if I a notepad doc as csv containing the data

Postgredb in conda environment or keep standalone

I am looking for some guidance. I have Anaconda installed to manage my python packages and environments. I see that you can install postgres in the package manager. Am I best to install postgres in the conda environment or install standalone. I am on Windows. I see that if I install postgres separately I get pgadmin graphical interface. This could

How to use data from postgresql in django?

I have switched from sqlite to postgresql following Django: What are the best practices to migrate a project from sqlite to PostgreSQL the fourth answer. Here are my updated settings: However, I cannot seem to find/grab any of the data from my database. Here’s some example data from the database: The migration works successfully with my postgres as I have

Advertisement