def choose_lecture_materials_filename(instance, original): extension = os.path.splitext(original)[1] lecture_slug = slugify(unicode(instance))[:74] return "%s/%s%s" % (instance.event.date.isoformat(), lecture_slug, extension)
def add_team_slug(apps, schema_editor): Team = apps.get_model('events', 'Team') for team in Team.objects.all(): team.slug = slugify(team.name) team.save()
def choose_invitation_filename(instance, original): return "%s/invitation-%s.pdf" % (instance.date.isoformat(), slugify(unicode(instance))[:74])