[web2py] Re: A way to trigger method on update?

2014-06-24 Thread 黄祥
i think you can achieve it using before and after update callback (handle in dal), another way is using onupdate (handle in form) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google

[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] 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) - http://github.com/web2py/we

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

[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* {{=LOAD('default', 'file_list.load', ajax=False)}} -- *file_list.load* Que For Encryption

[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. 'id' When initializing the string *auth.messages.verify_email*, I've been able to use other place holders, such as *%(first_name)s*, *%(las

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

[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. > > > http://stackoverflow.com/questions/24371280/

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

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

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

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

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

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

[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'), (sepera

[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: 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: /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" variab

[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', multipl

[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) - https:/

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

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

[web2py] how to use require js with web2py?

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

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

[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) - https://code.google.com/p/web2py/issue

[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: > http://pythonhosted.org/passlib/lib/passlib.hash.p

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

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

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

[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) - https://code.goo

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 == '4'

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

[web2py] Re: autocomplete depending on other form field

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

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

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 n

[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 = filenam

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

2014-06-24 Thread Graham Ranson
Anthony 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 checking whethe

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