I want to create a method inside a model which can be called on a parameter of an attribute to populate it. I thought of doing it this way but it gives me an error `NameError: name 'self' is not defined`.

```py
class Host(User):
    class Meta:
        verbose_name = "Host"
        verbose_name_plural = "Hosts"
    def gen_path(self):
        path = 'static/{userdir}'.format(userdir=self.email)
        os.mkdir(path)
        return path
    hostpic = models.ImageField(verbose_name='Host Profile Image', upload_to=self.gen_path(), null=True)

```

What could be a workaround for this?