sqlAlchemy has sessionmaker to create a session from which you can use query to get whatever you need. For example: someSession.query(SomeTableRepresentationObject).filter…ect If you’ve used sqlalchemy, nothing new going on here but it wouldn’t be me if I didn’t point out the obvious and take three sentences to do so. Now what you may run into [...]
SqlAlchemy: Self Referential Many To Many
Ok this was just plain annoying to figure out. A couple of misteps and a few F—! later I finally got it. So the situation is this: You have a table for user to ignore users. So it’s basically a many to many where both sides of the relationship are the user table. The creation [...]
Simple Property Merge for Python Objects
Not sure if this is useful to other people, but then again if I cared that would make me human. So here’s a quick way to merge two objects in python: def mergeObjectProperties(objectToMergeFrom, objectToMergeTo): “”" Used to copy properties from one object to another if there isn’t a naming conflict; “”" for property in objectToMergeFrom.__dict__: [...]
I Have Found Python and I Am a Changed Man
Ok so maybe the title is full of sensationalism, but in some ways it’s true. In the beginning there was Microsoft. When I started programming at the unusually late age of 24, I was brought into the world by Microsoft. At the time, ASP was still in fair use and .Net was the new wonder [...]
Python: Added Folder By Namespace Won’t Import…. How To Make A Namespace.
Ran into this last night and it was giving me some issues. Basically, I added a folder (unitTest) and then some .py files to it. So my folder structure is something like: pyzzazz/unitTest/validation/validationTest.py Now one would assume you could do this: from python.unitTest.validation.validationTest import someTestMethod Problem was that the IDE (PYCHARM PLUG) was telling that [...]