I have to retract my previous post... this does appear to be working
for me.  I can use "self.request.get('description')" to retrieve the
text description form field.  My previous problem was that
name='descripton' was spelled wrong in my html form (missing the last
'i')... doh!

I think your issue is that you lose your "self.response.out.write(N)"
content when you redirect via "return self.redirect('/')"... that
response body content won't survive the redirect (the redirect will
provide its own content).  If you need to return the submitted N and S
content then perhaps you could redirect to a URL that takes the 'a'
object key as a parameter "self.redirect('/' +
urllib.quote(a.key()))".  Of course you'd have to setup your handler
to accept the parameter... but then you could re-retrieve 'a' object
in the handler via a datastore get such as "a = db.get(a_key)"...
assuming 'a_key' is the name of the parameter.


On Feb 13, 1:54 am, theone <maliha...@gmail.com> wrote:
> I think you are right about BlobstoreUploadHandler limitations. When I
> tried something like:
> class X(db.Model):
>     N = db.StringProperty()
>     S = db.StringProperty()
>     F = blobstore.BlobReferenceProperty()
>
> class Upload(blobstore_handlers.BlobstoreUploadHandler):
>     def post(self):
>         upload_files = self.get_uploads('file')
>         a=upload_files[0]
>         N = self.request.get('name')
>         S = self.request.get('sname')
>         if S:
>             m=N + S
>         else:
>             m=S + N
>         self.response.out.write(N)
>         self.response.out.write(S)
>         a=X(N=m, S=S, F=a)
>         a.put()
>         return self.redirect('/')
>
> It worked partly. I mean I put my model to datastore and file to
> blobstore. However, it does not writes the thing like:
> self.response.out.write(N). What I understand here we cannot use
> everything in BlobstoreUploadHandler.
>
> Also if you request the form fields, it does not work.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to