def __init__(self, *args, **keyargs):
    super(FeatureForm, self).__init__(*args, **keyargs)
    meta = getattr(self, 'Meta', None)
    exclude = getattr(meta, 'exclude', [])
    for field_name in exclude:
        if (field_name in self.fields):
            del self.fields[field_name]
    for (field, val) in self.fields.iteritems():
        if val.required:
            self.fields[field].widget.attrs['required'] = 'required'
def __init__(self, *args, **keyargs):
    super(FeatureForm, self).__init__(*args, **keyargs)
    meta = getattr(self, 'Meta', None)
    exclude = getattr(meta, 'exclude', [])
    for field_name in exclude:
        if (field_name in self.fields):
            del self.fields[field_name]
    for (field, val) in self.fields.iteritems():
        if val.required:
            self.fields[field].widget.attrs['required'] = 'required'