Skip to content

Instantly share code, notes, and snippets.

View AnnaDamm's full-sized avatar
🏳️‍🌈

Anna Damm AnnaDamm

🏳️‍🌈
View GitHub Profile
@AnnaDamm
AnnaDamm / gist:2b24fc9d6d58a12730abe373914dbeb7
Last active December 21, 2020 13:35
pre commit hook to automatically fix code styles and add the changes to the commit
#!/usr/bin/env bash
# Change the directory in which the code style fixes should be executed by changing the WWW_DIR variable
#
# DO NOT USE THIS WITH PARTIAL COMMITS
# If you want to do partial commits, disable hooks by using the "--no-verify" option when commiting
#
# Attention: Not tested with cygwin and linux
set -e
@AnnaDamm
AnnaDamm / forms.py
Last active June 28, 2021 09:26 — forked from eerien/forms.py
Comma Separated Values Form Field for Django. There are CommaSeparatedCharField, CommaSeparatedIntegerField.
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
class MinLengthValidator(validators.MinLengthValidator):
message = _("Ensure this value has at least %(limit_value)d elements (it has %(show_value)d).")