I am working through the Intermediate Concepts book and on page 42 ran into an issue, perhaps with the wording of the comment.
our helper, add above the new model
def get_image_path(instance, filename):
return ‘/’.join([‘thing_images’, instance.thing.slug, filename])
class Upload(models.Model):
thing = models.ForeignKey(Thing, related_name=“uploads”)
image = models.ImageField(upload_to=get_image_path)
I add that into my webapp and then try to run the makemigrations but it gives an error.
class Upload(Timestamp):
^
SyntaxError: invalid syntax
Not sure why it is invalid. Thanks for any help.