[web2py] Strange result from virtual fields

2014-10-10 Thread Niels Jensen
Hi Guys, I have the following virtual fields and for some reason one of them gives an error that I can't explain, I'm hoping one of you guys can shed some light on it: db.nessus_host_summary.total = Field.Virtual( 'total', lambda row: int(row.nessus_host_summary.count_info)

[web2py] Re: Trying to build a table in a view depending on content of row

2014-10-10 Thread Niels Jensen
Thanks for the replies. I also fount a typo (no closing brackets at the end of the statements. I've got past this problem now... On Friday, 10 October 2014 18:25:15 UTC+1, Anthony wrote: > > > {{if not row.nessus_host_summary.critprct == '0':}} >> {{print "%s" % >> (row.nessus_

[web2py] Trying to build a table in a view depending on content of row

2014-10-10 Thread Niels Jensen
Hi, I'm trying to build a table where each a is only created if it has a value and the width is determined by a predetermined percentile that exists in the row This is what I have: Vulnerability Count {{for row in summary:}} {{=row.nessus_hosts.name}}

[web2py] Re: How to delete records where db.table.field value doesnt exist in list?

2014-10-09 Thread Niels Jensen
Thanks! So simple, I reread the docs after your reply and can't believe I missed it. -- 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

[web2py] How to delete records where db.table.field value doesnt exist in list?

2014-10-09 Thread Niels Jensen
Hi, I have a list of names namelist = ['Niels', 'Bob', 'Frank', 'Pat', 'Ann'] I'd like to remove all records from a table where the name field does not have a name in the list. For example if all the above exist in the table Is there a function to do this or will I need to loop through each row

[web2py] How would I add this to response.files...or would I?

2014-10-06 Thread Niels Jensen
Hi Guys, I'm trying to convert a html template for my first web2py app. I'm pretty new to Python and very new to Web2py. I've written a few Python scripts at work which hook into the API's of some of our services and pull back some useful data Eventually I'd like to make this information ava

[web2py] Re: Best way to store tabular data when database isn't really needed?

2014-09-09 Thread Niels Jensen
gt; > in other words, you have a small file, and you are complaining about > storing it on disk? why? too much disk space? too much work? Does it make > that much of a difference if it takes 15ms to access or 1ms? > > On Monday, September 8, 2014 3:59:39 AM UTC-7, Niels Jensen wrote:

[web2py] Best way to store tabular data when database isn't really needed?

2014-09-08 Thread Niels Jensen
Hi All, I've just started learning Python and have a decent understanding on the core elements. Most of my programming experience prior to Python was vb.net, which I'd use it to put together some simple applications that would help me automate some tasks at work (I'm a sysadmin). I wanted to