Yaml fixture with ManyToManyField in Django

The official docs explain how to set up “natural keys” for easier writing of fixtures.

The things to remember are basically two:

  • setup a models.Manager (write the class with an appropriate get_by_natural_key method and instantiate it in the managed class)
  • the fields used for a natural key must be ...
more...

automatically activate python virtualenv in pycharm

I slightly modified an answer from stackoverflow to make it work on linux

nano ~/.pycharmrc
if [ -r ".pycharm/term-activate" ]; then
   source ~/.bash_profile
   source ".pycharm/term-activate"
   source $PYCHARM_VENV/bin/activate
fi

On your project folder, assuming you have a virtual environment called venv35,

mkdir .pycharm
nano .pycharm/term-activate

With the content ...

more...



Lessons learnt from my bachelor thesis

In this post I’ll describe what I did for the bachelor thesis, some problems I encountered and the solutions I found.

My bachelor degree required a final group project; mine was about the fatigue failure in poly-crystalline silicon. My job was focused on running static load simulations using finite ...

more...