oauth2_client/management/commands/oauth2_app_maker.py
def _filter_cmd_argument(argument_name, argument_value, model_fields, update_mode):
        """
        Command arguments always include a lot of ones added by Django, that we don't want to use to
        determine properties of our model object, e.g. `verbosity`, `settings`, `pythonpath` etc.
        This utility determines if we should use a command's input argument and pass its value to
        the App model instance that is being created/updated, or not.

        Some extra logic applies to argument's value, depending on `update` parameter value:

        Create mode (update==False):
        Use only arguments that have specified values. Don't pass any input Nones to the Application
        instance, so model's defaults are used.

        Update mode (update==True):
        Empty strings are allowed, to clear a value with the update (hence comparison to None)
        This is for example, when you have a `redirect_uri` specified on an Application and you
        want to erase it. (--redirect-uri="")

        Args:
            argument_name: str
            argument_value: Any
            model_fields: list of strings, names of all the fields appearing in the Application model
            update_mode: bool

        Returns:
            bool: shall the argument and it's value be used
        """

        if update_mode:
            return bool(argument_name in model_fields and argument_value is not None)
        else:
            return bool(argument_name in model_fields and argument_value)

        Command arguments always include a lot of ones added by Django, that we don't want to use to
        determine properties of our model object, e.g. `verbosity`, `settings`, `pythonpath` etc.
        This utility determines if we should use a command's input argument and pass its value to
        the App model instance that is being created/updated, or not.

        Some extra logic applies to argument's value, depending on `update` parameter value:

        Create mode (update==False):
        Use only arguments that have specified values. Don't pass any input Nones to the Application
        instance, so model's defaults are used.

        Update mode (update==True):
        Empty strings are allowed, to clear a value with the update (hence comparison to None)
        This is for example, when you have a `redirect_uri` specified on an Application and you
        want to erase it. (--redirect-uri="")

        Args:
            argument_name: str
            argument_value: Any
            model_fields: list of strings, names of all the fields appearing in the Application model
            update_mode: bool

        Returns:
            bool: shall the argument and it's value be used
        
Command arguments always include a lot of ones added by Django, that we don't want to use to
determine properties of our model object, e.g.

Some extra logic applies to argument's value, depending on `update` parameter value.

Create mode (update==False):
Use only arguments that have specified values. Don't pass any input Nones to the Application
instance, so model's defaults are used.

Update mode (update==True):
Empty strings are allowed, to clear a value with the update (hence comparison to None)
This is for example, when you have a `redirect_uri` specified on an Application and you
want to erase it.
Command arguments always include a lot of ones added by Django that we don ' t want to use to determine properties of our model object e . g . Some extra logic applies to argument ' s value depending on ` update ` parameter value . Create mode ( update == False ) : Use only arguments that have specified values . Don ' t pass any input Nones to the Application instance so model ' s defaults are used . Update mode ( update == True ) : Empty strings are allowed to clear a value with the update ( hence comparison to None ) This is for example when you have a ` redirect_uri ` specified on an Application and you want to erase it .
def _filter_cmd_argument(argument_name, argument_value, model_fields, update_mode):
        if update_mode:
            return bool(argument_name in model_fields and argument_value is not None)
        else:
            return bool(argument_name in model_fields and argument_value)
def _filter_cmd_argument ( argument_name , argument_value , model_fields , update_mode ) : if update_mode : return bool ( argument_name in model_fields and argument_value is not None ) else : return bool ( argument_name in model_fields and argument_value )
Command arguments always include a lot of ones added by Django, that we don't want to use to
determine properties of our model object, e.g.
Command arguments always include a lot of ones added by Django that we don ' t want to use to determine properties of our model object e . g .
"""
        Command arguments always include a lot of ones added by Django, that we don't want to use to
        determine properties of our model object, e.g. `verbosity`, `settings`, `pythonpath` etc.
        This utility determines if we should use a command's input argument and pass its value to
        the App model instance that is being created/updated, or not.

        Some extra logic applies to argument's value, depending on `update` parameter value:

        Create mode (update==False):
        Use only arguments that have specified values. Don't pass any input Nones to the Application
        instance, so model's defaults are used.

        Update mode (update==True):
        Empty strings are allowed, to clear a value with the update (hence comparison to None)
        This is for example, when you have a `redirect_uri` specified on an Application and you
        want to erase it. (--redirect-uri="")

        Args:
            argument_name: str
            argument_value: Any
            model_fields: list of strings, names of all the fields appearing in the Application model
            update_mode: bool

        Returns:
            bool: shall the argument and it's value be used
        """
shall the argument and it's value be used
shall the argument and it ' s value be used
bool
argument_name
None
argument_value
None
model_fields
list of strings, names of all the fields appearing in the Application model
list of strings names of all the fields appearing in the Application model
update_mode
None