[web2py] Determining when a stream has completed sending.

2010-01-24 Thread jlegler
This is more of a general python question but maybe someone here knows if my idea will work or not. I want my function to tell me when it is done running. Currently I return the stream so there is no obvious way to run code after it returns a value. I am wondering if I do a try: finally: stateme

[web2py] Re: Logging when files are downloaded from the static directory

2010-01-21 Thread jlegler
27;stop',datetime')) > > def static(): >     import datetime >     path = os.path.join(request.folder,'static','/'.join > (request.args)) >     db.mylog(filename=path,start=datetime.datetime.now()) >     return response.stream(open(path,'rb')

[web2py] Logging when files are downloaded from the static directory

2010-01-21 Thread jlegler
Is there any way to log when files are downloaded from the static directory of an app and see when they started downloading and when they completed? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googl

[web2py] Re: Need help streaming mp4 video

2010-01-20 Thread jlegler
Argh!!!, Windows!!! It works fine on Redhat. There must be firewall hijinks. Thanks for all of your help Massimo. Web2py is making something that should have taken months seem frustrating because I can't do it in a day. Fantastic code. -jason On Jan 20, 5:07 pm, jlegler wrote: > H

[web2py] Re: Need help streaming mp4 video

2010-01-20 Thread jlegler
Here is a question. When a file larger than 1MB is sent from the static directory, is is streamed? If so can I look at the headers and payload to determine what is different? On Jan 20, 3:50 pm, jlegler wrote: > I don't think it is a player issue.  If I point my browser to the &g

[web2py] Re: Need help streaming mp4 video

2010-01-20 Thread jlegler
chment, filename="' + filename + '"' return response.stream(open(path),chunk_size=4096) else: redirect(URL(request.application,'default','index')) On Jan 20, 3:18 pm, mdipierro wrote: > I do not know. It is a player issue. web2py s

[web2py] Re: Need help streaming mp4 video

2010-01-20 Thread jlegler
ierro wrote: > The code below looks right to me. What is the problem exactly? > > Did you try access > > http:///app/controller/stream/[id] > > On Jan 20, 7:05 am, jlegler wrote: > > > I am building an app for work to demo some streaming functionality. > > I

[web2py] Need help streaming mp4 video

2010-01-20 Thread jlegler
I am building an app for work to demo some streaming functionality. I've built the entire client in web2py and need to stream some video. I need a way to stream mp4 content without using a tool like XmooV to do it (because PHP is not running on this server and it will be incredibly difficult to get

[web2py:30392] Re: Problem with WebFaction

2009-09-08 Thread jlegler
If you take a look at this thread I posted an example of my configuration that is working great with webfaction. http://groups.google.com/group/web2py/browse_thread/thread/25d8ee282ed23af2/5f9dfff0b81ebd29?hl=en&lnk=gst&q=webfaction#5f9dfff0b81ebd29 --~--~-~--~~~---~--

[web2py:29642] Re: Web2py and Webfaction

2009-08-30 Thread jlegler
Try running it like this: python2.5 web2py -p 80 By default, webfaction runs python 2.4 so if you don't specify 2.5 you may run into problems. I had really good luck following instructions written by dhmorgan and yarko in webfaction's forums. You can view it at http://forum.webfaction.com/view

[web2py:16796] Re: This seems like it should be easy, but checkboxes are killing me in custom forms.

2009-02-23 Thread jlegler
hecked' >        else: response.flash='not checked' >    return dict(form=form) > > On Feb 22, 9:58 pm, jlegler wrote: > > > If I have a custom form, I seem to always have the checkbox returning > > the same result whether it is checked or not.  Does anyone

[web2py:16755] This seems like it should be easy, but checkboxes are killing me in custom forms.

2009-02-22 Thread jlegler
If I have a custom form, I seem to always have the checkbox returning the same result whether it is checked or not. Does anyone have any examples on how to make the checkbox return different results depending on whether it is checked or not? All I want to do is have the checkbox represent whethe

[web2py:16753] Re: Does new CRUD have T2 Style Stamping?

2009-02-22 Thread jlegler
earing on forms (except > readonly forms). default and update set the default values when a > record is created/updated. > > Hope this makes sense. > > Massimo > > On Feb 22, 1:10 pm, jlegler wrote: > > > T2 had a cool feature that would show when a table was updated

[web2py:16701] Does new CRUD have T2 Style Stamping?

2009-02-22 Thread jlegler
T2 had a cool feature that would show when a table was updated and by whom as long as the appropriate fields existed in the table (created_by_ip, created_on, created_by, created_signature, modified_by_ip, modified_on, modified_by, modified_signature). Does the new Crud class have any of that func

[web2py:16544] Re: web2py is just clean fun

2009-02-18 Thread jlegler
This is exactly how I feel. I started using web2py to do a very small project at work and the project's scope has expanded dramatically because I am able to do things so quickly with it. I really haven't found a truly showstopping issue yet and when I do get hung up I post on here and have a fix

[web2py:16486] Re: PostgreSQL conflicts with tables already existing when model code is run

2009-02-17 Thread jlegler
= False. > > Massimo > > On Feb 17, 6:12 pm, jlegler wrote: > > > Actually, looking at the web2py manual, I shouldn't have to specify > > migrate=False.  If the table exists and corresponds to the definition, > > it should do nothing.  Anyone know why this is not th

[web2py:16479] Re: PostgreSQL conflicts with tables already existing when model code is run

2009-02-17 Thread jlegler
Actually, looking at the web2py manual, I shouldn't have to specify migrate=False. If the table exists and corresponds to the definition, it should do nothing. Anyone know why this is not the case when using postgresql? -jason On Feb 17, 4:09 pm, jlegler wrote: > Oops, should have

[web2py:16478] Re: PostgreSQL conflicts with tables already existing when model code is run

2009-02-17 Thread jlegler
ignore them? -jason On Feb 17, 4:03 pm, jlegler wrote: > I've been developing a webapp against sqlite and in the process of > moving it to postgresql for production I have run into some problems. > This is the latest one: > > When using postgresql, web2py is complaining that

[web2py:16477] PostgreSQL conflicts with tables already existing when model code is run

2009-02-17 Thread jlegler
I've been developing a webapp against sqlite and in the process of moving it to postgresql for production I have run into some problems. This is the latest one: When using postgresql, web2py is complaining that tables defined in my model already exist. For example, when I call: auth.define_table

[web2py:16476] Re: Possible bug with Auth using postgresql and web2py 1.56.2

2009-02-17 Thread jlegler
t; Massimo > > > On Feb 16, 11:50 am, jlegler wrote: > > > > Yea, It is still throwing the same error. > > > > IntegrityError: insert or update on table "auth_event" violates > > > foreign key constraint "auth_event_user_id_fkey" > > &

[web2py:16392] Re: Possible bug with Auth using postgresql and web2py 1.56.2

2009-02-16 Thread jlegler
e > it one more try. > > Massimo > > On Feb 16, 10:19 am, jlegler wrote: > > > Did you put this in the SVN trunk?  If so it is still happening. > > > -jason > > > On Feb 15, 6:44 am, mdipierro wrote: > > > > Check if this is now fixed in trun

[web2py:16385] Re: Possible bug with Auth using postgresql and web2py 1.56.2

2009-02-16 Thread jlegler
Did you put this in the SVN trunk? If so it is still happening. -jason On Feb 15, 6:44 am, mdipierro wrote: > Check if this is now fixed in trunk.. in 5 minutes > > On Feb 14, 11:25 am, jlegler wrote: > > > Okay, thanks.  I will see if I can find any side effects from doi

[web2py:16332] Re: Multiple Forms Issue

2009-02-14 Thread jlegler
Actually, looking at this a bit closer, your second form is making a call against db.recurso which changes your formkey and makes web2py think you are tampering with the form when you try to submit the first form. If I were you and wanted to make this really easy, I would make sure I am running w

[web2py:16330] Re: Multiple Forms Issue

2009-02-14 Thread jlegler
Do you have anything in the view or are you just using a generic view? On Feb 13, 12:41 pm, vamaq wrote: > Hi everybody, > > I'm having a problem with a multiple form page. When I submit the > first form (called form) I get the "user is tampering with form" error > at the trace. > > The model is

[web2py:16328] Re: Possible bug with Auth using postgresql and web2py 1.56.2

2009-02-14 Thread jlegler
Okay, thanks. I will see if I can find any side effects from doing that. I'll also see if I can figure out why it behaves in sqlite and if it behaves in mysql. Perhaps this is a good reason to not use postgresql. -Jason On Feb 14, 1:21 am, Fran wrote: > On Feb 14, 12:28 am, jlegle

[web2py:16320] Possible bug with Auth using postgresql and web2py 1.56.2

2009-02-13 Thread jlegler
I just moved an app into production using a postgresql database and am having some trouble with Auth. All of the development was done against sqlite and everything is working fine in there. In fact, everything works fine against postgresql too except for registering new users. For some reason w

[web2py:15519] Re: Is there anyway to have multiple forms on a page without explicitly defining them in the controller?

2009-01-27 Thread jlegler
.expected_result %s' % request.args[0]) request.vars.affects_clients = eval('request.vars.affects_clients %s' % request.args[0]) request.vars.regression = eval('request.vars.regression%s' % request.args[0]) request.vars.test_case = eval('request.vars.test_case%s&#

[web2py:15509] Re: Is there anyway to have multiple forms on a page without explicitly defining them in the controller?

2009-01-27 Thread jlegler
I think I may have figured out a way to do it. Let me play around with it a bit and I will get back to you. Thanks for all your help. -Jason On Jan 27, 9:00 am, jlegler wrote: > I tried that last night which fixed the cosmetic issue of it always > posting the update message to the t

[web2py:15507] Re: Is there anyway to have multiple forms on a page without explicitly defining them in the controller?

2009-01-27 Thread jlegler
x27;, > 'client_acceptance_test'],'target'); > > should be > >  <div id="target{{=i.id}}"></div> > >  <script> >   $('#myform{{=i.id}}').submit(function() { >      ajax('{{=URL(r=request,f='new_post'

[web2py:15492] Re: Is there anyway to have multiple forms on a page without explicitly defining them in the controller?

2009-01-26 Thread jlegler
lways submits the data on the top most form. I can't figure out why for the life of me. Any ideas? I am sorry to waste your time on this. -jason On Jan 26, 8:36 pm, mdipierro wrote: > didn't you just do it? What is the problem. The code is hard to read. > > Massimo > > On J

[web2py:15485] Is there anyway to have multiple forms on a page without explicitly defining them in the controller?

2009-01-26 Thread jlegler
The reason I am asking is because I want to generate a bunch of forms based on data in the database and have them all show up on the screen at one time and be updateable. I can get all of the forms to show up on the screen and I can fill them out; however, they all make the first one submit. Is

[web2py:15460] Re: using crud.create results in a redirect redirect('../select/%s' % table)

2009-01-26 Thread jlegler
Thanks for the quick response. On Jan 26, 6:13 am, mdipierro wrote: > This is under testing. Will go away. > > Massimo > > On Jan 26, 1:02 am, jlegler wrote: > > > I am trying to use the new t2 functionality built into web2py and > > having some odd proble

[web2py:15452] using crud.create results in a redirect redirect('../select/%s' % table)

2009-01-25 Thread jlegler
I am trying to use the new t2 functionality built into web2py and having some odd problems. I am not sure why this is happening but using crud.create results in a redirect to an invalid function. What cases cause this redirect? This is the bit in utils that I don't understand: if self.settings

[web2py:15403] Re: Customize form return by T2

2009-01-24 Thread jlegler
There are many ways to do it depending on what you want to do. Can you give us an example of what you would like to do? On Jan 24, 1:50 pm, Yannick wrote: > Hello mate, > Anyone knows how to customize the form ( Register, Login, etc...) > return by T2 application Plug-in ? > > Thanks for your h

[web2py:15367] Re: Does anyone have a suggestion for a best practice way to dynamically generate multiple forms to one page from the database?

2009-01-23 Thread jlegler
Okay, now I am getting the following error: SyntaxError: user is tampering with form I printed request.vars and I see an entry for every table in my database with its own unique key. It looks as though I am just renaming the key associated with that table and not creating a unique one. This is

[web2py:15364] Re: Does anyone have a suggestion for a best practice way to dynamically generate multiple forms to one page from the database?

2009-01-23 Thread jlegler
Markus, That is how I understood it as well; however, something I am doing is making the formname change not take. I am under the impression that if I am able to set the formname, I will be able to keep the session since the formname will be unique. I can't get the formname change to stick thoug

[web2py:15363] Re: Does anyone have a suggestion for a best practice way to dynamically generate multiple forms to one page from the database?

2009-01-23 Thread jlegler
Ugh, sorry everyone. I didn't realize that it wasn't keeping track of the thread for me so I deleted the original emails in my responses. I will not do that in the future. On Jan 23, 2:42 pm, jlegler wrote: > The problem with this is I have to know how many forms I will be >

[web2py:15362] Re: Does anyone have a suggestion for a best practice way to dynamically generate multiple forms to one page from the database?

2009-01-23 Thread jlegler
The problem with this is I have to know how many forms I will be sending back. I am dynamically generating them based on entries in the database so I never get a chance to statically define them in the controller. --~--~-~--~~~---~--~~ You received this message b

[web2py:15361] Re: Does anyone have a suggestion for a best practice way to dynamically generate multiple forms to one page from the database?

2009-01-23 Thread jlegler
I had tried that and thought that perhaps I was using it wrong. Here is an example of it not working. I am probably doing something wrong but I can't seem to find it. I am dubious of the code in my model now so I have included it as well. I don't really understand how the formkey is generated

[web2py:15357] Does anyone have a suggestion for a best practice way to dynamically generate multiple forms to one page from the database?

2009-01-23 Thread jlegler
I am creating a tool that has a custom built form on the top of a page that, when submitted, creates an entry in the database and then displays a new partially filled in custom built form in a list of forms below. All of the partially filled in forms display and need to be able to be filled out a

[web2py:15244] Re: Problems with Page Refresh/Redirect when submitting forms using REST URLs

2009-01-21 Thread jlegler
Hahah, Awesome! I knew it was going to be something really easy. Thanks so much. I seriously love this framework. Every time I find something that is challenging I find that it is only challenging because I haven't thought about it the right way. Thanks so much. Seriously, this framework is br

[web2py:15232] Problems with Page Refresh/Redirect when submitting forms using REST URLs

2009-01-21 Thread jlegler
Okay everyone, I am completely new to web2py and have what I hope is a simple question. I have been hung up for days trying to build a custom form that, upon submittal, will reload the page it is on including the REST value at the end of the URL. I am generating a custom form in Python and passi