コード例 #1
0
ファイル: views.py プロジェクト: reebalazs/bottlecap
    def add_folder(self):
        POST = self.request.POST
        if 'form.submitted' in POST:
            title = POST.get('title')
            author = POST.get('author')
            if title and author:
                # Valid form, add some data
                folder = Folder()
                folder.title = title
                folder.author = author
                folder.type = 'folder'
                folder.modified = _now()
                self.context[_title_to_name(title, self.context)] = folder
                return Response('ok')

        return render_to_response('templates/add_folder.pt', {})
コード例 #2
0
ファイル: views.py プロジェクト: reebalazs/bottlecap
    def add_file(self):
        #XXX this needs to change to use a real File type, with an uploaded
        #    body.
        POST = self.request.POST
        if 'form.submitted' in POST:
            title = POST.get('title')
            author = POST.get('author')
            if title and author:
                # Valid form, add some data
                folder = Folder()
                folder.title = title
                folder.author = author
                folder.type = 'folder'
                folder.modified = _now()
                self.context[_title_to_name(title, self.context)] = folder
                return Response('ok')

        return render_to_response('templates/add_file.pt', {})