DjangoCon US 2019: Python & Django in San Diego!

Felipe Farias
September 23, 2019
<p>We are back to San Diego!! Our team will be joining <a href="https://2019.djangocon.us/">DjangoCon US's conference</a>, one of the biggest Django events in the world. For this year, we'll be giving two talks: <em>Pull Requests: Merging good practices into your project and Building effective Django queries with expressions</em></p><p>Here is the slide from the talk we gave during the conference:</p><h3 id="pull-requests-merging-good-practices-into-your-project">Pull Requests: Merging Good Practices Into your Project</h3><ul><li>Speaker: <a href="https://twitter.com/lucabezerra_">Luca Bezerra</a></li><li>Link to Slides: <a href="https://drive.google.com/file/d/1qHMsrpsGzi-N9XhIKKTRXMmq2jiXIffc/view">Pull Requests: Merging Good Practices Into your Project</a></li></ul><p>Although known by most, Pull Requests are often not dealt with in the most effective way. Believe it or not, there are teams that don’t review code at all! People may assume that a senior developer is experienced enough to not make any mistakes, or that merely changing those 3 lines of code couldn’t possibly do any harm to the system. In these cases, it’s not uncommon to skip the code review in order to cut some time. Unreviewed (or badly reviewed) code can be extremely dangerous, resulting in huge risks and unpredictable behavior.</p><p>A survey says that, on average, developers spend 45% of their time fixing bugs and technical debt, when they could be developing new features instead. Defining simple guideline files, adopting certain behaviors and setting up repository configurations are steps that can increase manyfold the code review performance (in both time and quality). Using review tools both on server (e.g. Heroku Review Apps) and locally (e.g. linters) can also greatly increase the process’ speed. Creating templates and checklists ensures no step is overlooked or forgotten. The list goes on, but enough spoilers for now. The attendees will learn specific tips, tools, processes and recommended practices that were compiled from research and real-life use cases (both from my experience and from big players like Django, Facebook, Mozilla, etc), along with some survey data that demonstrates why reviewing code is important.</p><h3 id="building-effective-django-queries-with-expressions">Building Effective Django Queries with Expressions</h3><ul><li>Speaker: <a href="https://twitter.com/vcfbarreiros">Vanessa Barreiros</a></li><li>Link to Slides: <a href="https://docs.google.com/presentation/d/1HhISje4VyaQcjElRDsrKkZpIMuJQy9uLbGhfkuVswDI/edit?usp=sharing">Building Effective Django Queries with Expressions</a></li></ul><p>In Django, we have a powerful tool called ORM to manipulate databases easily. For small queries, it can be quite simple, but what happens when you need to do tricks like nested queries or computed values? One of the answers is query expressions. In this talk, we'll learn how to power-up queries with them by walking through comparisons and examples with a dataset.</p><p>It's known that ORMs are a powerful tool to manipulate databases with ease. In Django, there are a set of out-of-the-box abstractions to help perform queries and shape them through annotations, aggregations, order by, and so on, hence saving one's time. A common solution to filtering when models grow larger over time is creating redundant fields; a better solution is using Django built-in resources called query expressions.</p><p>Query expressions are smart yet straightforward functions that one can use to compute values on query execution and do string manipulation, calculations, among others, thus removing the burden of having unnecessary extra columns in our database. Using query expressions effectively can help to generate performant queries, avoiding potential inconsistencies and separating concerns.</p><p>This talk focuses on further optimizing Django queries by walking through code comparisons and examples with a dataset, diving into subjects such as custom database functions, conditional expressions, and filtering so to answer questions about the data.</p>