Coverage for /home/tribaal/workspace/django-shop/shop/admin/mixins : 27.78%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#-*- coding: utf-8 -*-
new_class = super(LocalizeDecimalFieldsForm, cls).__new__(cls) if hasattr(new_class, 'base_fields'): for field in new_class.base_fields.values(): if isinstance(field, (forms.DecimalField, forms.FloatField)): field.localize = True field.widget.is_localized = True return new_class
''' To be used as a mixin for classes derived from admin.ModelAdmin, admin.TabularInline, etc. which localizes the input fields for models of type DecimalField in the admin interface. If your class derived from ModelAdmin wants to override the form attribute, make sure that this form is derived from LocalizeDecimalFieldsForm and not from forms.ModelForm. ''' |