def field_is_required(field):
    """Is this field required to have a value

    This is not the same as null=False, it needs to take account of
    auto_add, auto_now_add
    If any of the conditions not nullable, and not auto_now or auto_now_add are
    met then this should be true
    """
    from django.db.models.fields import NOT_PROVIDED
    if field.primary_key:
        return False
    fields = [field.null, field.default != NOT_PROVIDED, getattr(field,
        'auto_now', False), getattr(field, 'auto_now_add', False)]
    return not any(fields)
