[web2py] sql query efficency implementation

2014-06-19 Thread Alan
I'm trying to get a row count on a query that joins together every instance of a coalesce set of fields and coming unstuck. The query in sql looks like: select sum(1) from (select count(direction) from tracking where direction = 1 AND left(created,10) = '2014-06-13' group by

[web2py] Re: Web2py ckEditor

2014-06-19 Thread Sharjeel Ali Shaukat
i m using ckeditor from web2slices -- 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

[web2py] Error lling a variable from class method

2014-06-19 Thread Maurice Waka
Am working on a simple game/app. When I call a variable on web2py view, I get this error: quack= duck.quack()TypeError: unbound method quack() must be called with duck instance as first argument (got nothing instead) my codes are here: In the module module from gluon import *class duck():

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

2014-06-19 Thread Graham Ranson
I'm new to python and web2py...I have a small, but non-trivial, web application and was looking at the various python web frameworks and decided to look more closely at web2py and a couple of others and to write a couple of small example applications to see how they work... I've had a quick

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

2014-06-19 Thread Don O'Hara
Hi Graham - Welcome to web2py ! I think you'll find that this group has many people who can share many types of design patterns. Web2py has a lot of ajax built into core the framework. Since the original intent was using web2py as a teaching tool, the emphasis may have been on simplicity (self

[web2py] Re: Error lling a variable from class method

2014-06-19 Thread Leonel Câmara
Try this in modules class Duck(): def quack(self): return 'Quacks like a duck' def walk(self): return 'Walks like a person' Then in the controller def data_filters(): duck = Duck() fils = duck.quack() return dict(fils=fils) -- Resources: -

[web2py] Re: Error lling a variable from class method

2014-06-19 Thread Anthony
Even better: class Duck(object): On Thursday, June 19, 2014 12:34:39 PM UTC-4, Leonel Câmara wrote: Try this in modules class Duck(): def quack(self): return 'Quacks like a duck' def walk(self): return 'Walks like a person' Then in the controller def

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

2014-06-19 Thread Anthony
Much of the code used to create the form is also re-used when it comes time to process the submitted form, so submitting back to the same action helps avoid code duplication. You also don't have to worry about explicitly specifying a URL for submission. In any case, self submission isn't

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

2014-06-19 Thread Jim S
I too did a double-take when I first saw this concept when learning web2py some time ago. I came from a TurboGears environment and the self-submission was new to me. I didn't like it at first, but now couldn't image being required to do anything differently. Really simplifies/lessens the

[web2py] Re: how to create an album and view photos belonging to that album

2014-06-19 Thread Dave S
On Wednesday, June 18, 2014 1:50:09 AM UTC-7, Rahul wrote: Hi All, I am writing an image gallery in my app. I am stuck up here - I want to display images that belong to a particular album when I select that album in the view. Although I am able to display albums in the view, but

[web2py] CSS and graphics not loading in admin interface (lighttpd)

2014-06-19 Thread Tobias Morawietz
Hi guys, I'm new to this group as well as to web2py. So far I'm really happy with the way it works! I managed to run web2py with lighttpd using the fastcgi handler and configured lighttpd to allow acces over ssl in order to get the admin interface to work. Now I have a problem with the admin

[web2py] Re: Smartgrid onupdate still works while set to None

2014-06-19 Thread Pham Quang Dung
You are right Anthony, understood now. Thanks Massimo for the warning as well. On Saturday, May 31, 2014 8:07:33 PM UTC+7, Anthony wrote: On Friday, May 30, 2014 7:59:01 PM UTC-4, Pham Quang Dung wrote: Anybody enlighten me on while this form still updates the data? (I expected it was

[web2py] GAE Deployment with no JOIN on queries...

2014-06-19 Thread Sébastien
Hello, I'm creating my first Web App with Web2py and I am amazed of all its capacities!! I am thinking of deploying my app in GAE but I only realize now that it doesn't allow JOIN on table queries. I wanted to use GAE because of scalability and not having to configure and maintain a server

[web2py] Recompute all instances of a computed field

2014-06-19 Thread Tomasz Sokołowski
Hello Recently I have upgraded the function dni_urlopu() which is used in a computed field in the table urlop. How can I recompute/refresh all instances of already existing records which where not properly compute because of error in previous version of function dni_urlopu() Best regards,

[web2py] Re: Trying to use the LOAD helper, if a button is clicked

2014-06-19 Thread Omri Levy
Thank you Anthony! This works :) Thank you too Carlos On Monday, June 16, 2014 4:33:05 PM UTC+3, Anthony wrote: If you want to dynamically add a component in the browser, you cannot use the LOAD helper, which is a Python helper that is serialized on the server. Instead, use the

[web2py] DAL and Cast operator

2014-06-19 Thread Pham Quang Dung
I am using SQLite and it appears no casting is available (or required?). But I cannot perform a command like this: db().select('test'+ db.tab.int_account) can you show me the right syntax to make it happen? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: how to make web2py routing all controllers and functions??

2014-06-19 Thread Mohammed Suleiman
*its work now* routes_in =

[web2py] Undesired redirect to other page after submitting a form

2014-06-19 Thread Tom Clerckx
Hi, I have some undesired behavior in my app that I was able to resolve, but I would like to understand what goes wrong. I could easily reproduce the problem with a simple test-application, containing two pages and two forms (I'm skipping the boilerplate code that is created when making a new

[web2py] Re: Problem with web2py on Heroku

2014-06-19 Thread Zakariya Dehlawi
I'm having the same issue. I only have one DB associated with my Heroku account, and it's properly being set in get_db(), as it shows up in the stack trace. Heroku says that the DB has no tables in it. I was curious to see if perhaps there were leftover .table files in the filesystem when I

Re: [web2py] web2py conference - online talks

2014-06-19 Thread eric cuver
can you explain how used web2py with ractive.js please Le vendredi 16 mai 2014 18:09:04 UTC+2, Massimo Di Pierro a écrit : No but I do not like angular. It constrains the JS programming too much for my taste. I use ractive.js with bootstrap already without problems. On Wednesday, 14 May

[web2py] Re: Brainstorming

2014-06-19 Thread eric cuver
we can be used web2py with ractive ? Le lundi 16 juin 2014 05:31:16 UTC+2, Massimo Di Pierro a écrit : I have used Angular for a project and it was a nightmare. I soon moved to ractive and did not regret it. Angular forces a scope and, for example, promises can only live within the scope.

[web2py] Ticket in Appadmin when viewing a table

2014-06-19 Thread Omri Levy
type 'exceptions.TypeError' sequence item 0: expected string, long found Versionweb2py™Version 2.9.5-stable+timestamp.2014.03.16.02.35.39PythonPython 2.7.6: C:\Python27\python.exe (prefix: C:\Python27)Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last):

[web2py] Unable to filter drop down records on SQLFORM

2014-06-19 Thread ari northage-orr
Hey Everyone, So my problem is this. In my application admins are able to create discussion groups and invite users to join them, so I have made a form to do that. For various reasons I decided to make my own tables to keep track of groups and members of the groups instead of using the built

[web2py] Creating table from csv file

2014-06-19 Thread Alex Steinkamp
I am trying to import a csv file into a table in a database. I don't always know the number of columns I will have. This is where I am having my problems. I can't find anywhere how to dynamically add columns to a table. Does anyone have any ideas on how to do this? Thank you in advance. --

[web2py] Dynamically changing columns in table

2014-06-19 Thread Alex Steinkamp
I have been struggling with trying to manipulate a database the way I want to. I have a csv file that I am trying to upload to a table in one of my databases. The problem I am having is that the number of columns is always changing. I never know how many columns I will have. So I am trying to

[web2py] Re: Brainstorming

2014-06-19 Thread chuan137
Noelse mentioned Backbonejs yet? working on a project with it now, but do not care for it too much, I am thinking of switching to AngularJS actually. On Sunday, June 15, 2014 10:34:25 AM UTC+2, Massimo Di Pierro wrote: Often Angular comes up on this list. I tried it and I was un-impressed.

[web2py] send json variable as parameters to RESTful api

2014-06-19 Thread chuan137
Dear all, In my javascript code, I would like to have sth like this, $.getJSON(url_to_REST_api, { group: 0, sensors: sensorIDs }, function(res) { timestamp = res['timestamp']; data = res['data']; }); However, sensorIDs is a rather

[web2py] Re: CSS and graphics not loading in admin interface (lighttpd)

2014-06-19 Thread Brian M
It may be that response.static_version is enabled but the web server is not setup to handle the resulting URL. Try using your browser's developer tools to see what the URL for the missing files is; if it includes /static/_#.#/some/file.CSS this is your problem. See the deployment section of

[web2py] Re: Ticket in Appadmin when viewing a table

2014-06-19 Thread Massimo Di Pierro
think it is a bug. pushing a new version that should fix that. Check trunk in 5 minutes. On Monday, 16 June 2014 09:17:01 UTC-5, Omri Levy wrote: type 'exceptions.TypeError' sequence item 0: expected string, long found Versionweb2py™Version

[web2py] Re: appadmin is disabled because insecure channel using default ipv6 local ::1 on windows with w2p 2.95

2014-06-19 Thread Massimo Di Pierro
This is a bug. Can you please open a ticket? On Monday, 16 June 2014 10:39:33 UTC-5, Greg Vaughan wrote: Heading says it all... no problems using localhost IPv4... Is this expected behaviour? Seems rather strange if so... -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Creating table from csv file

2014-06-19 Thread Massimo Di Pierro
You cannot dynamically add columns. Do you have a superset of possible column names? If so, give a default value to the optional ones. On Monday, 16 June 2014 10:46:31 UTC-5, Alex Steinkamp wrote: I am trying to import a csv file into a table in a database. I don't always know the number of

[web2py] Re: send json variable as parameters to RESTful api

2014-06-19 Thread Massimo Di Pierro
You can do: jQuery.ajax({ type: POST, url: url, data: JSON.stringify(data), success: callback, dataType: json, contentType: APPLICATION_JSON,

[web2py] Re: DAL and Cast operator

2014-06-19 Thread Massimo Di Pierro
an you explain what you are trying to achieve? I am not sure from the example. On Tuesday, 17 June 2014 01:29:11 UTC-5, Pham Quang Dung wrote: I am using SQLite and it appears no casting is available (or required?). But I cannot perform a command like this: db().select('test'+

[web2py] Re: Error: type 'exceptions.TypeError'(can't pickle function objects)

2014-06-19 Thread Massimo Di Pierro
I do not think this has to d o with virtual hosts. It appears you are storing unpickleable options in session. On Tuesday, 17 June 2014 02:51:44 UTC-5, kita...@gmail.com wrote: Hi, I have a strange error with my sessions. I am running Apache 2.2.12, mod_wsgi 4.1.2, Python 2.7.6. I keep

[web2py] Re: Brainstorming

2014-06-19 Thread Massimo Di Pierro
In this thread there are lots of references to various libraries but they are not all the same and serve different purposes. I like sugar.js and ractive.js sugar.js is similar to underscore.js+moments.js and it extends basic objects like Date, Array, and String so that they have more methods.

[web2py] Re: Ticket in Appadmin when viewing a table

2014-06-19 Thread Omri Levy
Hi Massimo, Thanks , I experience this bug a lot, I think it's when I update list of references to the same table in the db. Can you please explain how to update? (do I need Git?) / Manually fix it? Thanks again , Omri. On Friday, June 20, 2014 1:17:08 AM UTC+3, Massimo Di Pierro wrote:

[web2py] Re: Web2py ckEditor

2014-06-19 Thread Tim Richardson
OK, I hope that I can help with that. I don't know what you mean by show runtime preview in div. The editor is designed to be attached to certain fields in a form, as instructed in the web2py slices page. The editor works fine as the plugin instructs, when used in the browsers that I have

[web2py] Re: How To Remotely Log-Out a User on GAE

2014-06-19 Thread PRACHI VAKHARIA
*Please Help !!!* -- 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

Re: [web2py] Re: Brainstorming

2014-06-19 Thread samuel bonill
Massimo, in angularjs, if you want use Promises in all the application scope, you need Factory o services, example : var module = angular.module('myapp', []); module.service('userService', function(){ this.api = $http.get('http://example.com/blog/default/index/blog.json'); }); // controller

[web2py] Re: How to support DB migrations on Heroku?

2014-06-19 Thread Rene Dohmen
Hi, I did some more testing - uploads in a work just fine; it seems to go wrong with our automatic thumbnailing stuff. The thumbs were saved on disk (static/thumbnails) via a compute lambda construction. Field('logo','upload', requires=IS_IMAGE(), label=T('Members logo')),

[web2py] Re: parameterized router BASE breaks appadmin redirection

2014-06-19 Thread cowbert
Actually ticket URLs are also broken in this way (since it sends to /admin/ticket instead of to BASE + /admin/ticket... On Monday, May 12, 2014 10:06:56 PM UTC-4, cowbert wrote: When BASE is specified in a parameterized router, and an unauthenticated session tries to go to the appadmin URL,

[web2py] Re: Trying to use the LOAD helper, if a button is clicked

2014-06-19 Thread Anthony
trying to find out more about $.web2py.component, but it's not in the book. Chapter 11 mentions web2py_ajax_component but it isn't mentioned in Chapter 12 as indicated. It used to be web2py_component (actually, you can still use that), but now it's $.web2py.component. Anthony, I don't

[web2py] Re: Brainstorming

2014-06-19 Thread JorgeH
*I am tempted to say Angular is to Django as Ractive is to web2py.* On Thursday, June 19, 2014 5:41:31 PM UTC-5, Massimo Di Pierro wrote: Good way to put it! Besides, angular has routing and other functioinalities that web2py already has. It doesn't make much sense having to learn and

[web2py] Re: Ticket in Appadmin when viewing a table

2014-06-19 Thread Massimo Di Pierro
Download this: https://github.com/web2py/web2py/archive/master.zip Unzip it and copy web2py over the old one. On Thursday, 19 June 2014 17:28:41 UTC-5, Omri Levy wrote: Hi Massimo, Thanks , I experience this bug a lot, I think it's when I update list of references to the same table in the

[web2py] Re: How To Remotely Log-Out a User on GAE

2014-06-19 Thread Massimo Di Pierro
Hello Prachi, On GAE there are no session files. I am assuming you store sessions in a session table. Recommended behavior on GAE. You can access the table through the Google Dashboard. You can use the Dashboard to delete everything in that table and it will logout everybody. The file name

Re: [web2py] Re: Brainstorming

2014-06-19 Thread Massimo Di Pierro
In ractive there is nothing equivalent to this; module.controller('FooController', function($scope, userService){ $scope.data = userService.api.success(function(data) .etc.. ); }); You do not have to bind a controller to a scope. You can still do this: input type=text value={{yourName}}

[web2py] Re: how to create an album and view photos belonging to that album

2014-06-19 Thread Rahul
Thanks! for replying Dave. While I am open to suggestions, I plan to redirect the request such that as soon as the user clicks on any album thumbnail - he gets redirected to a page (perhaps viewalbum.html) where all images belonging to a particular album are listed. Thanks, Rahul. On

Re: [web2py] RapydScript / RapydML - impressive

2014-06-19 Thread Charles Law
Hey everyone, I'm glad people have have discovered the RapydML and RapydScript! I helped develop the original RapydScript, so I can answer some questions about that. I also have experience with RapydML, but have not really tried anything tricky with it (about the same level as the Readme).

[web2py] REG:datetime comparisions

2014-06-19 Thread web2pylover
Can you please help me in comparing two datetime values in db? I mean i need to select few records in db which lies between a certain duration of time. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -