def assign_style(self, featuretype, style_name):
        """
        Assign a configured style to a configured layer.

        @keyword featuretype: The type of the feature.
        @keyword style_name: The name of the style.
        """
        if not style_name == 'polygon':
            style_name = '%s:%s' % (self.ns, style_name)

        # Apply the uploaded style to the demographic layers
        layer = { 'layer' : {
            'defaultStyle': {
                'name': style_name
            },
            'enabled': True
        } }

        if self._rest_config( 'PUT', '/geoserver/rest/layers/%s:%s' % (self.ns, featuretype,), data=json.dumps(layer)):
            return True
        
        return False
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/config.py/SpatialUtils.assign_style/original