def save(self, *args, **kwargs): # create corresponding directory object from pootle_app.models.directory import Directory self.directory = Directory.objects.root.get_or_make_subdir(self.code) # Apply markup filter self.description_html = apply_markup_filter(self.description) super(Language, self).save(*args, **kwargs)
def save(self, *args, **kwargs): # Create file system directory if needed project_path = self.get_real_path() if not os.path.exists(project_path): os.makedirs(project_path) from pootle_app.models.directory import Directory self.directory = Directory.objects.projects.get_or_make_subdir(self.code) # Apply markup filter self.description_html = apply_markup_filter(self.description) super(Project, self).save(*args, **kwargs)
def save(self, *args, **kwargs): # Create file system directory if needed project_path = self.get_real_path() if not os.path.exists(project_path): os.makedirs(project_path) from pootle_app.models.directory import Directory self.directory = Directory.objects.projects.get_or_make_subdir( self.code) # Apply markup filter self.description_html = apply_markup_filter(self.description) super(Project, self).save(*args, **kwargs)
def save(self, *args, **kwargs): created = self.id is None project_dir = self.project.get_real_path() from pootle_app.project_tree import get_translation_project_dir self.abs_real_path = get_translation_project_dir(self.language, project_dir, self.file_style, make_dirs=True) self.directory = self.language.directory \ .get_or_make_subdir(self.project.code) self.pootle_path = self.directory.pootle_path # Apply markup filter self.description_html = apply_markup_filter(self.description) super(TranslationProject, self).save(*args, **kwargs) if created: self.scan_files()
def save(self, *args, **kwargs): created = self.id is None project_dir = self.project.get_real_path() from pootle_app.project_tree import get_translation_project_dir self.abs_real_path = get_translation_project_dir(self.language, project_dir, self.file_style, make_dirs=True) self.directory = self.language.directory.get_or_make_subdir( self.project.code) self.pootle_path = self.directory.pootle_path # Apply markup filter self.description_html = apply_markup_filter(self.description) super(TranslationProject, self).save(*args, **kwargs) if created: self.scan_files()
def save(self, *args, **kwargs): """Applies a markup filter to populate `body_html` upon saving.""" self.body_html = apply_markup_filter(self.body) super(LegalPage, self).save(*args, **kwargs)