[web2py] which version of bootstrap is web2py running?

2014-05-28 Thread weheh
title says it all -- 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

[web2py] Re: Pypy and psycopg2-cffi?

2014-05-28 Thread Joe Barnhart
I only meant that a JIT might not benefit web2py as much because we are constantly loading and running bytecodes from the disk. All of these JITs rely on loading code into memory and running it multiple times before the JIT optimizes it and provides enhanced performance. Loading bytecodes from

[web2py] Re: I posted one question to web2py-user group not able to find it

2014-05-28 Thread Dave S
On Tuesday, May 27, 2014 6:54:14 AM UTC-7, sarfaraz ahmed wrote: > > The question was regarding using jqueryui in web2py. > Sometimes different GG server instances take longer to update, but your post is there. It doesn't seem

[web2py] Re: requires IS_IN_DB set as a union of two queries

2014-05-28 Thread 98ujko9
I did try: query = query1 | guery2 and received error: "Set | Set" or similar On Wednesday, May 28, 2014 7:47:36 PM UTC-4, 98u...@gmail.com wrote: > > Thank you Mr. Massimo and your colleagues for bringing the web2py to the > masses. > I need to have a field that will present a choice of values

Re: [web2py] requires IS_IN_DB set as a union of two queries

2014-05-28 Thread Carlos Costa
Have you tried something like: query1=((db.vehicle.id==db.owner.own_veh_fk)&(db.owner.own_end_date!=None)) query2=(~db.vehicle.id.belongs(db(db.owner.own_veh_fk==db.vehicle.id )._select(db.vehicle.id))) query = query1 & query2 db.owner.own_veh_fk.requires=IS_IN_DB(query,'vehicle.id', '%(manufac

[web2py] requires IS_IN_DB set as a union of two queries

2014-05-28 Thread 98ujko9
Thank you Mr. Massimo and your colleagues for bringing the web2py to the masses. I need to have a field that will present a choice of values that result from a union of query1 and query2 How can i create a set that would go where the question mark is? Thanks for any help! query1=((db.vehicle.i

[web2py] Re: How to select a column of numbers into a list so that I can manipulate the list

2014-05-28 Thread Anthony
Note, the Rows class already has .first, .last, .find, .sort, and .exclude methods -- we've just added one more such method. Hopefully most folks will recognize that because .select() returns a Rows object, any subsequent method calls must be operating on the Rows object. Those who don't may als

[web2py] Re: How to select a column of numbers into a list so that I can manipulate the list

2014-05-28 Thread Leonel Câmara
I don't like this new method. People can (due to being used to the method chaining/cascading patterns which are used quite commonly in DALs) think that the DAL will only request the given column from the DB when that's not what's happening. I've done this many times using list comprehensions an

[web2py] Re: How to select a column of numbers into a list so that I can manipulate the list

2014-05-28 Thread Niphlod
yep, I always forget to do a quick summary on my "warnings". Addition to my latest post /**/ following the rule of "explicit is better than implicit" the last method shown is the best /**/ ^_^ On Wednesday, May 28, 2014 10:45:28 PM UTC+2, Anthony wrote: > > On Wednesday, May 28, 2014 4

[web2py] Re: How to select a column of numbers into a list so that I can manipulate the list

2014-05-28 Thread Anthony
On Wednesday, May 28, 2014 4:26:28 PM UTC-4, Niphlod wrote: > > I'd also argue that it's a nice shortcut but you should ALWAYS select only > what's needed. A select fetching 20 columns just to display the data from > one column only will ALWAYS perform worse than a select fetching that only > co

[web2py] Re: getting run_result from web2py scheduler

2014-05-28 Thread Niphlod
the same "mind error" applies. you should queue the task in one function, and retrieve the result in another (polling is the easiest way, looping is the worst idea). On Wednesday, May 28, 2014 10:36:18 PM UTC+2, Cory wrote: > > Thanks Niphlod and good point. I am using it with LOAD() so im still

[web2py] Re: getting run_result from web2py scheduler

2014-05-28 Thread Cory
Thanks Niphlod and good point. I am using it with LOAD() so im still maintaining async, I just need to know when its ready. This helped a lot, I did not try db.commit before and did not realize. Thanks again! On Wednesday, May 28, 2014 1:23:16 PM UTC-7, Niphlod wrote: > > Hi. > There must be so

[web2py] Re: How to select a column of numbers into a list so that I can manipulate the list

2014-05-28 Thread Niphlod
I'd also argue that it's a nice shortcut but you should ALWAYS select only what's needed. A select fetching 20 columns just to display the data from one column only will ALWAYS perform worse than a select fetching that only column. On Wednesday, May 28, 2014 1:35:03 PM UTC+2, Anthony wrote: > >

[web2py] Re: getting run_result from web2py scheduler

2014-05-28 Thread Niphlod
Hi. There must be something wrong with what you expect. The scheduler is an ASYNC process, meaning that - usually - trying to fetch the result in the same request that queued it is a wrong idea in so many ways that should be obvious. That being said, this works without any issues. models/schedul

[web2py] Re: Pypy and psycopg2-cffi?

2014-05-28 Thread Niphlod
web2py is constantly tested with pypy as an environment, and I really don't see why web2py's implementation should be considered "not pypy friendly". That being said, the improvements on psycopg2-cffi vs psycopg2 are ISOLATED in that specific "corner". If, for example, psycopg2-ccfi turns to be 5

[web2py] Pypy and psycopg2-cffi?

2014-05-28 Thread Joe Barnhart
I see there is a fairly new-ish implementation of psycopg2 which conforms to the cffi calling convention, for use with pypy. Has anyone tried this along with a fresh web2py to see if improvements have been made? I've always assumed pypy would not do much for web2py because of our preference fo

[web2py] What MongoDB operators are available in current DAL, and how to use pymongo with DAL in web2py

2014-05-28 Thread Andrey K
Dear web2py experts, I would like to use MongoDB+w2p for my current task which might make my life a lot easier. The only examples I have found are: http://www.web2pyslices.com/slice/show/1580/save-the-earth-from-a-total-data-mess-with-mongodbadapter http://stackoverflow.com/questions/21674013/can-

Re: [web2py] Re: module has no attribute...

2014-05-28 Thread Anthony
See http://web2py.com/books/default/chapter/29/04/the-core#Accessing-the-API-from-Python-modules. Note, it adds some overhead, so not necessarily recommended for production. Anthony On Wednesday, May 28, 2014 11:40:00 AM UTC-4, BlueShadow wrote: > > Oo i didn't know. Tell me more about the tra

[web2py] getting run_result from web2py scheduler

2014-05-28 Thread Cory
Hi, I am having trouble getting the run_result after web2py has finished a task using web2py's scheduler. The code below is what I am using. The trouble I am having is grabbing the result once the result is ready. Do any of you know how to get the run_result from a task once the task has fini

Re: [web2py] Re: module has no attribute...

2014-05-28 Thread Kevin Bethke
Oo i didn't know. Tell me more about the track changes. Am 28.05.2014 17:04 schrieb "Anthony" : > Did you restart the server? Changes to modules have no effect after the > first request in which they are imported, unless you restart or use the > track_changes functionality. > > Anthony > > On Wedn

Re: [web2py] Why won't my bootstrap modal form close?

2014-05-28 Thread Richard Vézina
I think the scope issue is coming from the dynamic caracteristic of your modal that you add to the DOM with the web2py_component() function... The second comment on the question here should work : http://stackoverflow.com/questions/10280569/jquery-select-dynamically-created-html-element But you s

[web2py] Re: sqlform.grid with linked tables

2014-05-28 Thread Mirek Zvolský
Use grid = smartgrid() to display table with links to children tables Dne úterý, 20. května 2014 23:50:23 UTC+2 Juan Luis napsal(a): > > thank you stifan, represent is what I needed to know and your example > worked perfect. > > My primary problem is that i am not able to see my other table in

[web2py] Re: DAL/Decorator for specific data

2014-05-28 Thread Anthony
You can include logic to set the readable and writable attributes of particular fields to True/False depending on Auth group membership. For example: db.define_table('mytable', Field('myfield', readable=False, writable=False)) if auth.has_membership('admin'): db.mytable.myfield.readable = d

[web2py] Re: module has no attribute...

2014-05-28 Thread Anthony
Did you restart the server? Changes to modules have no effect after the first request in which they are imported, unless you restart or use the track_changes functionality. Anthony On Wednesday, May 28, 2014 10:53:49 AM UTC-4, BlueShadow wrote: > > I just added a function to my module sitemap c

[web2py] DAL/Decorator for specific data

2014-05-28 Thread Tom Russell
I have read through the docs but have not come across what I am trying to do, if its possible. I have a table with 40 columns of data, I want to use a decorator or similar to only allow some of them viewable while others in a different membership group can see all of the columns. Is this somet

[web2py] module has no attribute...

2014-05-28 Thread BlueShadow
I just added a function to my module sitemap called stats which basicly counts the sites which are in my sitemap. My problem is the function I just created (stats(db)) can't be called I always get a ticket: ... sitemapstat=sitemap.stats(db) AttributeError: 'module' object has no attribute 'sta

Re: [web2py] DAL Referencing By Name Not By ID Possible?

2014-05-28 Thread Carlos Costa
You are welcome! :) 2014-05-28 11:08 GMT-03:00 'Michael Gheith' via web2py-users < web2py@googlegroups.com>: > Many thanks for this, I found it to be helpful :) > > > On Wednesday, May 28, 2014 6:30:31 AM UTC-5, yamandu wrote: > >> Give a look here: http://web2py.com/books/default/chapter/29/06/

[web2py] Re: what is loader.js for?

2014-05-28 Thread Massimo Di Pierro
Perhaps you are talking about this? http://philogb.github.io/jit/static/v20/Docs/files/Loader/Loader-js.html We have no clue. On Monday, 26 May 2014 07:08:24 UTC-5, chuan137 wrote: > > looking at my simple example from chrome developer's tool, I noticed > loader.js doing something in the backgro

[web2py] Re: DAL Referencing By Name Not By ID Possible?

2014-05-28 Thread 'Michael Gheith' via web2py-users
Hello Anthony, Indeed, inserting using the web2py grid or SQLFORM does have the drop-down with the tier name rather than the IDs. I wanted to avoid the operation of looking up the tier_id because I thought there was a way to reference by name. The lookup will do. Thank you for your help! On

[web2py] Re: DAL update expressions starting with an integer not working?

2014-05-28 Thread Massimo Di Pierro
What you trying to do, change the sign? Than do db(db.table.lft > 0).update(lft = db.table.lft * (-1)) The first term of an expression has to be a field as operator overloading does not work. On Wednesday, 28 May 2014 03:21:56 UTC-5, Marian wrote: > > I want to negate a value with this expre

Re: [web2py] DAL Referencing By Name Not By ID Possible?

2014-05-28 Thread 'Michael Gheith' via web2py-users
Many thanks for this, I found it to be helpful :) On Wednesday, May 28, 2014 6:30:31 AM UTC-5, yamandu wrote: > > Give a look here: > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables > > But I think it won't work in your case because n

[web2py] Re: DAL Referencing By Name Not By ID Possible?

2014-05-28 Thread Anthony
How are you inputting records into db.metrics? If via a web2py grid or SQLFORM, the drop-down will have the tier names rather than the IDs (due to the fact that you have specified format='%(name)s'). If you need to do inserts programmatically outside of a form, you can just do a lookup in the d

[web2py] Re: global name 'db' is not defined

2014-05-28 Thread Anthony
> > Would it make sense to have the first model file be named something like > 0_db.py - so that it is always run first? > Sure. You can name your model files whatever you want. > By the way: Am I doing the right thing here, by not modifying the db.py > file and instead adding my own file t

[web2py] Re: How to select a column of numbers into a list so that I can manipulate the list

2014-05-28 Thread Anthony
Note, in trunk there is now a new .column method for the Rows object, which allows you to extract a single column as a list of values (internally, it just does a list comprehension, as in my original answer). So, in this case you could do: nums3 = db(db.Measures).select(orderby=db.Measures.meas

Re: [web2py] DAL Referencing By Name Not By ID Possible?

2014-05-28 Thread Carlos Costa
Give a look here: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables But I think it won't work in your case because name is a string. Our you can model it another way. db.define_table('tiers', Field('name', 'string'), Field('crea

[web2py] Re: Not able to access scheduler_task table getting error "DAL" object has no attribute "scheduler_task"

2014-05-28 Thread Niphlod
where is this ? before or after the mysched = Scheduler(db) call ? BTW: anything you do in that _after_update IS NOT SUPPORTED. You shouldn't fiddle with any scheduler table if not in the proper and documented way if you want support back ^_^ On Tuesday, May 27, 2014 8:14:05 AM UTC+2, Keert

[web2py] Re: what is loader.js for?

2014-05-28 Thread Niphlod
loader.js is not part of web2py. On Tuesday, May 27, 2014 9:49:15 AM UTC+2, chuan137 wrote: > > anyone kowns what it is? > > On Monday, May 26, 2014 2:08:24 PM UTC+2, chuan137 wrote: >> >> looking at my simple example from chrome developer's tool, I noticed >> loader.js doing something in the bac

[web2py] Re: not able to include jqueryui in web2py

2014-05-28 Thread Niphlod
where is the javascript part that "turns on" the accordion effect ? $(function() { $( "#accordion" ).accordion(); }); On Tuesday, May 27, 2014 2:41:28 PM UTC+2, sarfaraz ahmed wrote: > > Hello All, > > I am trying to override the web2py default theme and use customized > jqueryui th

[web2py] Re: DAL update expressions starting with an integer not working?

2014-05-28 Thread Niphlod
check again after dropping the db and recreating it. if you're using sqlite and that field(..., 'integer') was a string before, for a well known and very well documented bug of sqlite, that behaviour will happen. db.define_table('a_table', Field('a_field', 'integer')) db.a_table.insert(a_field=1

[web2py] Re: DAL update expressions starting with an integer not working?

2014-05-28 Thread Mirko
I never updated data this way before, and after having made some tests, it turns out that db.table.lft type is a Field that is converted into a string and then an integer later (I don't know how). And I try the example from the book db(db.table.lft>0).update(lft=db.table.lft+1) appends the stri

[web2py] DAL update expressions starting with an integer not working?

2014-05-28 Thread Marian
I want to negate a value with this expression: db(db.table.lft > 0).update(lft = 0 - db.table.lft) but I get the following TypeError: TypeError: unsupported operand type(s) for -: 'int' and 'Field' My workaround is: db(db.table.lft > 0).update(lft = db.table.lft - db.table.lft - db.table.lft)