Mirek Zvolský | 12 Feb 09:30 2016
Picon
Gravatar

Info: Good hosting service (virtual server)

forpsi.com provides
- Webhosting Easy with Python/SQLite 0.8 EUR/month + 1.2 EUR Postgres (I have not tested this one)
- virtual server Cloud Smart VPS Small (1G RAM, 20G SDD disk, 50G additional FTP, Debian or CentOS) 1.0 EUR/month.

And of course higher level (and more expensive) hosting programs (include Windows/MSSQL if somebody need more experimental technology).
However I am not sure if services are accessible for customers outside of UK,GE,IT,CZ.

I use the virtual server with Debian 8 Jessie.
Somewhere on their pages (CZ version) I have found that if you send a motivation message, you will get 9 EUR voucher,
so I have (I hope) starting 9 months for free.
However price problem can be the ssl certificate for https (except of the self signed certificate).

To install nginx-uwsgi-web2py on the plain virtual machine you can use scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
but don't use the old one from stable version, but the newer from github.com/web2py/web2py.
In problems see this:
https://groups.google.com/forum/#!topic/web2py/ZM9IIEjtHSI

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Alfonso Serra | 11 Feb 22:17 2016
Picon

Problems with Upload files

Hey everyone.

Im having a hard time to import and process a csv file.

I would like to:
- upload the file,
- let the user do some kind of preprocess, (map columns, and such).
- insert records.
- dispose the uploaded file.

Its a double post i gotta do, one to submit the file, and another for the user to process and commit the previously uploaded file. is it wise to place the file into the session? or is it better to just store the path to the uploaded file to handle it later?

This is the first form
form1 = SQLFORM.factory(
     
Field("file", "upload", default="", uploadfolder = "applications/myapp/uploads", requires=[IS_NOT_EMPTY("Please select a file."),
          IS_UPLOAD_FILENAME
(error_message="Only csv files allowed", extension="[csv]", lastdot=True),
          IS_BINARY
(False, "Binary files not allowed")]), ...

The problems im having are:
if i dont specify an upload folder i get an error.

<type 'exceptions.RuntimeError'> you must specify a Field(...,uploadfolder=...)


I wonder why the sqlform doesnt know where to store the file, it is no big deal, easy to solve but

when the file is uploaded, an empty file gets created as "no_table.file.96474e907bab4168.6d657472696c792e637376.csv", which is ok but its empty.

So my question is, do i have to read the request.post_vars.file to save the content to that automatically created empty file?

The request.post_vars.file has a reference to, apparently, that file handler, but i cant save any content with that.

myfile = request.post_vars.file
content
= myfile.file.read()
content
= content.decode("iso-8859-1").encode("utf-8")
with myfile.fp as f:
    f
.write(content)

Does anyone know resources or care to explain how to upload files without db interaction?
The docs doesnt have much about these cases.

Thank you very much.



--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Richard | 11 Feb 20:01 2016
Picon

[Off topic] Python 3.5 technology award



http://www.infoworld.com/article/3023050/open-source-tools/infoworlds-2016-technology-of-the-year-award-winners.html#slide18

Richard

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
lucas | 11 Feb 18:55 2016
Picon

input class="integer" interrupt

hey everyone,

so under the sqlform.custom.begin....sqlform.custom.end with the view, and more specifically, under the sqlform.custom.widget of db type 'integer' where the widget is of class="integer" there is javascript/jQuery code attached to those inputs that only allow digits and the negative sign.  that is how i like it to work.

on top of that, i would like to add an onkeyup="jfunction()" that if a c key is pressed, it can call out to a javascript/jQuery function i place under the head block, grabs and passes that id of that widget, pulls up a side div in the left_sidebar, and then still runs the javascript/jQuery code that would normally run as if i didn't interrupt it in the first place without the onkeyup event.

how can i do that properly?  essentially, i want the side div that pops up to be a calculator type that can place its final value back in the original integer input that the c was typed in.  make sense?  thank you in advance, lucas

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Picon

alternative autocomplete widget

Hi, right now I am working in a plugin with an autocomplete widget using 
typeahead.js:

https://github.com/daxslab/web2py-typeahead

Any clues, suggestions, recomendations etc... will be very welcomed.

Greetings.

--
Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el
cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el
compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.

Massimo Di Pierro | 11 Feb 04:55 2016
Picon

markmin.js

I have a new version of markmin.js I recommend this over the python implementation. It is better to render on the client because oembed does not require setting up server side caching. The JS version allows sanitized HTML. Also the heavy lifting is moved to the client. It is not 100% compatible but very close. 

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Russ M | 9 Feb 22:19 2016
Picon
Gravatar

Memcache, MEMDB tcp connections not closing

I use memcache and MEMDB for session storage and caching.  The CentOS server is setup with an apache modwsgi process group, setup through the wsgihandler.py.

I establish the MemcacheClient and MEMDB as the cache and session db in my app's models/db.py file.


It appears that when requests have been serviced, the TCP socket connections to memcached remain open and ESTABLISHED (state), piling up on top of one another.  I can bandaid fix the problem by using the modwsgi -maximum-requests=X  option to force the python interpreter processes to restart completely, but this is not ideal.

Is there a hook to run a function after the session has been correctly stored and response sent back to apache, where I could manually run the memcache client's  disconnect_all() ?

Looking at gluon.main's wsgibase, I didn't see any simple options to fix this with.  I am hesitant to hack my own code in there, as it would make updating web2py a pain with patch management.


-r

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
rajjmatthur | 10 Feb 19:11 2016
Picon

background color of block sidebar

playing with blocks. 

I have 

{{block right_sidebar}}

{{end}}

I would like to set the background color different in the sidebar area comparing my main page. Any help from the community?

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
snehalashtekar1234 | 10 Feb 12:37 2016
Picon

Getting values from database

How to get the database stored values in HTML form

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
prashant joshi | 10 Feb 09:13 2016
Picon

How to insert data from controller to database

def insert():
    user=request.vars.usersignup
    email=request.vars.emailsignup
    pas=request.vars.passwordsignup
i want to add these fields with values in database dynamically?

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Greg White | 10 Feb 01:06 2016
Picon

Check to see if a field is in another table in a computed field

Want a computed field to show whether or not a field value exists in another table

started with this...

db.define_table(
    'inventory',
    Field('name'),
    Field('qty', label='Quantity'),
    Field('MatSize',label='Material Size'),
    format = '%(name)s') 

db.define_table(
    'POrequest',
    Field('name', 'reference requestor', label='Requestor'),
    Field('JobNum', 'reference jobs', label='Job #'),
    Field('description', 'text', notnull=True),    
    Field('InInventory', compute=lambda r: r['description'] IN r[db.inventory.name]),  <<< this row right here is what I need help with
    format = '%(name)s')

trying to verify row by row in a computed field if db.POrequest.description is in any row of db.inventory.name

help please.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane