def save(self): catalog = Catalog(name=self.cleaned_data['name']) parent = self.cleaned_data.get('parent', None) if parent: catalog.parent = Catalog.get(parent) return catalog
def save(self): form = Form(name=self.cleaned_data['name']) form.catalog = Catalog.get(self.cleaned_data['catalog']) return form