Re: SQLAlchemy & Postgresql

2020-05-28 Thread Buddy Peacock
Yes, after commenting out all flask related lines and then running the print, I do see all the authors. Al (Buddy) Peacock, PMP, MCCT, ITILv3, SMC, CSM, SPOC (920) 740-3411 linkedin.com/in/buddypeacock On Thu, May 28, 2020 at 3:48 PM Abdur-Rahmaan J

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Abdur-Rahmaan Janhangeer
You tried for isbn, title, author, year in reader: without flask, do you actually see a value for author? Like using a normal print Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugl

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Rich Shepard
On Thu, 28 May 2020, Buddy Peacock wrote: I'm not sure what you mean by models? Am I missing something in my environment perhaps? The model (or models if you prefer) define the sqlalchemy classes that reflect the structure and content of the postgrep table(s). I put all classes (for all data

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Buddy Peacock
Thanks for your response Abdur-Rahmaan, The tables already exist and I have tried both "name = author" and "name = :author" Regards, Al (Buddy) Peacock, PMP, MCCT, ITILv3, SMC, CSM, SPOC (920) 740-3411 linkedin.com/in/buddypeacock On Thu, May 28,

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Peter Otten
Buddy Peacock wrote: > Hello group, > I have a pretty good background in MySQL & MSSQL as well as VB & Php, but > I am new to Python and Postgresql. > > I am taking a class and working on a project to insert authors and books > into a table. My code for this is: > ===

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Abdur-Rahmaan Janhangeer
Well, See for isbn, title, author, year in reader: if db.execute("SELECT * FROM authors WHERE name = :author", {"name": author}).rowcount == 0: db.execute("INSERT INTO authors (name) VALUES (author)") but i don't see any code for creating the authors table also did you mean

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Buddy Peacock
I'm not sure what you mean by models? Am I missing something in my environment perhaps? Al (Buddy) Peacock, PMP, MCCT, ITILv3, SMC, CSM, SPOC (920) 740-3411 linkedin.com/in/buddypeacock On Thu, May 28, 2020 at 2:26 PM Abdur-Rahmaan Janhangeer < arj

Re: SQLAlchemy & Postgresql

2020-05-28 Thread Abdur-Rahmaan Janhangeer
Greetings, where did you define your models? Kind Regards, Abdur-Rahmaan Janhangeer https://www.github.com/Abdur-RahmaanJ Mauritius sent from gmail client on Android, that's why the signature is so ugly. On Thu, 28 May 2020, 22:22 Buddy Peacock, wrote: > Hello group, > I have a pretty go

SQLAlchemy & Postgresql

2020-05-28 Thread Buddy Peacock
Hello group, I have a pretty good background in MySQL & MSSQL as well as VB & Php, but I am new to Python and Postgresql. I am taking a class and working on a project to insert authors and books into a table. My code for this is: === imp