MS SQL UUID like id

I have an existing project with MS SQL. and should continue it. on existing projects all table IDs in the database use UUID.
I found on the net how to use an MS SQL field. it’s working well. but have one problem. when I create a new object and save it - the object should receive a new ID from the database. but it doesn’t happen.
Someone can help me? what needs to be rewritten to receive the ID after saving?
thanks in advance!

from uuid import UUID
from django.db.models import UUIDField
from django.core.exceptions import ValidationError
class MssqlUUIDField(UUIDField):
def init(self, *args, **kwargs):
kwargs[‘max_length’] = 36
super(UUIDField, self).init(*args, **kwargs)

def db_type(self, connection):
    if self.primary_key:
        return 'uniqueidentifier default (newid())'
        return 'uniqueidentifier'

def contribute_to_class(self, cls, name, **kwargs):
    assert not self.primary_key or (
            self.primary_key and not cls._meta.auto_field), "A model can't have more than one AutoField."
    super().contribute_to_class(cls, name, **kwargs)
    if self.primary_key:
        cls._meta.auto_field = self

def get_db_prep_value(self, value, connection, prepared=False):
    if value is None:
        return None
    if not isinstance(value, UUID):
        value = self.to_python(value)
    return str(value)

def rel_db_type(self, connection):
    return 'uniqueidentifier'

def from_db_value(self, value, expression, connection):
    return self._to_uuid(value)

def to_python(self, value):
    return self._to_uuid(value)

def _to_uuid(self, value):
    if value is not None and not isinstance(value, UUID):
            return UUID(value)
        except (AttributeError, ValueError):
            raise ValidationError(
                params={'value': value},
    return value

class Category(models.Model):
id = MssqlUUIDField(primary_key=True, db_column=‘id’, default=None, editable=False)
title = models.CharField(max_length=255, db_column=‘title’)
created_at = models.DateTimeField(, db_column=‘created_at’)
def str(self):
return self.title