mdipierro | 1 Aug 2009 01:00
Picon
Gravatar

[web2py:27731] Re: Can I use HTTP PUT method?


I do not know for sure because PUT and DELETE are not standard http
methods. Try

request.vars
and
request.body.read()

Let us know.

On Jul 31, 2:28 am, 诚子 <zhicheng1...@...> wrote:
> Hi, I wan't use PUT method and DELETE method,to build a RESTful
> service,how to get an PUT method and DELETE data?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

mdipierro | 1 Aug 2009 01:01
Picon
Gravatar

[web2py:27732] Re: executing a sql script


This should work

On Jul 31, 2:37 am, Fran <francisb...@...> wrote:
> On Jul 31, 8:09 am, max <dulip.withan...@...> wrote:
>
> > for me the difficult part is to how i intgrate my xml parsing program
> > to the files which i have uploaded throgh web2py.
> > I want it  this way.
> > 1. Upload the xml file and a zip file
> >    implemented with web2py
> > 2. parse the content from the xml file and insert the data into a
> > mysql databse
> > i can generate the sql insert statesments with my xml parser.
> > interesting in knowing how i can insert this commands on the fly.
> > 3. copy the content of the zip file to a specific folder other than
> > upload folder
> > have  written a simple file copy mechanism,  how can i execute this
> > script using web2py
>
> Can this be done via an onvalidation callback?
> onvalidation = lambda form: myParser(form)
> form = crud.create(db.table_with_uploadfield,
> onvalidation=onvalidation)
>
> I'm interested in ensuring this works as I'll need it to be able to
> handle KMZ files & KML with Network Links inside...so pls feedback on
> whether onvalidation works as-is or whether upload fields need special
> handling...
>
(Continue reading)

mdipierro | 1 Aug 2009 01:03
Picon
Gravatar

[web2py:27733] Re: Yet another WEB2PY application


If you want to display the flash after redirect you should use
session.flash and not response.flash

On Jul 31, 10:13 am, Gijsbert <gijsbert.de.h...@...> wrote:
> I'm no expert, but I have flash followed by a redirect not work.
>
> On Jul 30, 6:23 am, Vidul Petrov <vidul.r...@...> wrote:
>
> >http://my-sticky-note.appspot.com/init/default/welcome(stillmissing
> > the demo)
>
> > Yes it's very small app, never-the-less the time went like this:
> >  - views / controllers / model: 5% (or less)
> >  - javascript / css: 95%
>
> > I encountered only one small problem - some of the aith.messages do
> > not appear in the flash, for example auth.messages.email_sent which
> > was supposed to appear right after the registration.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

mdipierro | 1 Aug 2009 01:04
Picon
Gravatar

[web2py:27734] Re: file downloading problem


which browser are you using? can you try wget and/or other browsers?

On Jul 30, 10:32 pm, 陶艺夫 <artman...@...> wrote:
> Hi,
> I'm using "response.stream(file_name)" method to offer users downloading
> files which are sort of business-classified, but the downloading process
> always terminated halfway. The testing file is 4.2M, an Excel workbook.
> Is there anything I can do with system configuration(CherryPy), or  it's
> just an internet problem?
>
> thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Jonathan Lundell | 1 Aug 2009 01:07
Picon
Favicon
Gravatar

[web2py:27735] Re: Can I use HTTP PUT method?


On Jul 31, 2009, at 4:00 PM, mdipierro wrote:

> I do not know for sure because PUT and DELETE are not standard http
> methods.

They are, actually; they're just not used by interactive web browsers.

http://en.wikipedia.org/wiki/Http#Request_methods

> Try
>
> request.vars
> and
> request.body.read()
>
> Let us know.
>
> On Jul 31, 2:28 am, 诚子 <zhicheng1...@...> wrote:
>> Hi, I wan't use PUT method and DELETE method,to build a RESTful
>> service,how to get an PUT method and DELETE data?
>

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

(Continue reading)

Yarko Tymciurak | 1 Aug 2009 01:14
Picon
Gravatar

[web2py:27736] Re: Can I use HTTP PUT method?

Hmmm....  check this page out:

http://www.w3.org/Amaya/User/Put.html

On Fri, Jul 31, 2009 at 6:07 PM, Jonathan Lundell <jlundell-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org> wrote:

On Jul 31, 2009, at 4:00 PM, mdipierro wrote:

> I do not know for sure because PUT and DELETE are not standard http
> methods.

They are, actually; they're just not used by interactive web browsers.

http://en.wikipedia.org/wiki/Http#Request_methods

> Try
>
> request.vars
> and
> request.body.read()
>
> Let us know.
>
> On Jul 31, 2:28 am, 诚子 <zhicheng1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Hi, I wan't use PUT method and DELETE method,to build a RESTful
>> service,how to get an PUT method and DELETE data?
>






--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web2py-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Bottiger | 1 Aug 2009 03:20
Picon

[web2py:27737] Re: OpenID for Web2Py


Is anyone working on incorporating OpenID with auth? I need to know
because I am not looking forward to duplicating effort again if
someone has already started or finished it.

On Jul 27, 1:07 am, hcvst <hcv...@...> wrote:
> Hi,
>
> when I first came across this post, I was working on a provider so I
> just posted my code.
> I think the only difference is that my version uses the Web2pyStore -
> the rest uses the Janrain
> Python openID library, just as Massimo's original implementation
> does.  As I had a working example, I
> did not look much deeper into what was already here, as the example
> here used the FileStore
> and I wanted to use the web2py DB.
>
> I do not know what Dave and his team are planning to build, but I
> guess it will be a bigger app.
>
> I am planning to add some helpers to w2popenid so that it's easier to
> use.  A bit like Auth()
>
> ---
> def server(): return dict(server=w2popenid.Server())
> def foo():
>       oresp = w2popenid.Consumer().check('myOpenID')
>       ...
> ---
>
>  <at> Dave, what are you building? :-) I really really need a full featured
> openID provider for web2py.
> My first attempt (the whole w2popenid thing is derived from it) is
> here:http://github.com/hcvst/icy-openid
> and intended to replace the php! provider athttp://icy.co.zaasap.
> Can we work together?
>
> Regards,
> HC
>
> On Jul 27, 7:45 am, Bottiger <bottig...@...> wrote:
>
> > So is hcvst part of your team of 3 people?
>
> > I don't understand why Massimo is asking you to maintain it when the
> > code seems to be coming from hcvst.
>
> > I am asking because I was trying to turn this into a cooperative
> > situation, and then two different people started hacking together
> > their own implementation. Not that I'm complaining, well actually I
> > am, because I felt like I just duplicated effort and didn't get any
> > recognition. But if you two are planning to do long term maintenance
> > and features, then I suppose I'm fine with that.
>
> > On Jul 26, 7:16 pm, dlypka <dly...@...> wrote:
>
> > > Great use of T3...
> > > OK, I will have a look in detail over the next few days..
> > > It is a wonderful contribution.
>
> > > On Jul 26, 7:00 am, hcvst <hcv...@...> wrote:
>
> > > > Hi,
>
> > > > both the consumer and the provider sample apps are now available for
> > > > download fromhttp://w2popenid.appspot.com
>
> > > > I have also include some rudimentary HOWTOs on how to use them and on
> > > > how
> > > > to build your own.
>
> > > > Code and doc still require clean-up, but I am sure you did not expect
> > > > anything else.
>
> > > >  <at> Dave, I have also tried to address your questions regarding XRI and
> > > > provider usage
> > > > in general.
>
> > > > Regards,
> > > > HC
>
> > > > =hc
>
> > > > On Jul 26, 12:29 pm, dlypka <dly...@...> wrote:
>
> > > > > I have my own team of 3 developers now, and web2py openid happens to
> > > > > be our current task,
> > > > > so I believe we have the manpower to help with and/or maintain it.
> > > > > I'll keep everyone here posted with our progress and source code.
>
> > > > > We also have some changes for T3.
>
> > > > > - Dave Lypka.
>
> > > > > On Jul 25, 9:03 am, mdipierro <mdipie...@...> wrote:
>
> > > > > > Keep us posted. It would be great if you could post and be the
> > > > > > maintainer of a web2py openid app.
>
> > > > > > Massimo
>
> > > > > > On Jul 25, 6:49 am, dlypka <dly...@...> wrote:
>
> > > > > > > Hi:
>
> > > > > > > I triedhttp://w2popenid.appspot.com/oidconsumer
>
> > > > > > > It is amazing to see the web2py Admin page up on the App Engine.
>
> > > > > > > A few results:
>
> > > > > > > 1. dly...@... does NOT work.
> > > > > > >    I (and my associates) want the standard email address to work. The
> > > > > > > URL Open ID is too clunky for most people we deal with.
>
> > > > > > > 2. I tried a URL version of my OpenID, which is
>
> > > > > > >        http://openid-provider.appspot.com/dlypka
>
> > > > > > >    That got me to the Open ID page, but it asked me to first log into
> > > > > > > Google, which I believe is wrong, since I am already logged in to this
> > > > > > > web2py forum.
>
> > > > > > >    So I conclude that the API is working great from web2py on GAE  to
> > > > > > > OpenID, but it would be nice to have it recognize that I am already
> > > > > > > logged into Google.
> > > > > > >    However I went ahead and did the Google login that it was asking
> > > > > > > for, and then I did the the Yes response and it then gave me that page
> > > > > > > with
> > > > > > >    the response codes:
>
> > > > > > > resp    :       <openid.consumer.consumer.SuccessResponse id='http://openid-
> > > > > > > provider.appspot.com/dlypka' signed=['openid.return_to',
> > > > > > > 'openid.mode', 'openid.identity', 'openid.sreg.nickname']>
> > > > > > > admin request session response
>
> > > > > > > That was great!
>
> > > > > > > Then I closed the browser and went back in to try it all a second
> > > > > > > time, and this time it did NOT ask me to log into Google.
> > > > > > > So that was good, that it recognized my current Google login which it
> > > > > > > had "seen' me do 'inside' OpenID
> > > > > > > I assume it does not recognize my previous login to this forum,
> > > > > > > because it was done 'outside' of OpenID.
>
> > > > > > > I guess OpenID only recognizes logins which were done 'inside' its
> > > > > > > API.
> > > > > > > If so, that is a big negative for the immediate future. It means at
> > > > > > > the moment, the regular user would have to find the 'special' OpenID-
> > > > > > > enabled
> > > > > > > login page for a given website in order to benefit from OpenID.
>
> > > > > > > -------------------------------------------------------------------------
>
> > > > > > > I looked athttp://pastebin.co.za/22362
> > > > > > > For that, it looks like one needs to also have the code for
> > > > > > > openid.store
> > > > > > > I assume the word 'store' means 'storage', rather an a 'store' where
> > > > > > > one buys things...
>
> > > > > > > Then I downloaded web2py.app.oidconsumer.w2p.gz
> > > > > > > I extracted it and got the oidconsumer.w2p, but web2py failed to be
> > > > > > > able to install it.
> > > > > > > So I renamed the .w2p to be a .tar and I unpacked it with winrar.
> > > > > > > That gave me the oidconsumer folder with all the source.
> > > > > > > I copied that folder into my web2py v 1.65.5 Applications folder
> > > > > > > and voila, it ran perfectly and still recognized my previous Google
> > > > > > > login (which I had done 'inside' OpenID).
> > > > > > > So I guess the code for openid.store is in there somewhere...
>
> > > > > > > Next I will try it on App Engine. I assume it will work.
>
> > > > > > > Thanks so much!
>
> > > > > > > On Jul 24, 8:21 am, hcvst <hcv...@...> wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > I've uploaded a working openid consumer tohttp://w2popenid.appspot.com/oidconsumer
> > > > > > > > It uses the Web2pyStore I posted above (http://pastebin.co.za/22362)
> > > > > > > > and a custom fetcher (Web2pyFetcher) that permits headers etc. to be
> > > > > > > > send.
>
> > > > > > > > Please see whether it works for you. My battery is about to die, so I
> > > > > > > > don't have time to
> > > > > > > > post the source. Will post it later.
>
> > > > > > > > Cheers,
> > > > > > > > HC
>
> > > > > > > > You can download the app fromhttp://w2popenid.appspot.com/
>
> > > > > > > > On Jul 23, 4:16 pm, Hans Donner <hans.don...@...> wrote:
>
> > > > > > > > > Don't know about the content like the name of the nick, you should be
> > > > > > > > > able to tell.
> > > > > > > > > But the fact you get shown a nick indicates everything went well.
>
> > > > > > > > > Remember, it's now only a proof of concept app, so nothing usefull is
> > > > > > > > > yet done besides getting your openid info
>
> > > > > > > > > On Thu, Jul 23, 2009 at 12:05, dlypka<dly...@...> wrote:
>
> > > > > > > > > > Thanks so much for this work.
> > > > > > > > > > I tried it.
>
> > > > > > > > > > It correctly took me to the Open ID confirmation athttp://openid-provider.appspot.com
> > > > > > > > > > and then  I clicked Yes.
> > > > > > > > > > This is the result I got back:
>
> > > > > > > > > > message
> > > > > > > > > > :
> > > > > > > > > > something heppened:{'url': 'http://openid-provider.appspot.com/
> > > > > > > > > > dlypka', 'pape': <openid.extensions.draft.pape5.Response object at
> > > > > > > > > > 0x017CDD70>, 'sreg': [('nickname', 'dlypka')]}
> > > > > > > > > > admin request session response
>
> > > > > > > > > > Is this the response to be expected?
>
> > > > > > > > > > I am not sure what the expected result should be.
>
> > > > > > > > > > Thanks.
>
> > > > > > > > > > On Jul 21, 7:57 pm, Bottiger <bottig...@...> wrote:
> > > > > > > > > >> I've uploaded to my website the minimal version of the working OpenID
> > > > > > > > > >> implementation application. Just unzip in your application directory
> > > > > > > > > >> and go tohttp://127.0.0.1:8000/openid/client/startOpenIDtostart.
>
> > > > > > > > > >> I couldn't create a w2p file from it because Web2Py kept complaining
> > > > > > > > > >> about an internal error.
>
> > > > > > > > > >>http://www.codexon.com/temp/openid.zip
>
> > > > > > > > > >> On Jul 21, 4:27 pm, Bottiger <bottig...@...> wrote:
>
> > > > > > > > > >> > Yes, I accidentally missed your 2nd message and fixed it on my own. I
> > > > > > > > > >> > also found another error.
>
> > > > > > > > > >> > So as a canonical reference, here are the 3 things that need to be
> > > > > > > > > >> > edited to get Massimo's OpenID to work.
>
> > > > > > > > > >> > 1.
>
> > > > > > > > > >> > trust_root = 'http://127.0.0.1:8000/openid/client/startOpenID
> > > > > > > > > >> > change this to
> > > > > > > > > >> > trust_root = 'http://127.0.0.1:8000/openid/client/
>
> > > > > > > > > >> > 2.
>
> > > > > > > > > >> > remove this extraneous line at 105. It creates a URL html tag when it
> > > > > > > > > >> > is supposed to be a simple URL.
>
> > > > > > > > > >> > return_to = URL(r=request,f='finishOpenID')
>
> > > > > > > > > >> > 3.
>
> > > > > > > > > >> > change this at line 130. sreg_response was None for
>
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

suiato | 1 Aug 2009 04:03
Picon

[web2py:27738] Re: Can I use HTTP PUT method?


CouchDB seems to support PUT.

--
Teru

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

Bottiger | 1 Aug 2009 04:04
Picon

[web2py:27739] Re: Can I use HTTP PUT method?


You will need to do request.body.read() for PUT. Web2Py does not parse
the body of PUT requests.

Example:

Request:

PUT /test/default/ HTTP/1.1
Content-Length: 21

blah blah hello hello

Output:

Body
"blah blah hello hello"

On Jul 31, 12:28 am, 诚子 <zhicheng1...@...> wrote:
> Hi, I wan't use PUT method and DELETE method,to build a RESTful
> service,how to get an PUT method and DELETE data?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web2py@...
To unsubscribe from this group, send email to web2py+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Alastair Medford | 1 Aug 2009 04:32
Picon

[web2py:27740] Re: Table reference question


Thanks for the responses.

> db.student.student_id.requires=IS_NOT_IN_DB(db,'student.student_id')
> db.tasks.student.requires=IS_IN_DB(db,'student.id','%(student_id)s')
> db.tasks.student.represent=lambda id: db.student[id].student_id

This seems to accomplish what I was trying to do, thanks. However, I'm
in the dark as to what some of the syntax is. In the second line, I
know that the third argument has something to do with how the drop
down box chooses it's contents, but I do not understand the syntax of
'%(student_id)s'. Also, in the 3rd line I do not know what "lambda id:
" is doing. If this is standard python fare, then I apologise as I'm
still learning python and all it's syntax tricks. Thanks again.

Also sorry massimo is you see this twice, I think I hit reply to
author instead of reply.

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


Gmane