Annet | 22 May 19:11 2015

return locals()

I have functions that return locals(), I wonder whether it is possible to limit
the variables returned to those needed by the related view.


Kind regards,

Annet

--
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.
Aydin S | 22 May 17:36 2015
Picon

initilize GPIO in web2py-Scheduler

I'm trying to set a pin to high (for instance) in a periodic way using web2py in an embedded linux.
I set the GPIO to output for example :
GPIO.setup(pin 20, output)
and then
if x>y
GPIO.setup(pin 20, high)

and run the scheduler every 10 second
The problem with this is that every 10 second when it gets to the line which sets the pin to be output, it turns it low (that's the default).

I am frustrated with scheduler to get it to run two functions so that I can put the pin initialization in one which runs only at startup. I tried to use the crontab -e and initialize there, but it looks like web2py models does not have access to those and failed to run.

I've been thinking to make a creative way to bypass GPIO setup after first run of scheduler and I was successful but scheduler fails in the second repeat because does not know the setup apparently.

Web2py experts please help me find out the solution....Thanks
 

--
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.
peter | 22 May 11:51 2015
Picon

update_record not working but not failing.

I am using sqlite 3.

I have a ticket booking system. Transaction.status is set to 'pending'  in the database, when the transaction is initiated. 
When the paypal payment completes:

    transaction.status='booked'
    transaction.update_record()

emails are then sent out.

I have a strange example where the 'update_record' seems to have not worked, and yet execution of the routine was not interrupted, so the emails were still sent out, but status remains at pending.

Is it possible for 'update_record' to not work, and yet not fail and generate a ticket?

If so, is there any way to know this is happening to 'handle' it?

Thanks for any help on this.

Peter  

--
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 Penman | 22 May 09:34 2015
Picon

Is there a working bootstrap3 formstyle for auth?

Hello,

Is there a working boostrap3 formstyle for auth?

I tried:
auth.settings.formstyle = 'bootstrap3'
auth.settings.formstyle = SQLFORM.formstyles.bootstrap3_stacked
auth.settings.formstyle = SQLFORM.formstyles.bootstrap3_inline

All of these added bootstrap3 to the form but some parts were messed up, such as "remember be" checkbox for login and "verify password" for register.
Is there a working style function for bootstrap3?

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.
www.diazluis.com | 22 May 07:30 2015
Picon

great system login

greetings, one has implemented a system
Login using the following code?: https://peterhudec.github.io/authomatic

--
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.
Ruud Schroen | 21 May 20:58 2015
Picon

Robots.txt paramete router

Hi,

I'm using a parameter based router like this:

routers = dict(

    # base router
    BASE=dict(
        default_application='welcome',
        default_controller = "default",
        default_function = "index",
        domains={'www.mydomain.nl':'myapp'}
    ),
)

Now how do I expose my robots.txt so google can find it? 

--
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.
goome | 21 May 19:39 2015
Picon

migration type mismatch

from the book :"define_table checks whether or not the corresponding table exists. If it does not, it generates the SQL to create it and executes the SQL. If the table does exist but differs from the one being defined, it generates the SQL to alter the table and executes it. If a field has changed type but not name, it will try to convert the data"
So  i suppose that this could help me in cleaning data (from type mismatch).
i copied the current project(application) in a new one, leaving in the dir 'databases' only the sqlite storage.
But when i open the home page od this copied app, i got 'table already exists'.
In models/db.py there are no migrate setting , except for auth table, where i set it to migrate=False, as this seems necessary.
Why web2py does not alter(if needed) the table, and instead complains of already existing one?

--
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.
Michele Comitini | 21 May 19:35 2015
Picon

PostgreSQL on Pythonanywhere

Finally!
http://blog.pythonanywhere.com/103/

Not free, but fully managed

mic

--
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.
Manuele Pesenti | 21 May 18:13 2015
Picon

scheduler trouble

Hi,
I need a task that runs every 20" but ti seams that sometimes it gets
more than the 19" I setup for the timeout.
If the task goes timeout it seams the db remains locked and the whole
application stops to answere... How can I by-pass the task timeout?
Any idea?

Thanks a lot

    Manuele

--

-- 
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.

Annet | 21 May 17:41 2015

readonly form fields

I have formstyle set to boostrap3_stacked, in case of a readonly field
these fields are rendered rather ugly. I added the following line of
code to the formstyle_bootstrap3_stacked(form, fields) function


if isinstance(controls, basestring) or isinstance(controls, int):
            _controls = DIV(controls, _class='form-control', _readonly=True)

this partially solves my problem, in case of
IS_IN_SET([(1, 'pending'), (2, 'accepted'), (3, 'blocked')]) the fields containing,
1, 2 or 3 are still rendered ugly.

Why doesn't isinstance(controls, int) take of rendering them readonly.


Kind regards,

Annet

--
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.
KevC | 21 May 17:27 2015
Picon

blob field

Hi! I have a problem while I wanna download a file from database. I dont wanna save the file in the folder 'uploads', I wanna save it in my database. I use this example.

db.define_table('libro',
    Field('titulo','string', requires=IS_NOT_EMPTY(error_message='Introduzca título'),label='Titulo'),
    Field('archivo','upload',uploadfield='archivo_bd, label='Archivo .PDF',  requires= IS_UPLOAD_FILENAME(extension='pdf',error_message='Archivo invalido')),
    Field('archivo_bd','blob'),
    Field('hecho_por',db.auth_user,default=auth.user_id, writable=False,readable=False)
)

I do a clic on the link and the file download but, I wanna open the file but the message says that file is damage or extension not compatible. Why?


My best regards.

--
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