Skip to content

Instantly share code, notes, and snippets.

View tschwaerzl's full-sized avatar
🍕
is power

Thomas Schwärzl tschwaerzl

🍕
is power
View GitHub Profile
@tschwaerzl
tschwaerzl / gist:5402873
Last active December 16, 2015 07:59
Original source: http://djangosnippets.org/snippets/2650/ (Autor: lettoo) Description: How to automaticaly add css to all fields of a ModelForm
class MyModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(forms.ModelForm, self).__init__(*args, **kwargs)
for field_name in self.base_fields:
field = self.base_fields[field_name]
size = None
try:
size = field.max_length
except:
size = None
@tschwaerzl
tschwaerzl / Preferences.sublime-settings
Last active October 11, 2015 11:28
sublime user settings for python
{
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme",
"find_selected_text": true,
"fold_buttons": true,
"font_face": "Source Code Pro ExtraLight",
"font_size": 11,
"font_options":
[
"subpixel_antialias"
],