oauth2_client/management/commands/oauth2_app_maker.py
def _create(self, application_data):
        """
        Create an application, if model validation successful. Enforce unique name, even when
        uniqueness not defined in the model.

        Args:
            application_data (dict): key-values for the new Application record

        Returns:
            None:

        Raises:
            ValidationError: 1) when app with this name already exist; 2) when data constraints
            defined on the model violated
        """
        app_model = self.app_model()
        target_application = app_model(**application_data)
        name_field = target_application._meta.get_field('name')
        if not name_field.unique:
            name_field.validators.append(self.validate_unique)  # ensure name is unique
        if name_field.blank:
            name_field.blank = False  # do not allow blank app.name
        target_application.full_clean()  # trigger validation
        target_application.save()
        self.logger.info('Application %s successfully created.', application_data['name'])

        Create an application, if model validation successful. Enforce unique name, even when
        uniqueness not defined in the model.

        Args:
            application_data (dict): key-values for the new Application record

        Returns:
            None:

        Raises:
            ValidationError: 1) when app with this name already exist; 2) when data constraints
            defined on the model violated
        
Create an application, if model validation successful. Enforce unique name, even when
uniqueness not defined in the model.

application_data (dict): key-values for the new Application record



1) when app with this name already exist; 2) when data constraints
defined on the model violated
Create an application if model validation successful . Enforce unique name even when uniqueness not defined in the model . application_data ( dict ) : key - values for the new Application record 1 ) when app with this name already exist ; 2 ) when data constraints defined on the model violated
def _create(self, application_data):
        app_model = self.app_model()
        target_application = app_model(**application_data)
        name_field = target_application._meta.get_field('name')
        if not name_field.unique:
            name_field.validators.append(self.validate_unique)  
        if name_field.blank:
            name_field.blank = False  
        target_application.full_clean()  
        target_application.save()
        self.logger.info('Application %s successfully created.', application_data['name'])
def _create ( self , application_data ) : app_model = self . app_model ( ) target_application = app_model ( ** application_data ) name_field = target_application . _meta . get_field ( 'name' ) if not name_field . unique : name_field . validators . append ( self . validate_unique ) if name_field . blank : name_field . blank = False target_application . full_clean ( ) target_application . save ( ) self . logger . info ( 'Application %s successfully created.' , application_data [ 'name' ] )
Create an application, if model validation successful.
Create an application if model validation successful .
"""
        Create an application, if model validation successful. Enforce unique name, even when
        uniqueness not defined in the model.

        Args:
            application_data (dict): key-values for the new Application record

        Returns:
            None:

        Raises:
            ValidationError: 1) when app with this name already exist; 2) when data constraints
            defined on the model violated
        """ # ensure name is unique # do not allow blank app.name # trigger validation
self
application_data