I'm trying to make a directory that is okay to appear in a URL. I want to ensure that it doesn't contain any special characters and replace any spaces with hyphens. 

```
from os.path import join as osjoin
def image_dir(self, filename):
    categorydir = ''.join(e for e in  str(self.title.lower()) if e.isalnum())
    return "category/" + osjoin(categorydir, filename)

```

It's removing special characters however I'd like use `.replace(" ", "-")` to swap out spaces with hyphens