I added a slug field to my database and now need to go through and add those. I want to run a script that looks at the slug field in the database and if empty generates and saves. Here is what I thought was along the lines, but is not working.
from project.apps.tracks.models import *
def process_slug():
if not track.slug:
slug = slugify("%s - %s" % (track.name, track.artist))
else:
slug = ""
super(process_slug, track).save()