def campaign_media(instance, filename):
    """Return an upload file path for a campaign media attachment."""
    if not instance.campaign.id:
        instance.campaign.save()
    return 'campaign/{0}/{1}'.format(instance.campaign.id, filename)