[web2py] Highcharts in web2py

2016-05-11 Thread kecajkecaj123
Hi Guys, I was able to create simple graph by using highcharts.js (http://www.highcharts.com/) However since it's javascript it's really hard to add some data from controller. I found python module for highcharts:

[web2py] web2py pygal graph

2016-03-10 Thread kecajkecaj123
Hi Guys, Trying to draw some graphs using pygal and below link: http://www.web2pyslices.com/slice/show/1634/beauty-graphics-and-charts-with-pygal It works fine, but my view display only graph, without anything else included in the view e.g. headers, styling etc. Controller: def graph():

[web2py] Threading in web2py

2016-03-03 Thread kecajkecaj123
Hi Guys, I have a "for" loop which goes thru every row in the table (1000 rows), do some calculation and update the row. But whole process takes around 2-3 sec for one row as i'm connecting to few external databases to collect data. So for 1k rows it takes ages to accoplish all those tasks.

[web2py] smartgrid and selectable

2016-02-04 Thread kecajkecaj123
Hi Guys, I use below controller function: def my_grid(): query = (db.table.id > 0) fields=(db.table.id,db.table.field1) selectable=[('Send IDs to another function', lambda ids: redirect(URL( 'default','new_function',vars=dict(ids=ids] grid =

[web2py] pygal and SQL.form

2016-01-20 Thread kecajkecaj123
Hi Guys, I try to use pygal to draw some charts and it works fine. I used example from: http://www.web2pyslices.com/slice/show/1634/beauty-graphics-and-charts-with-pygal However i don't know how to display SQL.form and pygal chart in one view. My code def form_and_chart(): chart =

[web2py] Re: Grid back button for custom single view

2015-10-29 Thread kecajkecaj123
Hi Guys, I need a hint on how to create back button in web2p y form. def grid1(): links = [lambda row: A(SPAN(_class='icon magnifier'),'Form1',_class='button btn btn-default',_title='Form1',_href=URL("default","form1",args=[row.id]))] query=(db.test.id>0 ) grid =

[web2py] Re: show_if logical operators

2015-06-16 Thread kecajkecaj123
Works! Thanks. Is it also possible for SQLFORM.factory? On Wednesday, 10 June 2015 16:06:47 UTC+2, Anthony wrote: Try: db.table1.order.show_if = db.table1.colour.belongs(['red', 'blue']) Anthony On Tuesday, June 2, 2015 at 6:09:20 AM UTC-4, kecajk...@gmail.com javascript: wrote: Hi,

[web2py] Re: show_if logical operators

2015-06-10 Thread kecajkecaj123
Anyone? On Tuesday, 2 June 2015 12:09:20 UTC+2, kecajk...@gmail.com wrote: Hi, I'm using show_if to hide a filed of my form under certain conditions. Per web2py guide, show_if uses simple query, but it doesn't work for logical oprators like and or. In below example i would like to

[web2py] show_if logical operators

2015-06-02 Thread kecajkecaj123
Hi, I'm using show_if to hide a filed of my form under certain conditions. Per web2py guide, show_if uses simple query, but it doesn't work for logical oprators like and or. In below example i would like to display field order just when colour is set to blue or red. db.define_table('table1',

Re: [web2py] IS_IN_DB() multiple tables

2015-05-19 Thread kecajkecaj123
Rich, Can You have a quick look at this? Thanks, On Tuesday, 12 May 2015 17:34:38 UTC+2, kecajk...@gmail.com wrote: 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,

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),

Re: [web2py] IS_IN_DB() multiple tables

2015-05-11 Thread kecajkecaj123
Richard, Let say that I have two IPs in ipaddress table: 10.1.1.1 FREE 10.2.2.2 FREE I add a server into server table, i put name as server1 and chose IP from dropdown menu 10.1.1.1. Then my ipaddress table looks like that 10.1.1.1 USED 10.2.2.2 FREE But i noticed that i did a typo in

Re: [web2py] IS_IN_DB() multiple tables

2015-05-07 Thread kecajkecaj123
Hi, What's the difference between what i wrote and what You wrote? And i believe You didn't get my point. Checking if IP is Free works correctly. Point is that i want do update the one row in Server table and change i.e. server name. I click on update button provided by grid, and i can

[web2py] IS_IN_DB() multiple tables

2015-05-06 Thread kecajkecaj123
Hi All, I have very basic dtabasae where in one table i have IPs which are used in second table: db.define_table('ipaddress', Field('ip', unique=True, length=200,requires=IS_NOT_EMPTY()), Field('subnet', length=200, requires=IS_NOT_EMPTY() ), Field('status', length=200, default=Free,

[web2py] Re: Combine IS_IN_DB and IS_NOT_IN_DB

2015-04-28 Thread kecajkecaj123
HI, I must have skipped _and, it's what i was looking for. But also started wondering about second example, but it gives me empty results on drop-down. When i remove ~ it works as expected returning IPs that have been already assigned. db.server.ipaddress_id.requires =

[web2py] Combine IS_IN_DB and IS_NOT_IN_DB

2015-04-25 Thread kecajkecaj123
Hi Guys, I have simple database: db.define_table('ipaddress', Field('ip', unique=True, length=200), Field('subnet', length=200), format = '%(ip)s') db.define_table('server', Field('servername', length=200), Field('port', length=200), Field('ipaddress_id', 'reference