Ejemplo n.º 1
0
 def render_uploadframe(self, request):
     form = """
 <form method="post" enctype="multipart/form-data" action="%s">
   <input type="file" name="uploaded-file" />
   <input type="hidden" name="submitID" value="" />
   <input type="hidden" name="callbackID" value="" />
 </form>""" % helpers.url(request.node, "uploadfile")
     return self.getTinyTemplate() % form
Ejemplo n.º 2
0
 def render_uploadframe(self, request):
     form = """
 <form method="post" enctype="multipart/form-data" action="%s">
   <input type="file" name="uploaded-file" />
   <input type="hidden" name="submitID" value="" />
   <input type="hidden" name="callbackID" value="" />
 </form>""" % helpers.url(request.node, "uploadfile")
     return tinyTemplate % form
Ejemplo n.º 3
0
 def render_edit(self, request):
     fieldName = self.fieldName()
     field = '<input type="hidden" name="warpform-%s" class="warpform-upload" />' % fieldName
     iframe = '<iframe name="%s" src="%s" width="300" height="50" id="iframe-%s"></iframe>' % (
         fieldName,
         url(request.node, "uploadframe"),
         fieldName)
     return field + iframe
Ejemplo n.º 4
0
    def render_edit(self, request):
        objID = int(request.resource.args[0])
        obj = store.get(self.model, objID)

        return helpers.renderTemplateObj(request,
                                         self._getCrudTemplate(),
                                         obj=self.crudModel(obj),
                                         redirect=helpers.url(request.node, 'view', request.resource.args))
Ejemplo n.º 5
0
    def render_delete(self, request):
        objID = int(request.resource.args[0])
        obj = store.get(self.model, objID)

        if obj is not None:
            store.remove(obj)
            store.commit()

        request.redirect(helpers.url(request.node))
        return "Redirecting..."
Ejemplo n.º 6
0
    def render_delete(self, request):
        objID = int(request.resource.args[0])
        obj = request.store.get(self.model, objID)

        if obj is not None:
            request.store.remove(obj)
            request.store.commit()

        request.redirect(helpers.url(request.node))
        return "Redirecting..."
Ejemplo n.º 7
0
 def render_view(self, request):
     return '<img src="%s" />' % url(
         request.node, "image", 
         (self.obj.__class__.__name__, self.obj.id, self.col))
Ejemplo n.º 8
0
 def saveRedirect(self, request):
     return helpers.url(request.node, 'view', request.resource.args)
Ejemplo n.º 9
0
 def saveRedirect(self, request):
     return helpers.url(request.node, 'view', request.resource.args)
Ejemplo n.º 10
0
 def render_edit(self, request):
     fieldName = self.fieldName()
     field = '<input type="hidden" name="warpform-%s" class="warpform-upload" />' % fieldName
     iframe = '<iframe name="%s" src="%s" width="300" height="50" id="iframe-%s"></iframe>' % (
         fieldName, url(request.node, "uploadframe"), fieldName)
     return field + iframe
Ejemplo n.º 11
0
 def render_view(self, request):
     return '<img src="%s" />' % url(
         request.node, "image",
         (self.obj.__class__.__name__, self.obj.id, self.col))