Skip to content

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