def save(self, *args, **kwargs): self.path = Subsection.build_path(self.key, self.section) self.uri = get_uri_prefix(self) + '/questions/' + self.path super(Subsection, self).save(*args, **kwargs) for entity in self.entities.all(): entity.save()
def save(self, *args, **kwargs): self.path = Section.build_path(self.key, self.catalog) self.uri = get_uri_prefix(self) + '/questions/' + self.path super(Section, self).save(*args, **kwargs) for subsection in self.subsections.all(): subsection.save()
def save(self, *args, **kwargs): try: self.path = QuestionEntity.build_path(self.key, self.subsection, self.parent) except AttributeError: self.path = QuestionEntity.build_path(self.key, self.subsection) self.uri = get_uri_prefix(self) + '/questions/' + self.path super(QuestionEntity, self).save(*args, **kwargs) for question in self.questions.all(): question.save() # invalidate the cache so that changes appear instantly caches['api'].clear()
def save(self, *args, **kwargs): self.path = AttributeEntity.build_path(self.key, self.parent) self.uri = get_uri_prefix(self) + '/domain/' + self.path self.is_attribute = self.is_attribute or False # loop over parents to find parent collection self.parent_collection = None parent = self.parent while parent: # set parent_collection if it is not yet set and if parent is a collection if not self.parent_collection and parent.is_collection: self.parent_collection = parent break parent = parent.parent super(AttributeEntity, self).save(*args, **kwargs) # recursively save children for child in self.children.all(): child.save()
def build_uri(self): return get_uri_prefix(self) + '/tasks/' + self.key
def build_uri(self): return get_uri_prefix(self) + '/conditions/' + self.key
def save(self, *args, **kwargs): self.uri = get_uri_prefix(self) + '/questions/%s' % self.key super(Catalog, self).save(*args, **kwargs) for section in self.sections.all(): section.save()
def save(self, *args, **kwargs): self.uri = get_uri_prefix(self) + '/options/' + self.label super(OptionSet, self).save(*args, **kwargs) for option in self.options.all(): option.save()
def save(self, *args, **kwargs): self.path = Option.build_path(self.key, self.optionset) self.uri = get_uri_prefix(self) + '/options/' + self.path super(Option, self).save(*args, **kwargs)