[web2py] Re: Selecting records that are not referenced by other records.

2013-09-24 Thread Niphlod
Il giorno mercoledì 25 settembre 2013 08:46:15 UTC+2, onetwomany ha scritto: > > > > you can do that with >> >> all_courses = db(db.courses.id>0)._select(db.courses.memberid) >> all_members_not_in_courses = db(~db.members.id.belongs(all_courses)) >> >> >>> > Would such an approach be computationa

[web2py] Re: Selecting records that are not referenced by other records.

2013-09-24 Thread onetwomany
you can do that with > > all_courses = db(db.courses.id>0)._select(db.courses.memberid) > all_members_not_in_courses = db(~db.members.id.belongs(all_courses)) > > >> Would such an approach be computationally expensive particularly if the number of rows in courses is high? Perhaps the following r

[web2py] Re: Selecting records that are not referenced by other records.

2013-09-24 Thread Niphlod
it's explained pretty well on the book http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#belongs let me know if something is not clear Il giorno mercoledì 25 settembre 2013 07:11:27 UTC+2, step ha scritto: > > Niphlod, can you please explain why you're using method _se

[web2py] Re: Web2py 2.6.4 xmlrpc bug?

2013-09-24 Thread IVINH
Yes, it's work fine on 2.4.5. Vào 10:41:29 UTC+7 Thứ tư, ngày 25 tháng chín năm 2013, Massimo Di Pierro đã viết: > > Did you define the function ? > > @servicex.xmlrpc > def add(a,b): return a+b > > > On Tuesday, 24 September 2013 20:26:01 UTC-5, IVINH wrote: >> >> I find this with web2py 2.6.4:

[web2py] Unable to get the data, ajax fail with status is 200

2013-09-24 Thread Jayakumar Bellie
Hi, I have a function in controller def get_data_content(): message = [] dateSel = str(request.vars.dateSel).replace("-","") tmp_file = "/tmp/data/View" + dateSel f = open(tmp_file, 'r') for lineContent in reversed(list(f)): lineMessage = {} lineMessage['data']

[web2py] Re: references how to create module in web2py

2013-09-24 Thread 黄祥
what is the best way, to using request, response, session, cache, t and auth in modules? i follow the anthony suggestion on this forum, it can be passed as an argument when i call it from my controller. my question is just auth that can be passed as an argument or everything (request, response,

[web2py] Re: Selecting records that are not referenced by other records.

2013-09-24 Thread step
Niphlod, can you please explain why you're using method _select instead of select in your code below? In there no need to connect to SQL to set all_courses? On Tuesday, September 24, 2013 3:35:34 PM UTC+2, Niphlod wrote: > > you can do that with > > all_courses = db(db.courses.id>0)._select(db.c

[web2py] Re: Active/Ldap directory and Group restrictions access

2013-09-24 Thread Luca Guerrieri
Thank you Camille, finally I've found a solution and i'v written a little how to on web2pyslices http://www.web2pyslices.com/slice/show/1715/authentication-and-group-control-with-active-directory-ldap Luca Il giorno domenica 15 settembre 2013 20:09:01 UTC+2, Luca Guerrieri ha scritto: > > Hi

[web2py] Re: Using @auth.requires_login() in modules

2013-09-24 Thread Mandar Vaze
Even I have come across such requirements. Similar to Reza's requirement - we want to allow read operations to anyone, but insert/update/delete only for logged in user. Moreover, we also want to check auth.has_membership too. DB operations could be invoked from several different places, differen

[web2py] Re: Permission check for a user in multiple groups

2013-09-24 Thread Jayakumar Bellie
We have the following - db.auth_user - db.auth_group - db.auth_membership - db.auth_permission I have created few more tables db.define_table("devices_config", Field("name", "string", length=50, notnull=True), Field("device_type", "string", length=5, notnull=True)) db

[web2py] Inserting NULL with SQLFORM, list:string, and multiple=True

2013-09-24 Thread REM
I am inserting data into my trusty mysql db using SQLFORM. One of the form elements is a drop-down list of states. The behavior I wish to happen is to either insert a |normal|list|of|states| or, if nothing is selected, NULL. However, when nothing is selected, it is inserting ||, and I can't seem

[web2py] Re: Web2py 2.6.4 xmlrpc bug?

2013-09-24 Thread Massimo Di Pierro
Did you define the function ? @servicex.xmlrpc def add(a,b): return a+b On Tuesday, 24 September 2013 20:26:01 UTC-5, IVINH wrote: > > I find this with web2py 2.6.4: > > >>> s = ServerProxy('http://127.0.0.1:8000/app/default/call/xmlrpc') > >>> print s.add(3,4) > Traceback (most recent call last

[web2py] Query Not Supported: no such column: config.conv_config_value

2013-09-24 Thread Hadi Sunyoto
The error occurs not as an exception, but inside html. model: db.define_table('config', Field('config_name', length=50, required=True, unique=True), Field('convert_option', length=50, requires=IS_IN_SET(CONVERSION, zero=None)), Field('config_value', length=50, required=True),

[web2py] Re: Last release of web2py doesn't run on MacOSX

2013-09-24 Thread Sylvain MAFFREN
Hi, I have downloaded the nightly built and the issue is solved. Thanks a lot! Le 24/09/13 22:53, Massimo Di Pierro a écrit : Please try the nightly built in 10 minutes. Let us know if that fixes the issue. On Tuesday, 24 September 2013 06:05:10 UTC-5, Sylvain MAFFREN wrote: Hi, I

[web2py] Web2py 2.6.4 xmlrpc bug?

2013-09-24 Thread IVINH
I find this with web2py 2.6.4: >>> s = ServerProxy('http://127.0.0.1:8000/app/default/call/xmlrpc') >>> print s.add(3,4) Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\xmlrpclib.py", line 1224, in __call__ return self.__send(self.__name, args) File "C:\Pyth

[web2py] How can I give google map javascript api marker title a suitably encoded string?

2013-09-24 Thread User
I'm using the google map javascript api (v3). I have a google map in one of my views. I want to display the location name as the marker title (used when hovering over the marker). I'm using the following code in my view: function init_map() { var myLatlng = new google.maps.LatLng

[web2py] Re: references how to create module in web2py

2013-09-24 Thread 黄祥
thank you so much massimo, it works now when i rename the module file name and the module name on controller */test/modules/justforlearn.py* from gluon import * def ip(): return current.request.client */test/controllers/default.py* from gluon.custom_import import track_changes; track_changes(True

[web2py] Re: scheduler help

2013-09-24 Thread Antonis Konstantinos Tzorvas
updateMap instead of updateMaps in queue_task... maybe I need to go to bed.. :P thanks a lot and sorry for the inconvenience On Wednesday, September 25, 2013 2:59:02 AM UTC+3, Antonis Konstantinos Tzorvas wrote: > > ok, it was some missing imports, so now i can run my function from the > appadm

[web2py] Re: scheduler help

2013-09-24 Thread Antonis Konstantinos Tzorvas
ok, it was some missing imports, so now i can run my function from the appadmin, but trying to run it with scheduler.queue_task and nothing happens scheduler = Scheduler(db, dict(updateCharts=updateCharts, updateMaps=updateMap)) #in models/scheduler.py scheduler.queue_task(updateMap) #inside a

[web2py] Re: Form encoding problem 'ascii' codec can't encode character..

2013-09-24 Thread David Austin
On Wednesday, September 25, 2013 5:35:44 AM UTC+10, Massimo Di Pierro wrote: > > Actually you should never use unicode in this context. You should use utf8. > Given that I can use unicode for the values of many other of the html.py helpers, I would suggest that adding support for it for INPUT w

[web2py] Re: how to assign classes to TDs in SQLFORM.grid

2013-09-24 Thread Simon Ashley
> > May not work out of the box but a hint could include something like > $(this).find('td').eq(1).addClass('highlighted') > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/lis

[web2py] Re: Auth modal redirects to profile instead of index

2013-09-24 Thread raferbop
On Tuesday, September 24, 2013 1:09:51 PM UTC-5, raferbop wrote: > > def index(): >return dict(logform=auth.login(),regform=auth.register()) > > I put these two forms from the Auth module on the index page, inside a > modal but when I login/register I am redirected to a profile page instead

[web2py] Re: Auth modal redirects to profile instead of index

2013-09-24 Thread raferbop
On Tuesday, September 24, 2013 1:09:51 PM UTC-5, raferbop wrote: > > def index(): >return dict(logform=auth.login(),regform=auth.register()) > > I put these two forms from the Auth module on the index page, inside a > modal but when I login/register I am redirected to a profile page instead

[web2py] Re: batch script - best way to reopen a closed database connection?

2013-09-24 Thread Ricardo Cárdenas
@Derek - makes sense - I'll try this. thanks again. On Tuesday, September 24, 2013 5:14:28 PM UTC-5, Derek wrote: > > import db.py always, that should be your first line of a function. > > On Tuesday, September 24, 2013 2:55:21 PM UTC-7, Ricardo Cárdenas wrote: >> >> Derek, thanks for your sugge

[web2py] Re: Auth modal redirects to profile instead of index

2013-09-24 Thread raferbop
Yes, they were both working but I have set form to auth() and elected to use LOAD() instead now but I have a similar problem. I am being redirected to default/index.load after I loggin. upon manually reloading this same page, I am redirected to default/user.load/profile. These pages have no fo

[web2py] Re: batch script - best way to reopen a closed database connection?

2013-09-24 Thread Ricardo Cárdenas
@niphlod - db.reconnect() method does not exist, but db._adapter.reconnect() does. I'll try it now - though I'm a little reluctant to use an underscore_attribute that was probably meant to be private :) On Tuesday, September 24, 2013 5:23:31 PM UTC-5, Niphlod wrote: > > if I'm not mistaken a s

Re: [web2py] Re: batch script - best way to reopen a closed database connection?

2013-09-24 Thread Ricardo Cárdenas
@michele - No, I'm not doing a db.commit() -- because I don't use the db connection at all, until many minutes later, when it fails. However, you bring up an interesting point. Does this mean that if I db.commit() at the very beginning of my script (even if there is no outstanding transaction),

[web2py] Re: Variable db Table Name

2013-09-24 Thread ewong1111
cool 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" gro

[web2py] Re: Variable db Table Name

2013-09-24 Thread Niphlod
db.tablename.fieldname is just another way to access db[tablename][fieldname] . More or less like a Storage On Tuesday, September 24, 2013 11:46:22 PM UTC+2, ewon...@gmail.com wrote: > > Is there any way to use a variable for a db table name as part of a query? > > Say if I have multiple tables

[web2py] Re: batch script - best way to reopen a closed database connection?

2013-09-24 Thread Niphlod
if I'm not mistaken a simple db.reconnect() should do the trick. or db._adapter.reconnect() . But mcm has a point. -- 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 Is

Re: [web2py] Re: batch script - best way to reopen a closed database connection?

2013-09-24 Thread Michele Comitini
Did you remember to do a commit at each round? A long running script / daemon can do: db=DAL... while True: db.commit() sleep(1000) # <- just for exampl i.e. don't do anything for a long time The DAL pushes the connection "back to sleep in the pool" [ :-) ] when there is a commit. Wh

[web2py] Re: crud update question

2013-09-24 Thread Avi A
Will look at the book...thanks. On Wednesday, September 25, 2013 12:46:04 AM UTC+3, Niphlod wrote: > > yep but do not reinvent the wheel: use URL(... user_signature) and > @auth.requires_signature() > > On Tuesday, September 24, 2013 11:03:39 PM UTC+2, Avi A wrote: >> >> Thanks a lot, I will chec

[web2py] Re: crud update question

2013-09-24 Thread Niphlod
did you read the book link I gave you ? If yes, and if you actually tried, you wouldn't ask this question :-P Signed URLs means that everybody won't be able to access manage/5 unless they pass the correct signature, that is quite impossible to guess in advance If you don't want to use signed u

[web2py] Re: batch script - best way to reopen a closed database connection?

2013-09-24 Thread Derek
import db.py always, that should be your first line of a function. On Tuesday, September 24, 2013 2:55:21 PM UTC-7, Ricardo Cárdenas wrote: > > Derek, thanks for your suggestion. Which is the preferred way to reopen > the connection and define the tables? > > My db.py contains > > db = DAL(conne

[web2py] Re: crud update question

2013-09-24 Thread Avi A
Not sure I understand how it can help. If I got a page for a logged in user: dashboard/my items. where only my items are displayed. (as filtered by field item creator) and on each item on the list there is a link to edit the item manage/item.id.( as with crud upade method.) then I will have a list

[web2py] Re: batch script - best way to reopen a closed database connection?

2013-09-24 Thread Ricardo Cárdenas
Derek, thanks for your suggestion. Which is the preferred way to reopen the connection and define the tables? My db.py contains db = DAL(connection_string, options...) db.define_table('table1', Field('f1' ...), Field('f2'...)) db.define_table(...) db.define_table(...) ... So ideally I wouldn't

[web2py] Variable db Table Name

2013-09-24 Thread ewong1111
Is there any way to use a variable for a db table name as part of a query? Say if I have multiple tables with a field called "name" could I create a function such as this? def query_db(tbl, my_name):

[web2py] Re: crud update question

2013-09-24 Thread Niphlod
yep but do not reinvent the wheel: use URL(... user_signature) and @auth.requires_signature() On Tuesday, September 24, 2013 11:03:39 PM UTC+2, Avi A wrote: > > Thanks a lot, I will check it. > I just thought that I could add a args(1) which will be a random number > the controller will create a

[web2py] Re: batch script - best way to reopen a closed database connection?

2013-09-24 Thread Derek
Each time you need to do work, you should open a new connection. You'd think there is a large overhead in creating a connection, but there isn't. On Tuesday, September 24, 2013 2:33:24 PM UTC-7, Ricardo Cárdenas wrote: > > I have a web2py app running fine on pythonanywhere. I have a minor problem

[web2py] Re: Profiling web2py

2013-09-24 Thread Derek
> randomly slows down That's probably the garbage collector in python running, if you want more predictable slowdowns, you can call the collector manually... On Tuesday, September 24, 2013 1:23:52 PM UTC-7, Saurabh Kumar wrote: > > My website some times randomly slows down and recovers on its ow

Re: [web2py] Pycharm 3.0 is here with web2py support

2013-09-24 Thread Michele Comitini
+1 This is great! 2013/9/24 Alfonso de la Guarda > Hi, > > Finally we got pycharm 3 with web2py support, there is also a > community OSS version with some missing features but great for many > python devs. > > http://www.jetbrains.com/pycharm/whatsnew/index.html > > > Saludos, > >

[web2py] batch script - best way to reopen a closed database connection?

2013-09-24 Thread Ricardo Cárdenas
I have a web2py app running fine on pythonanywhere. I have a minor problem - I think I understand why it is happening, but would seek your advice as to how best to fix it. The app itself works fine. But I also run a scheduled task using PA's scheduler, by executing "python web2py.py -S appname

[web2py] SQLFORM grid save checkbox state in multi-page results

2013-09-24 Thread ewong1111
I have the same question as asked here: https://groups.google.com/forum/#!searchin/web2py/grid$20checkbox$20pages/web2py/laMiQozWj_k/Wq6SdDDSajUJ I know how to use ajax to call a controller function that will register the checked row in a session variable. What I don't know is how to use the

[web2py] security warning - DISABLED apps in 2.6.4

2013-09-24 Thread Massimo Di Pierro
Mind that the ability to disable apps is broken in 2.6.x. You can disable them you can re-enable them, but if you disable them again it does not work. This is fixed in trunk and it will be fixed in 2.7.1 shortly. Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation

Re: [web2py] Re: Grid and mouseover/tooltips

2013-09-24 Thread Warren Block
Nice--that works great! On Tue, 24 Sep 2013, Niphlod wrote: alter the represent of the fields in the controller running the grid: it's the right tool for the job e.g. db.table.field.represent = lambda value, row : DIV("%s ..." % value[10], _title=value) On Tuesday, September 24, 2013 10:

[web2py] Pycharm 3.0 is here with web2py support

2013-09-24 Thread Alfonso de la Guarda
Hi, Finally we got pycharm 3 with web2py support, there is also a community OSS version with some missing features but great for many python devs. http://www.jetbrains.com/pycharm/whatsnew/index.html Saludos, Alfonso de la Guarda Twitter: @alfonsodg Redes socia

Re: [web2py] Re: Profiling web2py

2013-09-24 Thread Michele Comitini
A nice thing of the new profiler is that does not require serialization of each single request handling loop, you can use parallel (forked or threaded) task without conflicts. Watch out! the directory pointed by -F is going to fill up quickly on a busy site! mic 2013/9/24 Niphlod > socket is t

[web2py] Re: crud update question

2013-09-24 Thread Avi A
Thanks a lot, I will check it. I just thought that I could add a args(1) which will be a random number the controller will create and then check if the args(1) == to the var random number it created? Is that the "token" method? On Tuesday, September 24, 2013 11:55:50 PM UTC+3, Niphlod wrote: >

[web2py] Re: crud update question

2013-09-24 Thread Niphlod
check if the t_categories row that the user is loading actually belongs to him record = db(db.t_categories.id == request.args(0))(db.t_categories.created_by == auth.user_id).select().first() if not record: redirect(URL('not_authorized')) BTW: with SQLFORM.grid it's easier (really). al

[web2py] Re: Last release of web2py doesn't run on MacOSX

2013-09-24 Thread Massimo Di Pierro
Please try the nightly built in 10 minutes. Let us know if that fixes the issue. On Tuesday, 24 September 2013 06:05:10 UTC-5, Sylvain MAFFREN wrote: > > Hi, > > I have tried to use the last release of web2py > (2.6.4-stable+timestamp.2013.09.22.01.43.37) under MacOSX Snow Leopard. I > get thi

[web2py] Last release of web2py doesn't run on MacOSX

2013-09-24 Thread Sylvain MAFFREN
Hi, I have tried to use the last release of web2py (2.6.4-stable+timestamp.2013.09.22.01.43.37) under MacOSX Snow Leopard. I get this error message when I click on "start server" button (withbinaries package and source code package, for MacOSX) : "dlsym(0x8fe4676c, CCKeyDerivationPBKDF): symb

[web2py] View have to be updated

2013-09-24 Thread Gael Princivalle
Hi. I'm a web2py newbie. I'm still trying to adapt the "Image" example with products. Here is my db: db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) db.define_table('articoli', Field('Codice_A', unique=True), Field('Descrizione_Breve'), Fiel

[web2py] Re: Enable button doesn't work (Admin Interface)

2013-09-24 Thread gtrzeciak
It is reproducible - happens everytime with every application. I used latest binary: Version 2.6.4-stable+timestamp.2013.09.22.17.43.26 (Running on Rocket 1.2.6, Python 2.7.0) web2py is up to date On Tuesday, September 24, 2013 4:19:10 AM UTC+2, Massimo Di Pierro wrote: >

[web2py] Re: Grid and mouseover/tooltips

2013-09-24 Thread Massimo Di Pierro
You can use represent db.table.field = lambda value, row: SPAN(value[:10],DIV(value,_class='tooltip')) and than JS jQuery(function(){ jQuery('.tootip').each(function(){ var t = jQuery(this); t.hide().css('position','relative').css('z-index','200'); t.parent.mouseover(funct

[web2py] Re: Grid and mouseover/tooltips

2013-09-24 Thread Niphlod
alter the represent of the fields in the controller running the grid: it's the right tool for the job e.g. db.table.field.represent = lambda value, row : DIV("%s ..." % value[10], _title=value) On Tuesday, September 24, 2013 10:21:31 PM UTC+2, wb wrote: > > With some fields truncated in a g

[web2py] Re: Auth modal redirects to profile instead of index

2013-09-24 Thread Massimo Di Pierro
I have never tried this but I am not sure you can have those forms in the same page. Apart for the incorrect redirect, do they both work? On Tuesday, 24 September 2013 13:09:51 UTC-5, raferbop wrote: > > def index(): >return dict(logform=auth.login(),regform=auth.register()) > > I put these t

[web2py] Re: Profiling web2py

2013-09-24 Thread Niphlod
socket is the responsible for every network communication, including for the most part database connection and depending on the handler (and on the debug) also for http traffic. If you debug by ncalls, you aren't able to see who calls what ^_^ >From 2.6.0 web2py supports dumping the profile of w

[web2py] Profiling web2py

2013-09-24 Thread Saurabh Kumar
My website some times randomly slows down and recovers on its own. I used a profiler to profile one of the controllers and found out that /usr/lib/python2.7/socket.py:336(read) is being called 12704 times taking 14.5 seconds. What could be the possible problem to cause this? root@dev:/profile_dum

[web2py] Grid and mouseover/tooltips

2013-09-24 Thread Warren Block
With some fields truncated in a grid, it would be nice to show the full value in a tooltip when the mouse is over it. Offhand, I think that will take a calculated field. Is there an example anywhere? For that matter, examples of general examples of grid use would be really nice. Thanks! --

Re: [web2py] Auth modal redirects to profile instead of index

2013-09-24 Thread Richard Vézina
I think we will need more code to understand. What you are doing is not "standard". Notice also, Bootstrap Modal had bug in the pass and was submitting all the form present on the same page... I wrote a post about that. I don't think this issue is gone and I think I had found a work around but don'

[web2py] Re: Perform checks before showing a form to the user

2013-09-24 Thread Andreas Wienes
Awesome and so beautiful. Thank you so much! Am Dienstag, 24. September 2013 21:39:35 UTC+2 schrieb Massimo Di Pierro: > > perhaps this way: > > project = db.project(request.args(0,cast=int)) > step = db.project_step(request.args(1,cast=int)) > > if not project: > url = URL('de

[web2py] Re: server logging question

2013-09-24 Thread Dave S
Manually rotating the logs without stopping the server seems to work ok, so I'm fairly confident I'll be alright when I automate it. To be explicit, manually mv'ing the httpserver.log file works; but so does having a logrot.cfg and manually doing logrotate -vf logrot.cfg. I didn't use the "copy"

Re: [web2py] Kvasir: Penetration test-driven data management in web2py

2013-09-24 Thread Massimo Di Pierro
Keep us posted. This project is very important for our community. I had been looking for a penetration testing tool in python for long time. :-) On Tuesday, 24 September 2013 12:02:01 UTC-5, Kurt Grutzmacher wrote: > > Thanks everyone! > > A video overview of the features is planned. If anyone i

Re: [web2py] Auth modal redirects to profile instead of index

2013-09-24 Thread Massimo Di Pierro
Or without c and f: auth.settings.login_next = URL('default', 'index') On Tuesday, 24 September 2013 13:29:27 UTC-5, Richard wrote: > > You can use this in model : > auth.settings.login_next = URL(c='default', f='index') > > Richard > > > On Tue, Sep 24, 2013 at 2:09 PM, raferbop > > wrote: > >>

Re: [web2py] Auth modal redirects to profile instead of index

2013-09-24 Thread raferbop
Thanks Richard, I just tried it but it seems to have been ignored and Im still being redirected to /default/user/profile -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Rep

[web2py] Re: Perform checks before showing a form to the user

2013-09-24 Thread Massimo Di Pierro
perhaps this way: project = db.project(request.args(0,cast=int)) step = db.project_step(request.args(1,cast=int)) if not project: url = URL('default', 'index') elif auth.user_id != project.created_by or not step: url = URL('project', 'show', args=request.args(0)

[web2py] Re: Form encoding problem 'ascii' codec can't encode character..

2013-09-24 Thread Massimo Di Pierro
Actually you should never use unicode in this context. You should use utf8. The difference between value and _value in this case is whether, on error, the form should be reset to the value or not. On Tuesday, 24 September 2013 02:55:38 UTC-5, David Austin wrote: > > Hi Massimo, > > Here's a simpl

Re: [web2py] Re: Enable button doesn't work (Admin Interface)

2013-09-24 Thread Massimo Di Pierro
Yes there is a bug. Somehow an experimental feature slipped in. Fixed in trunk and will release a stable version asap. On Tuesday, 24 September 2013 01:11:59 UTC-5, Marin Pranjić wrote: > > It happened to my but only for applications that were already disabled > before I updated web2py version.

[web2py] Re: references how to create module in web2py

2013-09-24 Thread Massimo Di Pierro
Can you try rename it? You are importing something else. On Monday, 23 September 2013 23:04:30 UTC-5, 黄祥 wrote: > > @massimo > */test/controllers/default.py* > from gluon.custom_import import track_changes; track_changes(True) > import test > def index(): > return str(dir(test)) > > *['__built

[web2py] Re: session add value error on pythonanywhere

2013-09-24 Thread Massimo Di Pierro
Please try trunk again. On Monday, 23 September 2013 23:43:34 UTC-5, 黄祥 wrote: > > hi, > > i have an application that using session to store the value, it running > well on my local, but got an error when i test on pythonanywere, is there > any special treat for session (add, remove, destroy, et

[web2py] About web2py developer community

2013-09-24 Thread Michele Comitini
I think this is worth sharing. What ohloh says: https://www.ohloh.net/p/web2py/factoids#FactoidTeamSizeVeryLarge So don't be fooled by the usual naysayers that come around telling you that this is one man band framework. They must have some stakes on competing frameworks ;-) mic -- Resources

Re: [web2py] Re: Grid title

2013-09-24 Thread Warren Block
Okay, that makes sense. I do intend to make custom views, even more so now. For now, default/index.html is just: {{extend 'layout.html'}} {{=grid}} Thanks! On Tue, 24 Sep 2013, Anthony wrote: Oops, sorry -- the default/index.html view that comes with the scaffolding app includes {{=BE

Re: [web2py] dlsym(0x8fe46768, CCKeyDerivationPBKDF): symbol not found ?????

2013-09-24 Thread Michele Comitini
Can you update to trunk? Automatic detection should now work, can you give it a try? tnx mic 2013/9/23 Michele Comitini > This points to a problem in detecting a missing function in the crypto > library on that version (old) of mac os x). > I am working on a fix. > In the mean time to force w

Re: [web2py] Auth modal redirects to profile instead of index

2013-09-24 Thread Richard Vézina
You can use this in model : auth.settings.login_next = URL(c='default', f='index') Richard On Tue, Sep 24, 2013 at 2:09 PM, raferbop wrote: > def index(): >return dict(logform=auth.login(),regform=auth.register()) > > I put these two forms from the Auth module on the index page, inside a >

Re: [web2py] Kvasir: Penetration test-driven data management in web2py

2013-09-24 Thread Michele Comitini
Kurt, Nice job! Have you used it also to asses security of machines with web2py installed? Do you think it can be usedd to improve security of web2py itself? mic 2013/9/24 Kurt Grutzmacher > Thanks everyone! > > A video overview of the features is planned. If anyone is going to ToorCon > San

[web2py] Auth modal redirects to profile instead of index

2013-09-24 Thread raferbop
def index(): return dict(logform=auth.login(),regform=auth.register()) I put these two forms from the Auth module on the index page, inside a modal but when I login/register I am redirected to a profile page instead of the index page. What can I do to prevent the redirect or go the index pag

Re: [web2py] Re: Grid title

2013-09-24 Thread Anthony
Oops, sorry -- the default/index.html view that comes with the scaffolding app includes {{=BEAUTIFY(response._vars)}} when there is no "message" or "content" variable returned, which is the same thing the generic.html view does when more than one variable is returned. Keep in mind that if you w

[web2py] crud update question

2013-09-24 Thread Avi A
Hi , i want to display a user a list of item tht belongs to him: my_items= db(db.t_categories.created_by==auth.user.id).select(db.t_categories.ALL) Then allow him to update each item from the list: item_update=crud.update(db.t_categories,request.args(0)) so far so good. My problem is on the /args(

Re: [web2py] Re: Grid title

2013-09-24 Thread Warren Block
The default/index.html view exists (the default "simple app" one), so it's not clear to me why it is using generic.html. The index() function does not explicitly define any other variables, but the "grid:" is displayed even if the index() function returns dict(grid=grid). On Tue, 24 Sep 2013

[web2py] Re: Grid title

2013-09-24 Thread Anthony
It looks like you have not created a view for this function, so the generic.html view is being used instead. When you return multiple variables, the generic view displays the name of each variable. Since you are returning locals(), I assume you must have defined other variables in the index() f

Re: [web2py] Kvasir: Penetration test-driven data management in web2py

2013-09-24 Thread Kurt Grutzmacher
Thanks everyone! A video overview of the features is planned. If anyone is going to ToorCon San Diego in October I will be giving a brief presentation on Oct 20. António Ramos wrote: > Only a video presentation is missing. > > Nice work > > > 2013/9/24 step mailto:step.l...@gmail.com>> > >

[web2py] Grid title

2013-09-24 Thread Warren Block
On both 2.5.1 and 2.6.4, grids are rendered with the name of the variable visible. For example: def index(): grid = SQLFORM.grid(db.names, fields = [db.names.lastname, db.names.firstname]) return locals() On screen, this renders (roughly) as: grid : _ Search Clear

[web2py] Re: how to assign classes to TDs in SQLFORM.grid

2013-09-24 Thread Anthony
If you know the column number, you could also use the jQuery nth-child selector: http://api.jquery.com/nth-child-selector/. Anthony On Tuesday, September 24, 2013 8:44:32 AM UTC-4, Tim Richardson wrote: > > The grid has a checkbox from use of selectable. Submit invokes a function > which proces

Re: [web2py] geocode() return value

2013-09-24 Thread Ricardo Cárdenas
Hi Manuele, Thanks for your email. (0,0) in effect represents two possible outcomes: "*I could not geocode this address*" and also "*please try again later*". How can I know if it makes sense to retry later? best regards -Ricardo On Tuesday, September 24, 2013 8:26:38 AM UTC-5, Manuele wrote

[web2py] Re: Selecting records that are not referenced by other records.

2013-09-24 Thread Niphlod
you can do that with all_courses = db(db.courses.id>0)._select(db.courses.memberid) all_members_not_in_courses = db(~db.members.id.belongs(all_courses)) you can eventually throw in a distinct on db.courses.memberid if the number of courses rows is plenty. Il giorno martedì 24 settembre 2013 12:

Re: [web2py] geocode() return value

2013-09-24 Thread Manuele Pesenti
Il 24/09/13 15:13, Ricardo Cárdenas ha scritto: > The gluon.tools geocode() function is great. > > A minor suggestion. Right now it returns (0,0) on any execption. It > would be nice if the function distinguished between /unable to geocode > this address/ and other problems (such as quota reached).

[web2py] geocode() return value

2013-09-24 Thread Ricardo Cárdenas
Hi, The gluon.tools geocode() function is great. A minor suggestion. Right now it returns (0,0) on any execption. It would be nice if the function distinguished between *unable to geocode this address* and other problems (such as quota reached). Use case: I geocode addresses as they come in a

[web2py] Re: how to assign classes to TDs in SQLFORM.grid

2013-09-24 Thread Tim Richardson
The grid has a checkbox from use of selectable. Submit invokes a function which processes the selected rows. Each row has a value. I plan to use jquery to show the sum of all selected rows. It would be easiest to use a class to find the cell in each row that contains the value I want to sum. -

Re: [web2py] Kvasir: Penetration test-driven data management in web2py

2013-09-24 Thread António Ramos
Only a video presentation is missing. Nice work 2013/9/24 step > nice and comprehensive intro in the first linked post! > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/is

[web2py] Kvasir: Penetration test-driven data management in web2py

2013-09-24 Thread step
nice and comprehensive intro in the first linked post! -- 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 subscribe

[web2py] Re: how to assign classes to TDs in SQLFORM.grid

2013-09-24 Thread Simon Ashley
Suspect that a jquery onclick event may be involved, followed by a calculateSum. Would help if you posted a simple example of what you need to happen. (based on lateral thinking/interpretation of your first paragraph) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Selecting records that are not referenced by other records.

2013-09-24 Thread Michael Hall
I am not the most awesome SQL person and as such I am having trouble constructing a query I need. I have two tables in a database called "old". The parent table is called "members" and there is a child table called "courses". # old.define_table('members', Field('id'), Field('pro

Re: [web2py] retrieve value from custom auth_user field for current user login

2013-09-24 Thread 黄祥
hm, it's strange, because i define it on the models after i define auth table. i define custom auth table in db.py and put the default value that refer to custom auth table in db_wizard_warehouse_transaction.py (the same definition that work when i define it on controller). if i'm not wrong web

[web2py] Re: Trouble Updating to 2.6.4 from 2.5.1

2013-09-24 Thread Michael Hall
What worked for me when this happened was simply to download the latest source of the site and unzip it to my web2py folder thus overwriting the incomplete upgrade. I restart web2py or in the case of my webfaction server I restart apache which restarts web2py and then everything works as normal

[web2py] Perform checks before showing a form to the user

2013-09-24 Thread Andreas Wienes
Hey guys, in my current project I need to perform some checks before showing a form to the user. I'm not sure if I've done this in the best possible way. It looks a bit complicated to me. project = db.project(request.args(0)) step = db.project_step(request.args(1)) # Is the proje

[web2py] how to assign classes to TDs in SQLFORM.grid

2013-09-24 Thread Tim Richardson
apart from using a function for represent on the db field, how can classes be assigned to the TD elements of SQLFORM.grid so that each column belongs to its own class? (Or I suppose to make it generalised, passing HTML attributes to the TD) I want to use jquery to show a total of all rows selec

[web2py] Re: Form encoding problem 'ascii' codec can't encode character..

2013-09-24 Thread David Austin
Hi Massimo, Here's a simple test example: Controller: def utfinput(): s = u'\u2026' form = FORM('Test', INPUT(_name='test1', value=s), INPUT(_name='doit', _type='submit', _value='Submit')) if form.accepts(request.vars, session):