Paolo Redaelli personal blog

Category: Python

Eiffel’s conditional expressions

The ternary conditional operator is a short-hand method for writing an if/else statement. Does Python Have a Ternary Conditional Operator? Yes, it does. This remids me that Eiffel, at least “ISE Eiffel” does actually have conditional expressions that are the same: <span class="kwd">answer := if</span><span class="pln"> time < noon </span><span class="kwd">then</span> <span class="str">"Good morning"</span> <span…

Multiple fields primary keys in Django

I’m developing a little application in Django. Having developed a subtle dislike for UUIDs used as primary keys I tend to rely of the “natural keys” which are almost always identificable in a data model. Often thought those keys span over several fields. Think about a receipt of a multi-store multi-cashier store, their receipts are…

Choosing a framework

I’ve been asked to develop an application to record incoming shipments of loose materials, more precisely excavated material to be processed – washed, crushed and sieved – to produce construction materials such as sand, gravels and coarse aggregates. Ten years ago I would have used Qt or Gtk for the front-end developing a two tiered…

Object-relational Mappers (ORMs) – Full Stack Python

Object-relational Mappers (ORMs) – Full Stack Python Object-relational mappers (ORMs) bridge relational databases and data represented in Python code. Great post on Full Stack Python about Object-relational Mappers (ORMs)! When I started coding most of them didn’t exist. In fact an unfinished project of mine started hand-coding an object-relational mapping. I think I shall restart…

MicroPython – Python for microcontrollers

MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments. Sorgente: MicroPython – Python for microcontrollers Well, pretty neat, as they deliver it in 256k of code and 16k of RAM!