def _team_member_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-photo.{ext}" return join('img', 'web', 'team', filename)
def _candidate_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-photo.{ext}" return join('img', 'elections', 'MEP-2019', 'candidates', self.party, filename)
def _mentor_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-photo.{ext}" return join('img', 'web', 'menthor', filename)
def _candidate_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-photo.{ext}" return join('img', 'elections', 'meras-2019', 'candidates', self.municipality.slug, filename)
def _article_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.title) filename = f"{slug}-photo.{ext}" candidate = self.article.candidate.slug return join('img', 'elections', 'president-2019', 'candidates', 'articles', candidate, filename)
def _user_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.get_full_name()) if self.is_politician: foldername = 'politicians' else: foldername = 'users' filename = f"{slug}-photo.{ext}" return join('img', foldername, filename)
def _pet_photo_file(self, filename): ext = file_extension(filename) if self.pet: slug = slugify(self.pet.name) filename = f"{slug}-photo-{self.order}.{ext}" return join('img', 'web', 'pet', slug, 'profile', filename) else: filename = f"{uuid.uuid4()}-photo.{ext}" return join('img', 'web', 'pet', 'all', 'profile', filename)
def _pet_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-photo.{ext}" return join('img', 'web', 'pet', slug, filename)
def _shelter_square_logo_file(self, filename: str) -> str: ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-square-logo.{ext}" return join('img', 'web', 'shelter', slug, filename)
def _politician_photo_file(self, filename): ext = file_extension(filename) filename = f"{self.slug}-photo.{ext}" return join('img', 'seimas', 'politician', self.slug, filename)
def _monitoring_attachments(self, filename): ext = file_extension(filename) date = django_now() filename = f"{filename}-attachment-{date}.{ext}" return join('attachments', 'politicians', filename)
def _organization_partner_logo_file(self, filename): ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-photo.{ext}" return join('img', 'zkr', 'partners', filename)
def _organization_member_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-photo.{ext}" return join('img', 'zkr', 'member', filename)
def _moderator_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-photo.{ext}" return join('img', 'elections', 'moderators', self.slug, filename)
def _candidate_photo_file(self, filename): ext = file_extension(filename) slug = slugify(self.name) filename = f"{slug}-photo.{ext}" return join('img', 'elections', 'seimas-2020', 'candidates', filename)