saving the slug with self.id

    # https://stackoverflow.com/a/11993818/126833
    def save(self, *args, **kwargs):
        print("self.id = ", self.id)
        if not self.id:
            # https://forum.djangoproject.com/t/slugify-with-multiple-fields/10919
            self.slug = slugify(f"{self.title}-{self.company}")
        super(Job, self).save(*args, **kwargs)

I want to store the slug with the id - self.slug = slugify(f"{self.title}-{self.company}-{self.id}") - how do I get the ID when its just getting created and not yet available ?

From the docs at Model instance reference | Django documentation | Django

There’s no way to tell what the value of an ID will be before you call save() , because that value is calculated by your database, not by Django.