Sep-10-2021, 03:08 PM
muzikman Wrote:You're appending a tuple but each tuple has an identifier 'Title' and 'Rating'.It's make the tuple easier to convert to a dictionary.
Does this associate the key with the value here? My solution wouldn't have had a key reference
So this is the convert part,see that in Python easy take out small part and do test interactively.
>>> t = (('Title', '1,000 Places to See Before You Die'), ('Rating', 'Five')) >>> dict((y, x) for y, x in t) {'Title': '1,000 Places to See Before You Die', 'Rating': 'Five'} >>> d['Rating'] 'Five' >>> d['Title'] '1,000 Places to See Before You Die'
Quote:In more powerful ORMs you can relate these tablets that just take a collection of Movies, People and insert them with one insert. It will automatically add the corresponding data in the join table. I used Laravel the PHP framework and their ORM was awesome. I used it to harvest data from a few movie restful APIs. The response was all JSON and I would turn the JSON into PHP objects, then use the ORM to insert A Movie and the entire cast of people with one call, over three tables. The framework is now way over bloated and is basically another copy of Symfony framework.If doing this on web with Python i would use Flask with Flask-SQLAlchemy
Django is ok if want a larger web-framework with most stuff build in.
FastAPI is the new start ✨