[web2py] Use of scheduler in place of cron

2014-06-24 Thread pbreit
I have a function that I want to run every 30 minutes. I would ordinarily expect to use cron but see that the Web2py book encourages using the scheduler. But after reviewing the docs several times, I have no idea how to make this work. Thanks for any help. -- Resources: - http://web2py.com -

[web2py] Need to have def 4() and def dir() to 301 redirect. Is it possible?

2014-06-24 Thread Kenneth
I would like to redirect these two links: www.mydomain.com/4 and www.mydomain.com/dir for fixing backlinks I previously had for SEO purpose. I've tried to redirect from the controller but it didn't work. -- def 4(): redirect('/',301) def dir(): redirect('/',301) -- Obviously this is not possible

[web2py] autocomplete depending on other form field

2014-06-24 Thread Annet
I've got this form: form = SQLFORM.factory( Field('tag', length=128, requires=[IS_IN_DB(db, 'tag.name', '%(name)s', error_message='Tag not in database')]), Field('locality', length=64, requires=[IS_IN_DB(db, 'locality.name', '%(name)s',

[web2py] Re: web2py and self-submission/postbacks - a newcomer asks

2014-06-24 Thread Graham Ranson
Anthony abastardi@... writes: It would probably help if you show some code, or at least explain in more detail an example where self submission is not possible or overly difficult. Note, your code can always distinguish between a form creation request and a form submission request by

[web2py] Raw include to solve Handlebars problem

2014-06-24 Thread Stefan Scholl
I wanted to use Ember.js and the Handlebars are clashing with web2py's delimiters. There are many solutions to this problems. This is another one: class RAW_INCLUDE(XML): {{=RAW_INCLUDE('views/default/hbs/blah.hbs')}} def __init__(self, filename): self.filename = filename

Re: [web2py] Re: web2py and self-submission/postbacks - a newcomer asks

2014-06-24 Thread Jim Steil
Yes, you set the defaults for the table before the form=SQLFORM(...) statement. All you are doing is setting a default, you are not 'prepopulating' data. Also, since web2py loads it's db.py on every request, the defaults you set in one request do not have an effect on subsequent requests. Also

[web2py] Re: web2py and self-submission/postbacks - a newcomer asks

2014-06-24 Thread Anthony
My experience in web-type applications is of the 'single purpose code' type: one method assembles the data for the web page, from a database or some default values etc., and then 'returns' it to the web client; then an entirely separate method is the target for the subsequent HTML form

[web2py] Re: autocomplete depending on other form field

2014-06-24 Thread Jim S
I use this javascript for my autocompletes... script type=text/javascript $(document).ready(function() { $( #no_table_requestor ).autocomplete({ source: {{=URL('contacts','autocomplete')}}, select: function(event, ui) { $( #no_table_requestor_id

[web2py] Customizing auth.navbar function

2014-06-24 Thread Sarbjit
Hi All, I want to customize the auth.navbar function (basically I want to add new option when the user is logged-in and also want to modify the text Register). So, I followed the following approach :- - Created a new function (by using the source code from tools.py) in a separate file in

Re: [web2py] Need to have def 4() and def dir() to 301 redirect. Is it possible?

2014-06-24 Thread Roberto Perdomo
Hello Kenneth, A way is see the 4 and dir as string argument from the url and read this from the index function, then check that string argument, and apply a conditional. This was not tested, but I think that works for you needs: def index(): argument = request.args[0] if argument ==

[web2py] Re: web2py password encryption/decryption

2014-06-24 Thread farmy zdrowia
THX a lot Massimo, it is very much appreciated. I'll check this ASAP. Be patient please. On Monday, June 23, 2014 11:21:42 AM UTC+2, Massimo Di Pierro wrote: Hello Farmy, The code you posted helps and this examples the PHP algorithm:

[web2py] Best way to ensure uniqueness of two fields?

2014-06-24 Thread maddin . sa
I have a model that looks somewhat like this db.define_table('topic_teacher', Field('skill', 'list:string', required=True), Field('description', 'text', required=True), Field('topic', 'reference topic'), Field('teacher', 'reference

[web2py] Web2py Views: Multiple images changing in the background of index?

2014-06-24 Thread Gideon George
Please I need a help, this is the first time I am posting here and I am in my journey to be the Africa's number one Web2py enthusiast. I am currently developing my first web2py application and I have less than a week to complete it and head over to a more complex application by next week. My

[web2py] Issue deploying web2py even after following tutorial

2014-06-24 Thread shachar lobl
Hi, I've been struggling the last few days with deploying web2py on an EC2 Ubuntu instance. I describe the steps I took in SO in the link below. http://stackoverflow.com/questions/24371280/unable-to-access-web2py-server-running-in-ec2-instance I feel like it's something simple, and all help

[web2py] how to Consume external NetTcp SOAP service in Web2Py

2014-06-24 Thread Gopi
Hi All.. I am new to web2py. Is there a way to call external NetTcp SOAP service in Web2Py. What are the best practices to call such services in Web2Py? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: sqlform.grid add new - populate some fields(with values from another db) based on other fields

2014-06-24 Thread Peter
Thanks. Noted that, thats the best way and might be the only way On Sunday, 22 June 2014 12:53:51 UTC+3, 黄祥 wrote: sorry, didn't read this sentence I want these to be reflected even before i click 'submit' button if you want to achieve it before click 'submit' button, i think you can

[web2py] Background images slides like twitter?

2014-06-24 Thread Gideon George
Please I need somebody to help me on suggestions on how to put background-images in my website's index. just like twitter. Thank you -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Adding scheduler to an existing app break the MySQL DB...

2014-06-24 Thread Krzysztof Socha
I am fighting it for some time now... I tried all the different ways to migrate the database so that the tables for the scheduler are created, but no luck - maybe someone could help... I have an existing application. Recently I decided I needed to run some things in the background, so I added

[web2py] how to use require js with web2py?

2014-06-24 Thread chuan137
how to load script data-main=scripts/main src=scripts/require.js/ script in web2py like in web2py_ajax.html I have response.files.insert(0,URL('static','js/libs/require.js')) then below script require.config({ paths: { 'text': {{=URL('static', 'js/libs/require/text')}},

[web2py] Re: Ubuntu 14.04 Setup Script with Apache - Issues?

2014-06-24 Thread shachar lobl
I'm also experiencing these problems installing on Ubuntu 14.04 as well for the past few days. I've followed all the steps on different tutorials and I still can only get the Apache default page. I was doing this to get a better knowledge of building web apps and I don't have much knowledge of

[web2py] Installing Tornado with web2py

2014-06-24 Thread Salvatore DI DIO
Hello, I have installed web2py + uswgi + nginx. I would like to install Tornado. Does anybody could advise me with the recommended configuration to use ? Regards -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Authorized File Download Error

2014-06-24 Thread Keri Sui
Hello! I am trying to enable temporary access for users to downloadable files by requesting access on a per file basis In my database. Field('members', 'list:reference db.auth_user', default=auth.user_id, requires=IS_IN_DB(db, db.auth_user, '%(first_name)s %(last_name)s %(email)s',

[web2py] infinite scrolling using components

2014-06-24 Thread deep jain
I am trying to implement infinite scrolling on my newsfeed completely using components... My present solution is very trivial, it loads 5 items first, then on reaching bottom, component is refreshed with 10 elements, then 15 and so on... Now, i want to append only the next five items, instead

[web2py] Re: /default/user/login not honoring _next anymore?

2014-06-24 Thread Massimo Di Pierro
You found a bug. Fixing it in trunk. Please check it again. Thanks. On Monday, 23 June 2014 10:14:57 UTC-5, Wei Wang wrote: In the current head branch in github (Version 2.9.5-trunk+timestamp.2014.06.19.17.16.40), it seems that the /default/user/login form does not use the _next variable

[web2py] Re: Readonly elements (select and date field) respond to clicks, allow for changes and can be submitted?

2014-06-24 Thread Massimo Di Pierro
You cannot make a field not writable conditionally. Because if the field is writable it shows in the form. This is before you know the value of the other field. Conditionally you can remove the field from form.post_vars. On Monday, 23 June 2014 12:26:04 UTC-5, 98u...@gmail.com wrote: I did

[web2py] Re: how to Consume external NetTcp SOAP service in Web2Py

2014-06-24 Thread Massimo Di Pierro
web2py ships with pysimplesoap. It is documented on google code. On Monday, 23 June 2014 12:39:22 UTC-5, Gopi wrote: Hi All.. I am new to web2py. Is there a way to call external NetTcp SOAP service in Web2Py. What are the best practices to call such services in Web2Py? -- Resources: -

[web2py] Re: IS_IN_SET options list separator

2014-06-24 Thread Massimo Di Pierro
There is no syntax to do this. On Monday, 23 June 2014 12:49:21 UTC-5, Carlos Correia wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Is there a way to introduce a separator in IS_IN_SET options widget, so that from code like: IS_IN_SET( ('1', 'First'), (seperator?),

[web2py] Re: Authorized File Download Error

2014-06-24 Thread Massimo Di Pierro
This line db.personal_uploads.file_upload.authorize = lambda record: auth.is_logged_in() and (record.members.contains(auth.user_id)) should be db.personal_uploads.file_upload.authorize = lambda record: auth.user and auth.user.id in (record.members or []) On Monday, 23 June 2014 13:26:20

[web2py] Re: Ubuntu 14.04 Setup Script with Apache - Issues?

2014-06-24 Thread Brian M
The nginx setup script works perfectly on ubuntu 14.04. As for Apache, the changes I mentioned above should get it working just fine as well. On Tuesday, June 24, 2014 11:22:47 AM UTC-5, shachar lobl wrote: I'm also experiencing these problems installing on Ubuntu 14.04 as well for the past

[web2py] Re: Adding scheduler to an existing app break the MySQL DB...

2014-06-24 Thread Niphlod
1. make sure no *_scheduler_*.table files are in the databases/* folder 2. make a request to create the tables appname/appadmin/index is fine to check if the tables are there or not. On Tuesday, June 24, 2014 3:33:24 PM UTC+2, Krzysztof Socha wrote: I am fighting it for some time now... I

[web2py] Re: Installing Tornado with web2py

2014-06-24 Thread Niphlod
do you want to run web2py with tornado with nginx as frontend or what else ? On Tuesday, June 24, 2014 10:57:11 AM UTC+2, Salvatore DI DIO wrote: Hello, I have installed web2py + uswgi + nginx. I would like to install Tornado. Does anybody could advise me with the recommended configuration

[web2py] Re: Installing Tornado with web2py

2014-06-24 Thread Massimo Di Pierro
you should be able to do sudo easy_install tornado You can run web2py with tornado using anyserver.py (ships with web2py, -h for command line options). Massimo On Tuesday, 24 June 2014 03:57:11 UTC-5, Salvatore DI DIO wrote: Hello, I have installed web2py + uswgi + nginx. I would

[web2py] accessing tables using web2py scheduler

2014-06-24 Thread Cory
Hi, I am trying to access tables within my scheduler function. The tables I am trying to access require @auth.requires_login(). *Am I able to access these tables within my scheduler.py model file?* right now I am passing table row fields as parameters to the scheduler function and it is very

[web2py] Re: Issue deploying web2py even after following tutorial

2014-06-24 Thread Tim Richardson
what version of ubuntu? On Wednesday, June 25, 2014 12:44:45 AM UTC+10, shachar lobl wrote: Hi, I've been struggling the last few days with deploying web2py on an EC2 Ubuntu instance. I describe the steps I took in SO in the link below.

[web2py] Re: Best No SQL DB supported by web2py?

2014-06-24 Thread Mandar Vaze
MongoDB has been marked experimental for quite some time - though. On Wednesday, June 18, 2014 7:56:15 AM UTC+5:30, Anthony wrote: web2py supports MongoDB as well as the Google App Engine Datastore. There is also a CouchDB adapter, though not sure how functional it is. Anthony On Tuesday,

[web2py] Display returned objects from load(ed) component when calling URL from Ajax

2014-06-24 Thread Andrew Evans
Hello I am facing a problem with returned output from a controller not displaying when being called from a link using the ajax() function inside a LOAD(ed) component. *index* div id=status/div div id=file_list {{=LOAD('default', 'file_list.load', ajax=False)}} /div --

[web2py] Sending the ID of the newly registered user in email message (auth.messages.verify_email)

2014-06-24 Thread Kenwyn Pilgrim
Hi I'm trying to send the *id* of the newly registered user in the string *auth.messages.verify_email*. I've tried *%(id)s* but immediately get a ticket. type 'exceptions.KeyError' 'id' When initializing the string *auth.messages.verify_email*, I've been able to use other place holders, such

[web2py] A way to trigger method on update?

2014-06-24 Thread Omri Levy
Hi, Is there a way to call a method when certain field is updated? The intention is *not* to change the value of the field/represent it otherwise, but it has general purpose. Thanks! Omri. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: Authorized File Download Error

2014-06-24 Thread Andrew Evans
Amazing! Thank you very much. On Tue, Jun 24, 2014 at 10:49 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: This line db.personal_uploads.file_upload.authorize = lambda record: auth.is_logged_in() and (record.members.contains(auth.user_id)) should be

[web2py] Re: Best No SQL DB supported by web2py?

2014-06-24 Thread Massimo Di Pierro
It is experimental only because I never tested it myself. From what I hear it works well. On Wednesday, 25 June 2014 00:14:59 UTC-5, Mandar Vaze wrote: MongoDB has been marked experimental for quite some time - though. On Wednesday, June 18, 2014 7:56:15 AM UTC+5:30, Anthony wrote: web2py