In a Django project I’m working on, I have a couple of similar models. I will show how to refactor the models to have less code, clearer project, and remove lots of repeated code.
Let’s assume that I’m working on indexing youtube videos.
A simple description of a couple of more advanced, not wildly used, Python constructs like list comprehension, dictionary comprehension, map, and filter.
I rewrote my blog engine. Previously I used Wordpress, which was a bunch of spaghetti code, random plugins, terribly old database changes. Now it is much simpler, much better, much faster. Maybe I will describe the implementation later.
While rewriting the blog, I wanted to use the great Awesome Fonts library. I wanted to use the four icons you can see in the lower left corner of this page. It was as easy as: