(model_class)
return list(set(chain.from_iterable(
        (field.name, field.attname) if hasattr(field, 'attname') else (field.name,)
        for field in model_class._meta.get_fields()
        # For complete backwards compatibility, you may want to exclude
        # GenericForeignKey from the results.
        if not (field.many_to_one and field.related_model is None)
    )))
Restores a function from django<1.10
Restores a function from django<1.10
Restores a function from django<1 . 10
def get_all_field_names(model_class):
    """ Restores a function from django<1.10 """
    return list(set(chain.from_iterable(
        (field.name, field.attname) if hasattr(field, 'attname') else (field.name,)
        for field in model_class._meta.get_fields()
        # For complete backwards compatibility, you may want to exclude
        # GenericForeignKey from the results.
        if not (field.many_to_one and field.related_model is None)
    )))
def get_all_field_names ( model_class ) : return list ( set ( chain . from_iterable ( ( field . name , field . attname ) if hasattr ( field , 'attname' ) else ( field . name , ) for field in model_class . _meta . get_fields ( ) # For complete backwards compatibility, you may want to exclude # GenericForeignKey from the results. if not ( field . many_to_one and field . related_model is None ) ) ) )