Re: [web2py] web2py CMS

2014-06-06 Thread Loïc
hidden for security purpose... BTW you can fork the repository in Web2py's applications forlder and give a try to the latest version in a few minutes Le vendredi 6 juin 2014 00:33:22 UTC+2, Derek a écrit : looks neat, your demo login and password is hidden though On Thursday, June 5, 2014

[web2py] trouble with session and default controller

2014-06-06 Thread weheh
I'm using an ajax call to default.py controller. The default.py sets a session variable. Paraphrased, it looks like this: # model if not session.myvars: session.myvars = dict( somevar=dict(), othervar=dict(), ... ) # view script ... ajax({{=

[web2py] trouble with session and default controller

2014-06-06 Thread weheh
I'm using an ajax call to default.py controller. The default.py sets a session variable. Paraphrased, it looks like this: # model if not session.myvars: session.myvars = dict( somevar=dict(), othervar=dict(), ... ) # view script ... ajax({{=

[web2py] Re: my super heroic idea of the next scheduler

2014-06-06 Thread Niphlod
the scheduler doesn't need a decorator... for your own organization you can,e.g., put all the functions in one model file, or use comments ^_^ with web2py.py -a yourpassword -K appname -X you can start in one command the webserver and the scheduler processes. On Thursday, June 5, 2014

[web2py] How to use HTML5 datalist for Select/dropdown widget ?

2014-06-06 Thread Mandar Vaze
My application has select/option dropdown - which contains lots of entries (one has about 200 entries, other about 3000 - yes three thousand) I was wondering if there is a way to use HTML5 datalist widget to make the selection user friendly.

[web2py] Virtual Fields do not show in details view and are not searchable

2014-06-06 Thread Mandar Vaze
I'm on web2py 2.9.5, and using new style Virtual fields. Virtual field shows up OK in the table view, but : 1. It does not appear at all when I click on View button 2. are not used for default search Any workarounds ? -Mandar -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: Virtual Fields do not show in details view and are not searchable

2014-06-06 Thread Anthony
Virtual field shows up OK in the table view, but : 1. It does not appear at all when I click on View button By default, virtual fields don't show up in readonly forms, but you can list them in the fields argument. To pass the fields argument to the view form when using the grid, you can

[web2py] Re: Uploading with SQLFORM.factory: specifying tablename component of filename

2014-06-06 Thread Spokes
Thank you, Michael. However, it appears that in the steps you've discussed, you're using the compute field to store the original filename in the table, or to store other information in the table. However, I am interested simply in changing the name of the file that is uploaded to the server.

[web2py] Re: trouble with session and default controller

2014-06-06 Thread Anthony
Just to be clear, when you delete session.myvars[somevar], you are sure session.myvars still contains other dictionaries and is not at this point an empty dictionary (which would trigger the model code to refill it)? On Friday, June 6, 2014 3:46:11 AM UTC-4, weheh wrote: I'm using an ajax

[web2py] Re: Formatting GRID rows data based on the field value in database

2014-06-06 Thread Anthony
You can set the represent attribute for the fields you would like to format. Anthony On Friday, June 6, 2014 1:31:06 AM UTC-4, Sarbjit wrote: Hi, I am using GRID in my application, my requirement is that I want to display the field value in different color (RED/GREEN) OR I want to display

[web2py] Re: trouble with session and default controller

2014-06-06 Thread weheh
Fair question. Dunno the answer. It was just an example. The real application is that I'm filling the dict with other stuff. It's keeping track of the state of my GUI -- active tabs and stuff. So in that case, the empty session.myvar condition would not be triggered. In any event, I have a

[web2py] Re: trouble with session and default controller

2014-06-06 Thread Anthony
You said the dict gets deleted temporarily? How temporarily? How are you checking that? Is it only deleted during the current request? If so, sounds like for some reason the session isn't getting saved. Are you using the default file based sessions? On Friday, June 6, 2014 9:08:38 AM UTC-4,

[web2py] Re: Formatting GRID rows data based on the field value in database

2014-06-06 Thread Sarbjit
Thanks Anthony, Can you please provide a small example. On Friday, June 6, 2014 6:03:29 PM UTC+5:30, Anthony wrote: You can set the represent attribute for the fields you would like to format. Anthony On Friday, June 6, 2014 1:31:06 AM UTC-4, Sarbjit wrote: Hi, I am using GRID in my

[web2py] Re: Formatting GRID rows data based on the field value in database

2014-06-06 Thread Anthony
db.define_table('mytable', Field('Product_SignOff', represent=lambda v, r: SPAN(v, _class='green' if v == 'Yes' else 'red')), ...) On Friday, June 6, 2014 9:52:58 AM UTC-4, Sarbjit wrote: Thanks Anthony, Can you please provide a small

Re: [web2py] Re: plugin_dataTables

2014-06-06 Thread Manuele Pesenti
Il 03/06/14 22:12, Massimo Di Pierro ha scritto: Could you post some screenshots? what about a demo site? http://manuele.pythonanywhere.com/demo_plugin_datatables you can browse the 2 pages linked in the Examples menu. Cheers M. -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] Re: plugin_dataTables

2014-06-06 Thread Manuele Pesenti
Il 03/06/14 22:12, Massimo Di Pierro ha scritto: Could you post some screenshots? ok here they are: https://www.dropbox.com/s/razmyp3f1qpsfik/Screenshot%202014-06-06%2016.53.11.png https://www.dropbox.com/s/w10yzfziqlrx0gk/Screenshot%202014-06-06%2016.53.55.png Cheers M. -- Resources: -

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread LoveWeb2py
SQLFORM isn't working for me with new_table = db(db.table1.id.belongs(record_ids)).select() if I do {{=new_table}} in my view I can see the records which belong to record_ids, but if I do: SQLFORM.grid(new_table) return dict(grid=grid) I get an error 'Rows' object has no attribute '_db'

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
Hi, You send var grid (see: return dict(grid=grid)). The first var grid is a send var to your view, de second var grid is a local var of your function. Then, in controller use: grid = SQLFORM.grid(db.new_table) return dict(grid=grid) in the view use: {{=grid}} Fabiano. 2014-06-06 12:45

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread LoveWeb2py
Hi Fabiano, I actually was already using grid= SQLFORM.grid(db.new_table). That is when I get the error. If I do grid='' to test it and just return the table without SQLFORM I can see it in the view, but when I apply SQLFORM I get the error 'Rows' object has no attribute '_db'. I'm guessing

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
Try: grid = SQLFORM.grid(db.table, user_signature=False) Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py escreveu: Hi Fabiano, I actually was already using grid= SQLFORM.grid(db.new_table). That is when I get the error. If I do grid='' to test it and just return the

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
How do you define tables? 2014-06-06 14:03 GMT-03:00 Fabiano Almeida fabi...@techno7.com.br: Try: grid = SQLFORM.grid(db.table, user_signature=False) Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py escreveu: Hi Fabiano, I actually was already using grid=

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread LoveWeb2py
That was it! THANK YOU! Why does it work without a signature though? On Friday, June 6, 2014 1:03:35 PM UTC-4, Fabiano Almeida wrote: Try: grid = SQLFORM.grid(db.table, user_signature=False) Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py escreveu: Hi Fabiano, I

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
Are you logged in your app? 2014-06-06 14:07 GMT-03:00 LoveWeb2py atayloru...@gmail.com: That was it! THANK YOU! Why does it work without a signature though? On Friday, June 6, 2014 1:03:35 PM UTC-4, Fabiano Almeida wrote: Try: grid = SQLFORM.grid(db.table, user_signature=False) Em

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Austin Taylor
yes On Fri, Jun 6, 2014 at 1:09 PM, Fabiano Almeida fabi...@techno7.com.br wrote: Are you logged in your app? 2014-06-06 14:07 GMT-03:00 LoveWeb2py atayloru...@gmail.com: That was it! THANK YOU! Why does it work without a signature though? On Friday, June 6, 2014 1:03:35 PM UTC-4,

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread LoveWeb2py
Now I get this error when I try to click edit on the query database: type 'exceptions.ValueError' invalid literal for int() with base 10: 'edit' I've tried changing signature to false, but I don't think thats the problem. On Friday, June 6, 2014 1:17:39 PM UTC-4, LoveWeb2py wrote: yes On

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
Show your code 2014-06-06 15:18 GMT-03:00 LoveWeb2py atayloru...@gmail.com: Now I get this error when I try to click edit on the query database: type 'exceptions.ValueError' invalid literal for int() with base 10: 'edit' I've tried changing signature to false, but I don't think thats the

[web2py] Re: How to use HTML5 datalist for Select/dropdown widget ?

2014-06-06 Thread Niphlod
you'd have to code your own widget, that is not that difficult. That being said, it's a taddle bit foolish wanting to inject 3k options in a page: datalist is cool over the standard select, but it doesn't cut the weight of the markup. I'd go with select2 and items loaded via ajax, so you can

[web2py] scheduler worker assignment and disable behavior

2014-06-06 Thread DeanK
I'm have a few things that need clarification and am also experiencing some odd behavior with the scheduler. I'm using my app's db instance (mysql) for the scheduler. at the bottom of scheduler.py: from gluon.scheduler import Scheduler scheduler = Scheduler(db,heartbeat=3) I start my

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
type 'exceptions.ValueError' invalid literal for int() with base 10: 'edit' In some part of your code has converting string to numeric type. Probably you should be picking up the URL argument and doing the conversion, but when you edit the registry of URL arguments are changed. In my example, I

[web2py] Re: Formatting GRID rows data based on the field value in database

2014-06-06 Thread 黄祥
another way around : if table.Product_SignOff == 'Yes': table.Product_SignOff.represent = lambda Product_SignOff, field: SPAN(Product_SignOff, _class = 'text-error') elif table.Product_SignOff == 'No': table.Product_SignOff.represent = lambda Product_SignOff, field: SPAN(Product_SignOff,

[web2py] Re: Formatting GRID rows data based on the field value in database

2014-06-06 Thread Anthony
another way around : if table.Product_SignOff == 'Yes': table.Product_SignOff.represent = lambda Product_SignOff, field: SPAN(Product_SignOff, _class = 'text-error') elif table.Product_SignOff == 'No': table.Product_SignOff.represent = lambda Product_SignOff, field:

[web2py] swl smart grid

2014-06-06 Thread Rohit Raj Sharma
how to restrict user in sql smart grid for parent table to do not add record. but that same user can add record in child table. query = ( ( db.parentr.id = 0)) grid = SQLFORM.smartgrid(db.parent,linked_tables=['child'], csv=False ,fields=fields, constraints = dict(tracker = query),

[web2py] SSO with Apache

2014-06-06 Thread Bogdan
Hi, I have configured SSO on Apache 2.4 and can read the username with request.env['remote_user']. How can I now configure restricted access to methods? I need some methods to be available only to the users of specific ActiveDirectory groups, like @auth.requires_membership('ad group') is it

[web2py] Extending the completation support from IDEs for DAL objects

2014-06-06 Thread AlighaThor
Hello to the community. I want to share with you a simple tool I created to extend the capabilities of completion of the DAL code. So far I've only tested PyCham. Experiment with other IDEs and tell me. Given the dynamic nature of Python and how web2py defines the tables, it becomes

[web2py] what about the old web2py blog?

2014-06-06 Thread chuan137
It is quite helpful for me, I read it and like the way it explains things. But why is it called 'old'? The techniques are no longer ideal or it just stop updating? I wish there is such a new web2py blog. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Creating a custom authentication method: type 'exceptions.NameError'(global name 'user' is not def

2014-06-06 Thread William Lewis
Hi I am trying to create and add a custom authentication method and incorporate it into web2py. Here is my authentication method: import win32security import pywintypes def auth_local(username, password): try: token = win32security.LogonUser(Username=username,

[web2py] web2py 2.9.5 - Janrain not displaying login logos

2014-06-06 Thread Martin
Hello has anyone succeeded getting Janrain to work properly on web2py 2.9.5 ? I have done as explained in the online book, but it doesn't seem to work, my page is appearing blank, without login logos. Please if you have succeed, I'd be glad to know how. -- Resources: - http://web2py.com -

[web2py] Adding information to certain input before added to db?

2014-06-06 Thread Omri Levy
When using SQLFORM, is it possible to check for certain input and change it before it is being stored in db? -- 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] Create other autoincrement field besides the id on MongoDB

2014-06-06 Thread Leonardo Tada
I know the field id is autoincrement, but I need other field besides the id, because I'm trying to use MongoDB and the field id that created is like '{ _id : { $oid : 539139c0dfe28529f6fb72cb}'. Then have to create other autoincrement field besides the id. Anybody can help? -- Resources: -

[web2py] after_update related question

2014-06-06 Thread Keerti Agrawal
I am writing a callback function after update on scheduler_task. then i am printing set which we are getting in that callback function. set values are printed when scheduler_task.status change to 'ASSIGNED' and 'RUNNING'. but when scheduler_task.status changes to 'TIMEOUT' or 'COMPLETE' set is

[web2py] join does not work, when enabling record versioning

2014-06-06 Thread Armin Würtenberger
Hi, I'm using web2py quite a while now, and I am still pleased with it's functionality. Recently I started to use record versioning and found, that joins with versioned tables do not work anymore: Here's the example (using the app welcome):

[web2py] Can I change a value from a form before it is processed?

2014-06-06 Thread Omri Levy
Hi , So the situation is this: I have table for posts - Only the user posted a message may see it and then table for shared_posts - The user created a post may enter user_ids here, and those users may also see the post I don't want to add record for each share, so shared posts is defined like

[web2py] smart_sql_grid

2014-06-06 Thread Rohit Raj Sharma
i am using sql smqrt grid.I have parent table and child table. i want to restrict user to add record for parent table but that same user can add records in child table. query = ( ( db.parent.id = 0)) grid = SQLFORM.smartgrid(db.parent,linked_tables=['child'], constraints = dict(tracker =

[web2py] regarding after_update callback

2014-06-06 Thread Keerti Agrawal
I am writing after update callback function on scheduler_task table when task status changes. i am getting values in dbset of callback function when status changes to ASSIGNED AND RUNNNG but when status changes to TIMEOUT and COMPLETED dbset doenot contain any value . def

[web2py] running web2py in a subdirectory

2014-06-06 Thread Erik Easie Flo
Aloha is there a solution that allows you to run the web2py in a sub directory? I've looked through the books blogs and can't find a straight forward solution with either routes.py or in apache. Thanks, -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] video streaming

2014-06-06 Thread eric cuver
db.define_table('music', Field('name',required=True), Field('filename','upload',required=True), auth.signature) applications/audio/models/db_audio.py echo response.menu = [('Home',0,URL('index'))] # allows to browser, search, and upload new

[web2py] 'loading ...' issue

2014-06-06 Thread Magdalena Rother
Hi, does anyone know how to solve the loading... issue? After updating web2py from 2.5.1 to current I get 'loading...' instead of list of files. I already tried: - Replacing .js files with the new ones - change order of including files in web2py_ajax.html - exchanging gluon/compileapp.py

[web2py] Re: Formatting GRID rows data based on the field value in database

2014-06-06 Thread 黄祥
a, that's what i'm lacked off, not created the css classes for green and red classes. thank you so much, anthony. btw, the piece of code above is not completed, here is the complete code : e.g. def on_define_product(table): if 'product' in request.function : if table.signoff == 'No':

[web2py] Re: Adding information to certain input before added to db?

2014-06-06 Thread 黄祥
i think you can achieve it using form.validate : e.g. def booking(): form = SQLFORM(db.booking_header) if form.validate(): db.booking_header.insert(booking_date = form.vars.booking_date, buyer = form.vars.buyer,

[web2py] Re: Can I change a value from a form before it is processed?

2014-06-06 Thread 黄祥
had you try using onvalidation or form.validate()? ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: swl smart grid

2014-06-06 Thread 黄祥
please check this discussion https://groups.google.com/forum/#!topic/web2py/ARfF_QZk2tw 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: smart_sql_grid

2014-06-06 Thread 黄祥
please do with dict for create : e.g. def grid(): query = ( ( db.parent.id = 0)) create = dict(parent = False, child = True) grid = SQLFORM.smartgrid(db.parent,linked_tables=['child'], constraints = dict(tracker = query), paginate=15 ) , editable=auth.has_membership('editor_group'),

[web2py] Re: video streaming

2014-06-06 Thread 黄祥
please take a look at this disccussion : https://groups.google.com/forum/#!topic/web2py/B1l_RfCYpXA 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

[web2py] Re: video streaming

2014-06-06 Thread 黄祥
e.g. for view *views/default/index.html* {{extend 'layout.html'}} {{=grid}} -- 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