def get_field(self, schema):
type = schema.get_type(self.schema_type)<EOL>logger.debug('<STR_LIT>' %(self.schema_type, type.base_type(), type.restricted_values))<EOL>kwargs = {}<EOL>if type.restricted_values:<EOL><INDENT>choices = []<EOL>choices.extend(type.restricted_values)<EOL>if '<STR_LIT>' in choices:<EOL><INDENT>choices.remove('<STR_LIT>')<EOL><DEDENT>choices.insert(<NUM_LIT:0>, '<STR_LIT>')   <EOL>kwargs['<STR_LIT>'] = choices<EOL><DEDENT>basetype = type.base_type()<EOL>if basetype == '<STR_LIT:string>':<EOL><INDENT>newfield = StringField(self.xpath, required=self.required, **kwargs)<EOL>newfield.creation_counter = self.creation_counter<EOL>return newfield<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>" % basetype)<EOL><DEDENT>
Get the requested type definition from the schema and return the
        appropriate :class:`~eulxml.xmlmap.fields.Field`.

        :param schema: instance of :class:`eulxml.xmlmap.core.XsdSchema`
        :rtype: :class:`eulxml.xmlmap.fields.Field`