|
@@ -44,7 +44,7 @@ def construct_instance(form, instance, fields=None, exclude=None):
|
|
|
file_field_list = []
|
|
|
for f in opts.fields:
|
|
|
if not f.editable or isinstance(f, models.AutoField) \
|
|
|
- or not f.name in cleaned_data:
|
|
|
+ or f.name not in cleaned_data:
|
|
|
continue
|
|
|
if fields is not None and f.name not in fields:
|
|
|
continue
|
|
@@ -128,7 +128,7 @@ def model_to_dict(instance, fields=None, exclude=None):
|
|
|
for f in opts.concrete_fields + opts.virtual_fields + opts.many_to_many:
|
|
|
if not getattr(f, 'editable', False):
|
|
|
continue
|
|
|
- if fields and not f.name in fields:
|
|
|
+ if fields and f.name not in fields:
|
|
|
continue
|
|
|
if exclude and f.name in exclude:
|
|
|
continue
|
|
@@ -187,7 +187,7 @@ def fields_for_model(model, fields=None, exclude=None, widgets=None,
|
|
|
for f in sorted(opts.concrete_fields + sortable_virtual_fields + opts.many_to_many):
|
|
|
if not getattr(f, 'editable', False):
|
|
|
continue
|
|
|
- if fields is not None and not f.name in fields:
|
|
|
+ if fields is not None and f.name not in fields:
|
|
|
continue
|
|
|
if exclude and f.name in exclude:
|
|
|
continue
|
|
@@ -658,7 +658,7 @@ class BaseModelFormSet(BaseFormSet):
|
|
|
|
|
|
row_data = tuple(d._get_pk_val() if hasattr(d, '_get_pk_val') else d
|
|
|
for d in row_data)
|
|
|
- if row_data and not None in row_data:
|
|
|
+ if row_data and None not in row_data:
|
|
|
|
|
|
if row_data in seen_data:
|
|
|
|