Skip to content

Instantly share code, notes, and snippets.


Mikhail Podgurskiy kmmbvnr

View GitHub Profile
kmmbvnr /
Last active Jul 31, 2020
We couldn’t find that file to show.
kmmbvnr / README.rst
Last active Feb 16, 2017
Viewflow 0.12 upgrade instruction
View README.rst

Viewflow 0.12 upgrade instruction

  1. Django 1.6 is no longer supported. please consider upgrading.
  2. Process wait-lock was removed for all locks implementation. Django 1.8 users need to enable django-transaction-hooks that required by celery.Job task. Any 3rd party task queue implementation should use transaction.on_commit to schedule a background task.
  3. Django and DjangoRestFramework tend to use _class suffix for the variable names. Viewflow now follows the same naming theme. All _cls suffixes were renamed to _class. Check your code for the process_cls, task_cls and flow_cls variables and rename to process_class, task_class, flow_class respectively.
  4. Django-Extra-Views integration was removed. Consider using django-material or django-super-forms packages to simplify forms handling.
View gist:0c55b60c6383117d1eae17a3a4432174
DWDIR=~/Downloads/`date +%Y-%m-%d`
if [ ! -d $DWDIR ]; then
cd ~/Downloads/ && find -maxdepth 1 -type d -empty -delete
mkdir $DWDIR
unlink ~/Downloads/Current
ln -sf $DWDIR ~/Downloads/Current
kmmbvnr / bigquery.sql
Created Jul 21, 2016
Query pypi package download stats
View bigquery.sql
WHERE file.project='django-material'
group by
class Task(Model):
def activate(self):
activation = self.flow_task.activation_cls(self.task)
with activation.lock():
yield activation
def start_view(request, start_task):
with start_task.activate() as activation:
kmmbvnr /
Created Mar 10, 2016 — forked from mariocesar/
Django state field that enforce a workflow path
from collections import namedtuple
from functools import wraps
from itertools import chain
from django.utils.functional import curry
from django.db.models import CharField
class StateField(CharField):
Starts = namedtuple('Starts', ['state'])
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'socket'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
View Vagrantfile
# Fix no-tty error
# if there a line that only consists of 'mesg n' in /root/.profile, replace it with 'tty -s && mesg n'
config.vm.provision :shell,
:inline => "(grep -q -E '^mesg n$' /root/.profile && sed -i 's/^mesg n$/tty -s \\&\\& mesg n/g' /root/.profile && echo 'Ignore the previous error about stdin not being a tty. Fixing it now...') || exit 0;"
kmmbvnr / .gitignore
Last active Sep 2, 2015
View .gitignore
kmmbvnr / tox.ini
Last active Jun 15, 2018
Even less painless way to launch a script without activating first its virtual environment
View tox.ini
envlist = py36
skipsdist = True
deps = django==2.0.6
commands = {posargs:./ runserver}
setenv =