diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-09-30 20:19:41 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-09-30 20:19:41 +0200 |
commit | 63cd3cb094c17d09cf99cf1bf9fa7c28c6dd9d59 (patch) | |
tree | 36d69381b619bd72bfd3a0f575c9e47dac8550a2 /archaeological_operations/widgets.py | |
parent | 2e148adc5ee132424d670ae94445f79994ef605b (diff) | |
download | Ishtar-63cd3cb094c17d09cf99cf1bf9fa7c28c6dd9d59.tar.bz2 Ishtar-63cd3cb094c17d09cf99cf1bf9fa7c28c6dd9d59.zip |
Flake8
Diffstat (limited to 'archaeological_operations/widgets.py')
-rw-r--r-- | archaeological_operations/widgets.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/archaeological_operations/widgets.py b/archaeological_operations/widgets.py index 6c4ebe79a..e3c0cd2ea 100644 --- a/archaeological_operations/widgets.py +++ b/archaeological_operations/widgets.py @@ -17,15 +17,15 @@ # See the file COPYING for details. -from django import forms from django.forms import widgets from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ + class ParcelWidget(widgets.MultiWidget): def __init__(self, attrs=None): if not attrs: - attrs = {'class':'widget-parcel'} + attrs = {'class': 'widget-parcel'} elif 'class' not in attrs: attrs['class'] = 'widget-parcel' else: @@ -33,7 +33,7 @@ class ParcelWidget(widgets.MultiWidget): _widgets = ( widgets.TextInput(attrs=attrs), widgets.TextInput(attrs=attrs), - ) + ) super(ParcelWidget, self).__init__(_widgets, attrs) def decompress(self, value): @@ -44,9 +44,10 @@ class ParcelWidget(widgets.MultiWidget): def format_output(self, rendered_widgets): return u' / '.join(rendered_widgets) + class SelectParcelWidget(widgets.TextInput): def render(self, *args, **kwargs): render = super(SelectParcelWidget, self).render(*args, **kwargs) render += u" <button name='formset_add' value='add'>%s</button>" \ - % _(u"Add") + % _(u"Add") return mark_safe(render) |