Re: [web2py] Re: Bootstrap datepicker plugin

2015-05-12 Thread Manuele Pesenti
Il 11/05/15 23:01, villas ha scritto: Thanks Leonel. BTW in your first post you said: Field('birthdate', 'date', widget=bsdatepicker_widget) It should be with brackets at the end: Field('birthdate', 'date', widget=bsdatepicker_widget()) No it shouldn't the widget parameter

[web2py] Re: web2pyslicesgate

2015-05-12 Thread Alan Etkin
zvolsky also. On Monday, May 11, 2015 at 10:43:25 AM UTC-7, Derek wrote: Looks okay, needs to be pruned though as I see mirek posted a bunch of nonsense there. Done -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Plugins Error

2015-05-12 Thread xmarx
hi! when i click from design page (http://127.0.0.1:8000/admin/default/design/examples) download plugins from repository button, i get an error like this: TypeError: list indices must be integers, not str screenshot is there. Thank you. -- Resources: - http://web2py.com -

[web2py] Re: is there a way to use auth_permission to allow user to access records based upon field value?

2015-05-12 Thread Alex Glaros
Anthony, trying to get basic syntax to work. What is wrong with below? auth.settings.extra_fields['auth_group']= [ Field('organizationID','integer'), common_filter = lambda query: db.auth_group.organizationID==7)] File C:/alex/web2py/web2py/web2py/applications/ES1/models/db.py

[web2py] Customizing registration Fields for Linkedin API log in.

2015-05-12 Thread John Costantino
I have gotten the linkedin Log in functioning properly. However when I register a use I would like to take in a few extra fields from that user. Is it possible to me to perhaps create mappings to specific fields in my DB to the attributes I will be pulling from the API call on registration? --

[web2py] Why export to csv is not taking label from model file where as Grid does?

2015-05-12 Thread Sujata Aghor
​​Hi, In my model file I have defined table and Label for the fields like this - db.define_table('mytable', Field('fname', 'string', length=12, writable=False, notnull=True, label='First Name'), Field('lname', 'string', length=12,

[web2py] Customizing registration fields for linkedin login

2015-05-12 Thread John Costantino
I have my application currently logging in and registering with linkedin. But when I register only a select few fields get filled. (first name, last name, email). I would like to also get the users public-url on registration. I am not sure how to do this. Is it possible for me to custom map

[web2py] Export to csv is not taking label from model file where as Grid does.

2015-05-12 Thread Sujata Aghor
​ ​​ Hi, In my model file I have defined table and Label for the fields like this - db.define_table('mytable', Field('fname', 'string', length=12, writable=False, notnull=True, label='First Name'), Field('lname', 'string', length=12,

[web2py] Deadlock in cache.py/CacheOnDisk in R 2.10.4

2015-05-12 Thread Bernard Letourmy
We found a blocking issue in our app with some image download after upgrading from 2.9.12 to 2.10.4 It turned out to be a deadlock in CacheOnDisk class in case of exception in our cache callback function, normally handled in our app without any issue until now. the new file_locks introduced

[web2py] function

2015-05-12 Thread KevC
Hi community! I want to call a function inside other function, What can I do? For example: def function_1(): y = 'This is an example' (I wanna here my function function_2) return locals() def function_2(): x = 'Hello world' return locals() My best regards. --

[web2py] Export to csv which is not taking label from model file, where Grid takes.

2015-05-12 Thread Sujata Aghor
Hi, In my model file I have defined table and Label for the fields like this - db.define_table('mytable', Field('fname', 'string', length=12, writable=False, notnull=True, label='First Name'), Field('lname', 'string', length=12,

[web2py] Re: Plugins Error

2015-05-12 Thread Alan Etkin
El martes, 12 de mayo de 2015, 14:07:54 (UTC-3), xmarx escribió: hi! when i click from design page ( http://127.0.0.1:8000/admin/default/design/examples) download plugins from repository button, i get an error like this: With what version? Maybe the admin app can't get the list of

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Dave S
On Monday, May 11, 2015 at 7:42:06 PM UTC-7, Lisandro wrote: I've figured it out: when using a central db for the scheduler, there is no need (at least in this case) of calling web2py.py -K with all the apps, just with the main app, in my case: python /home/user/web2py/web2py.py -K

[web2py] pack all - internal error - Error 3 - cache/chache

2015-05-12 Thread Tamer Bahget
Hi I am totally new to Web2py and I was trying to use (Pack all) for the (Welcome) app when this error appeared: internal error: [Error 3] The system cannot find the path specified: '.../applications/welcome/cache/cache' I am using Windows 7 , Python 2.7.9 Any ideas, please? -- Resources: -

[web2py] How to move a set of view,edit,delete buttons from last column to first column on SQLgrid?

2015-05-12 Thread Kenneth
Hello, Lately, I've started playing with sqlgrid since it saves so much time pulling out all data in a page. The problem is that I have a table with 20 attirbutes saved in it, it's hard to scroll to the end of right side and click on view/edit buttons. Is there any way to move those buttons

[web2py] Re: function

2015-05-12 Thread Derek
just call it... function2() you could even define the second function inside the first if you wanted. On Tuesday, May 12, 2015 at 10:07:03 AM UTC-7, KevC wrote: Hi community! I want to call a function inside other function, What can I do? For example: def function_1(): y = 'This is

[web2py] Re: How to move a set of view,edit,delete buttons from last column to first column on SQLgrid?

2015-05-12 Thread Niphlod
takend straight from the book at http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid-and-SQLFORM-smartgrid *buttons_placement and links_placement both take a parameter ('right', 'left', 'both') that will affect where on the row the buttons (or the links) will be

[web2py] Re: function

2015-05-12 Thread Dave S
On Tuesday, May 12, 2015 at 10:07:03 AM UTC-7, KevC wrote: Hi community! I want to call a function inside other function, What can I do? For example: def function_1(): y = 'This is an example' (I wanna here my function function_2) return locals() def function_2(): x

[web2py] Re: Current logged in users

2015-05-12 Thread A36_Marty
Along the same lines, is there a way to log any/everyone out / even force-expiring cookies for users who have selected the remember me login option? I asked due to noticing an auth_user record can be deleted but they can still access the system for functions decorated with @auth.requires_login

[web2py] Re: Export to csv is not taking label from model file where as Grid does.

2015-05-12 Thread Niphlod
double. replied in the other thread. On Tuesday, May 12, 2015 at 7:07:17 PM UTC+2, Sujata Aghor wrote: ​ ​​ Hi, In my model file I have defined table and Label for the fields like this - db.define_table('mytable', Field('fname', 'string', length=12, writable=False,

[web2py] Re: Export to csv which is not taking label from model file, where Grid takes.

2015-05-12 Thread Niphlod
the export are for raw processing, so they get the same result as you would get - for practical purposes - from db(query).select().as_csv() On Tuesday, May 12, 2015 at 7:07:40 PM UTC+2, Sujata Aghor wrote: Hi, In my model file I have defined table and Label for the fields like this -

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Lisandro
Sorry to say that wasn't completely the solution :/ Don't know exactly why, it ran ok during some minutes, and then I see that tasks didn't get executed. I executed the worker manually with -D 0 option, and this is what I see: DEBUG:pyDAL:Your database version does not support the JSON data

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Lisandro
Thanks Niphlod. I double checked, and the tasks are there. The main app is called medios and has this in its model file: db = DAL(\ 'postgres://%s:%s@%s/%s' %(DB_USER, DB_USER_PASSWORD, DB_HOST, DB_NAME), \ lazy_tables=True) from gluon.scheduler import Scheduler scheduler = Scheduler(db,

[web2py] Re: Deadlock in cache.py/CacheOnDisk in R 2.10.4

2015-05-12 Thread Paolo Valleri
can you open an issue/pull request on github? Paolo On Tuesday, May 12, 2015 at 7:06:47 PM UTC+2, Bernard Letourmy wrote: We found a blocking issue in our app with some image download after upgrading from 2.9.12 to 2.10.4 It turned out to be a deadlock in CacheOnDisk class in case of

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Niphlod
seems that there aren't any tasks in the database the scheduler is looking in. Sure that there are no misconfigurations ? BTW: there's nothing wrong with your approach. A worker needs a -K argument only to inherit initialization options from that app: it's perfectly capable of processing

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Lisandro
Thanks for the assistance. That query returned exactly the tasks that need to be (but are not) executed. I think it could be something about the web2py version. In the server (where tasks aren't executed) I'm running version 2.10.3. On localhost, I have the exact same configuration (ubuntu,

[web2py] Using for

2015-05-12 Thread KevC
Hi! I got a problem, I wanna print a list or string on a 'view' using a 'for' but the view only show me the last number or letter. For example: My controller... for i in 'hola': print i return locals() My view... {{=i}} The view only show me the letter 'a'. Other example: a =

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Niphlod
not really. exceptions are not shown and nothing to do kinda leaves up nothing to imagination you can inspect the worker_stats column on the worker that is also a ticker but I assume you won't find anything. you can run this query to check for available tasks sw, st, sd =

[web2py] Re: Current logged in users

2015-05-12 Thread Anthony
To log out all users, you could delete all session files, though you would be destroying any active sessions. Unfortunately, when you delete a user, I don't think there is a good way to force logout that user. One option is to create an _after_delete callback for the auth_user table that

[web2py] Re: How to move a set of view,edit,delete buttons from last column to first column on SQLgrid?

2015-05-12 Thread kenny c
Thank you for your reply as always, Niphlod! On Tuesday, May 12, 2015 at 3:55:20 PM UTC-4, Niphlod wrote: takend straight from the book at http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid-and-SQLFORM-smartgrid *buttons_placement and links_placement both take

[web2py] Re: is there a way to use auth_permission to allow user to access records based upon field value?

2015-05-12 Thread Alex Glaros
wow... that is powerful thanks Anthony, works great! web2py rocks! Alex -- 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

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Lisandro
I'm sorry, the master app is called webmedios, so the call is ok. The log shows web2py.scheduler.medios because I renamed the folder where web2py is installed, I renamed it to medios. So the log is ok and I think the code too. Sorry for the confusion, my bad :P Even though, I don't know why

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Niphlod
something is not adding up. if your app is called medios...and the log shows DEBUG:web2py.scheduler.medios ... why are you trying to start it with webmedios ?!?!?! On Tuesday, May 12, 2015 at 10:05:35 PM UTC+2, Lisandro wrote: Thanks Niphlod. I double checked, and the tasks are there. The

[web2py] Re: is there a way to use auth_permission to allow user to access records based upon field value?

2015-05-12 Thread Anthony
Read the documentation -- common_filter is a property of the table, it is not a Field object and therefore does not go in a list of extra fields (and in Python, an element of a list cannot include an assignment, as you are doing with the = sign). Anthony On Tuesday, May 12, 2015 at 12:01:59

[web2py] Re: Deadlock in cache.py/CacheOnDisk in R 2.10.4

2015-05-12 Thread Bernard Letourmy
created issue #966 - and submitted pull request Bernard On Wednesday, 13 May 2015 07:25:25 UTC+8, Bernard Letourmy wrote: Ok will do Bernard -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: pack all - internal error - Error 3 - cache/chache

2015-05-12 Thread 黄祥
please try to create folder cache on welcome app, it seems the folder is renamed or deleted, if the error still occured, plesae try to restart web2py or even your os. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: pack all - internal error - Error 3 - cache/chache

2015-05-12 Thread 黄祥
please try to create folder cache on welcome app, it seems the folder is renamed or deleted, if the error still occured, plesae try to restart web2py or even your os. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Niphlod
2.10.3 and 2.10.4 didn't change a single bit about the scheduler. Check again. There MUST be some hiccup in your deployment code. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Using for

2015-05-12 Thread 黄祥
why not put the '*for'* loop in views n your controller just pass the data to the view. best regards, stifan -- 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)

[web2py] Re: pack all - internal error - Error 3 - cache/chache

2015-05-12 Thread 黄祥
is just welcome app or affect another app too? please try to restart the server first if still occured, try to restart your system. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Keeping track of connected users (websocket_messaging.py)

2015-05-12 Thread Samuel Sowah
I'll be glad to take a look. I just might be able to help since I'd need it myself anyway. Will do my best. On Wednesday, May 6, 2015 at 6:17:50 PM UTC+1, Richard wrote: Last year we develop over websocket contrib a tool like that and it turns that we had to create a thread that was doing

[web2py] Re: Customizing registration fields for linkedin login

2015-05-12 Thread 黄祥
had you modified the auth_users table? ref: http://web2py.com/books/default/chapter/29/09/access-control#Customizing-Auth best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Using for

2015-05-12 Thread Massimiliano
In your controller: a = [1,2,3] return locals() In your view: {{for i in a:}} {{=i}} {{pass}} On Tue, May 12, 2015 at 11:46 PM, KevC kevin.capuchin...@gmail.com wrote: Hi! I got a problem, I wanna print a list or string on a 'view' using a 'for' but the view only show me the

Re: [web2py] Using for

2015-05-12 Thread Anthony
Also, note that you don't use print in web2py -- printing prints to the console and has no effect on the HTML returned by the server to the browser. In web2py, a controller action returns a dictionary of data, and the view then uses that data in constructing the HTML. Controllers do not

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-12 Thread Lisandro
I must be missing something really obvious, or something really strange is going on. I've just made a very simple test: - one only application - one only db - migrations enabled In models/scheduler.py: def mytest(): print 'this is my test' return True from gluon.scheduler

[web2py] Re: Deadlock in cache.py/CacheOnDisk in R 2.10.4

2015-05-12 Thread Bernard Letourmy
Ok will do Bernard -- 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] Two SQLFORMs side by side?

2015-05-12 Thread Richard Vézina
Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the

[web2py] Re: Init Script in Web2Py

2015-05-12 Thread A36_Marty
I am trying to follow the advice by Massimo and others on this thread but am missing something. Specifically, the follow code is intended to check if a user group exists, and if not, create it. Unfortunately it executes every time until the web2py server is restarted and the value is cached.

[web2py] Re: Bootstrap datepicker plugin

2015-05-12 Thread Leonel Câmara
Villas is right, this function call returns the callable, it's this way so you can use bootstrap datepicker options. -- 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

[web2py] Re: is there a way to use auth_permission to allow user to access records based upon field value?

2015-05-12 Thread Alex Glaros
I deleted same question a few days ago but just noticed Richard replied before I deleted: On Monday, May 11, 2015 at 7:20:27 AM UTC-7, Richard wrote: You need to enforce it at controller level... What I usually do it to filter the record user can view base on their role... The drawback

[web2py] is there a way to use auth_permission to allow user to access records based upon field value?

2015-05-12 Thread Alex Glaros
is there a way to use auth_permission to allow user to access records based upon field value? right now in auth_permission we can only specify one record_id in a table. what about all records in table db.organization whose field matches: *organization_name = 'IBM'* is there a way

[web2py] Re: is there a way to use auth_permission to allow user to access records based upon field value?

2015-05-12 Thread Anthony
@ Massimo, column-value-based permission would be very useful in situations like a data-mart where different users share same table but should not be allowed to see each other's data. Access control in auth_permission would only need to be in one place, but if done through the

Re: [web2py] IS_IN_DB() multiple tables

2015-05-12 Thread kecajkecaj123
Sure, it's pretty simple: DB: db.define_table('ipaddress', Field('ip', unique=True, length=200,requires=IS_NOT_EMPTY()), Field('status', length=200, default=Free, requires=IS_IN_SET(['Free','Used'])), format = '%(ip)s') db.define_table('server', Field('servername', length=200),

[web2py] Re: is there a way to use auth_permission to allow user to access records based upon field value?

2015-05-12 Thread Alex Glaros
@ Richard, (1) regarding this line {{if auth.has_permission('update', request.args(0)):}}, how does user get permissions in the first place (2) what would the args look like? @ Massimo, column-value-based permission would be very useful in situations like a data-mart where different users

Re: [web2py] Two SQLFORMs side by side?

2015-05-12 Thread LoveWeb2py
Repeating load might be because I extended the layout in the view for the load. On Tuesday, May 12, 2015 at 10:22:41 AM UTC-4, Richard wrote: Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing