예제 #1
0
    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
예제 #2
0
 def save(self):
     form = Form(name=self.cleaned_data['name'])
     form.catalog = Catalog.get(self.cleaned_data['catalog'])
     return form