May-25-2018, 09:51 PM
Currently I use xlrd xlwr with psycopg2 to move transaction records in and out of spreadsheets and postgres. That works but I am interested in learning OOP and it seemed like I could incorporate OOP in my current efforts My first question to the forum is whether or not that really makes sense practically?
My idea is to create a transaction class:
with attributes that map to the column headings for each spreadsheet / DB table. Further, I could create methods such as selects, inserts and updates which would retrieve, create and modify those transaction records.
I can't imagine this hasn't been done with more knowledge and skill than I have so, assuming this approach makes sense, I was hoping the forum could provide some coaching on the pros and cons and possibly best strategy of this approach.
Best,
Hagen
My idea is to create a transaction class:
class transaction: def__init__(self,date,account,amount,theater,sales_num): self.date = date self.account = account self.amount = amount self.theater = theater self.sales_num = sales_num
with attributes that map to the column headings for each spreadsheet / DB table. Further, I could create methods such as selects, inserts and updates which would retrieve, create and modify those transaction records.
I can't imagine this hasn't been done with more knowledge and skill than I have so, assuming this approach makes sense, I was hoping the forum could provide some coaching on the pros and cons and possibly best strategy of this approach.
Best,
Hagen