Re: [web2py] how to use this ajax upload script with web2py?
Take a slice ) http://web2pyslices.com/main/slices/take_slice/103 2011/6/11 danto web2py.n...@gmail.com: http://valums.com/ajax-upload/ It's supposed to be a ready-to-use asyncronous upload (could be a widget, later) with load indicator, but I don't know how to integrate with my form. In fact, I get no errors on console (as the author say after set debug: true) but still my upload fails. I can tested with rocket and apache+mod_wsgi, but probably should blame my implementation: ### CONTROLLER: def post(): response.files.append(URL('static','css/fileuploader.css')) response.files.append(URL('static','js/fileuploader.js')) form = SQLFORM.factory( Field('nombre'), Field('archivo','upload',uploadfolder='applications/test/uploads') ) if form.accepts(request.vars,session): response.flash = 'ok' elif form.errors: response.flash = 'no' return locals() ### VIEW: {{extend 'layout.html'}} div id=fileuploader noscript pPlease enable JavaScript to use file uploader./p !-- or put a simple form for upload here -- /noscript /div {{=response.toolbar()}} script var uploader = new qq.FileUploader({ // pass the dom node (ex. $(selector)[0] for jQuery users) element: document.getElementById('fileuploader'), // path to server-side upload scripts action: 'post', debug: true, }); /script thank you for your time
Re: [web2py] vps hosting: vps.net or linode?
I happy 2y. with linode. 2011/5/19 Carlos carlosgali...@gmail.com: Hi, What do you recommend for vps hosting?. I was pretty sure going with vps.net, but there have been several bad experiences out there that make me nervous. For reference: http://thepcspy.com/read/why-i-cant-recommend-vpsnet/ I am now undecided: which is better vps?, vps.net or linode?. http://vps.net/ http://www.linode.com/ My main market will be Mexico, if it helps to make a decision. Thanks for all your input. Carlos
Re: [web2py] Multiple forms grouped as one (django formset equivalent) with jquery plugin allowing clients to add and remove forms on the client-side
2011/3/4 ChrisT christostopou...@gmail.com: Hello everyone, I am in the process of evaluating web2py and django to decide which one I am going to use for a project of mine. I am new to both frameworks and web frameworks in general (although I did experiment with Ruby on Rails a while back) I must say I am learning web2py much faster than Django which has a much steeper learning curve I think. For the past few days however I am trying to figure out the best way to do a (relatively) simple thing with both frameworks that I guess many people did before me. I wanted to have multiple forms grouped as one on a sigle page and a jquery plugin allowing clients to add and remove forms on the client- side. This would be very useful in many situations in my application. One example would be: * Creating an invoice (table invoice with fields such as reference_no , issue_date, customer_name, etc.) with multiple invoice lines (table invoice_line with fields such as description, amount, etc.) So I need to create a single form for the invoice creation and the client must be able to add or remove from the form as many invoice_lines as needed each time. The fact is that I was able to figure the best way to do it in Django would be using formsets: http://docs.djangoproject.com/en/dev/topics/forms/formsets/ and this: http://code.google.com/p/django-dynamic-formset/ jQuery pluging I am troubled I didn't find anything similar implemented in web2py, I am sure many people before me did the same thing using both frameworks. I found some pieces of code here and there that enabled me to come close to doing it using web2py but I consider my efforts a hack (and an incomplete one so far :-)) I would like to know your opinions on how this should be done in web2py or how someone already did this. Please forgive my ignorance if I am missing the obvious here as I am new to all this. In fact this is my first post so go easy on me... Regards, ChrisT Hi, Chris This is a briljant Jquery plugin, to clone form elements dynamically. http://www.mdelrosso.com/sheepit/index.php?lng=en_GBsec=home I hope it's useful to you. Regards, Janis
Re: [web2py] Re: Upload form in web2py component
Its work http://www.web2pyslices.com/main/slices/take_slice/103 2010/11/8 Luther Goh Lu Feng elf...@yahoo.com: Just found this http://groups.google.com/group/web2py/browse_thread/thread/9c57e74da996303e/61df7879ee1236f7?lnk=gstq=upload+return#61df7879ee1236f7 On Nov 8, 5:43 am, Luther Goh Lu Feng elf...@yahoo.com wrote: I have an upload form that is rendered in a web2py component view. Unfortunately this does not work likely because of the limitations of javascript as suggested here:http://groups.google.com/group/web2py/msg/e7f6ce0a87aaf92b I believe this is still valid but am more than happy to be proven wrong. I have since moved the upload form to a non component related view and this works once again. However, on submit, the entire page refreshes. To improve elegance, I am wondering if anyone has any generic advice on preventing the page from refreshing during form submission? Thanks in advance.
Re: [web2py] Re: auth.has_membership syntax erron
Thank you , sorry , this is my fault, stupid copy past error . 2010/10/3 mdipierro mdipie...@cs.depaul.edu: more likely there is an incomplete line before and it expects an indented block On Oct 3, 9:41 am, Dr Schmulge dr.schmu...@gmail.com wrote: Hi all Missing gluon.tools import ?? File /home/john/web2py/applications/testapp/models/menu.py, line 32 if auth.has_membership(auth.id_group('Administrator')): ^ SyntaxError: invalid syntax in file menu.py if auth.has_membership(auth.id_group('Administrator')): response.menu=[ [T('Our company'),False,URL('index')], [T('Contacts'),False,URL('list_contacts')], [T('Help'),False,URL('list_persons')], [T('Users'),False,URL('list_tasks')], [T('MAPP'),False,URL('list_tasks')], [T('RFID'),False,URL('list_tasks')], [T('Report'),False,URL('list_tasks')], ] Thanks in advance.