def register_model_converter(model, name=None, field='<STR_LIT>', base=IntConverter, queryset=None):
if name is None:<EOL><INDENT>name = camel_to_snake(model.__name__)<EOL>converter_name = '<STR_LIT>'.format(model.__name__)<EOL><DEDENT>else:<EOL><INDENT>converter_name = '<STR_LIT>'.format(snake_to_camel(name))<EOL><DEDENT>if isinstance(base, str):<EOL><INDENT>base = get_converter(base).__class__<EOL><DEDENT>converter_class = type(<EOL>converter_name,<EOL>(ModelConverterMixin, base,),<EOL>{'<STR_LIT>': model, '<STR_LIT>': field, '<STR_LIT>': queryset}<EOL>)<EOL>register_converter(converter_class, name)<EOL>
Registers a custom path converter for a model.

:param model: a Django model
:param str name: name to register the converter as
:param str field: name of the lookup field
:param base: base path converter, either by name or as class
             (optional, defaults to `django.urls.converter.IntConverter`)
:param queryset: a custom querset to use (optional, defaults to `model.objects.all()`)