[web2py] Re: get value of value attribute of input of SQLFORM

2014-06-11 Thread Limedrop
A more robust way to do this is to use the element search helper.  Use the 
id (or whatever) to find the INPUT like this:

element = form.element(_id='table_field')

and then the value will be:

element['_value']

See the book for all the other cool things you can do:
http://www.web2py.com/books/default/chapter/29/05/the-views?search=element#elements


On Wednesday, June 11, 2014 3:39:35 PM UTC+12, lucas wrote:

 omg, i figured it out.  i had to drill down one more layer.

 uform[0][0][1][0]['value']

 where, form is the form element itself, the first [0] is the table, the 
 second [0] is the first TR line of the table, the [1] is the TD element of 
 the TR line, and the last [0] is the INPUT element under the TD.

 i had a brainy storm.  thanx, lucas


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Problem using multiple grids in single view

2014-06-11 Thread 黄祥
that's right, please use formname, for example you can check out this 
discussion :
https://groups.google.com/forum/#!topic/web2py/4CvyTR_y_kE

niphlod give an example for multiple grid using load

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)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Problem using multiple grids in single view

2014-06-11 Thread Sarbjit
*Thanks Stifan and *














*LaDarrius Stewart !!By using the formnames, I don't see the issues of both 
the grids displaying the same data. However, I am still not able to use 
custom grid (grid1) i.e. I want to use custom grid in view_form mode.Code 
(test1.load){{if grid1.view_form:}}test{{else:}}{{=grid1}}{{pass}}Rest code 
is same as mentioned in my second approach with a difference that each grid 
is having formname.*
Can you please check if my test1.load code is correct?

-Sarbjit

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] PIL library not working with apache 2.2

2014-06-11 Thread Sharjeel Ali Shaukat
I m having a problem when running PIL library with apache i always get 
 this error
global name 'ImageGrab' is not defined
please help me regarding this issue

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to use requires with list:reference

2014-06-11 Thread Mandar Vaze / मंदार वझे
On Tue, Jun 10, 2014 at 11:23 PM, Anthony abasta...@gmail.com wrote:

 Assuming you have a particular parent last name, it would be:

 IS_IN_DB(db(db.parent.lname == last_name), 'parent.id', db.parent._format,
 multiple=True)


Above would work for a fixed last name. But I need it to work with
lambda - where last_name is same as that of the child

-Mandar





 Anthony


 On Tuesday, June 10, 2014 12:51:20 PM UTC-4, Mandar Vaze wrote:


 On Tue, Jun 10, 2014 at 7:53 PM, Anthony abasta...@gmail.com wrote:

 The first argument to IS_IN_DB must be a DAL object or a Set object --
 it cannot be a function.


 Right, but is there a way to achieve what I am trying to do ? an example
 would help.
 Can/should I use IS_IN_SET ? (I got different error mentioned above)

 I think I'm missing something important

 Thanks,
 -Mandar




 Anthony


 On Tuesday, June 10, 2014 10:05:21 AM UTC-4, Mandar Vaze wrote:

 when using default 'list:reference mytable' all the entries from
 mytable are shown in the dropdown (when using SQLFORM.grid)
 I want to show the list in the drop down after applying some filters

 Here is an example :

 db.define_table('parent',
 Field('fname', 'string'),
 Field('lname', 'string'),
 format='%(fname)s %(lname)s'
 )

 def get_parents(lname):
 return db(db.parent.lname == lname)

 db.define_table('child',
 Field('first_name', 'string'),
 Field('last_name', 'string'),
 Field('parents', 'reference parent',
   requires=IS_IN_DB(lambda row: get_parents(row.
 child.last_name), 'parent._format')),
 format='%(fname)s %(lname)s'
 )


 Here the idea is the when associating an entry from parent table - only
 those values are shown where last name of child matches that of the parent
 Obviously the example is made up - real scenario is bit complicated -
 but I am getting following error :

 AttributeError: 'function' object has no attribute 'db'



 web2py™ Version 2.9.5-stable+timestamp.2014.03.16.02.35.39

 Traceback

 Traceback (most recent call last):
 File /path/to/web2py/gluon/restricted.py, line 220, in restricted
 exec ccode in environment
 File /path/to/web2py/applications/parents/controllers/appadmin.py
 http://127.0.0.1:8080/admin/default/edit/parents/controllers/appadmin.py,
 line 674, in module
 File /path/to/web2py/gluon/globals.py, line 385, in lambda
 self._caller = lambda f: f()
 File /path/to/web2py/applications/parents/controllers/appadmin.py
 http://127.0.0.1:8080/admin/default/edit/parents/controllers/appadmin.py,
 line 153, in insert
 form = SQLFORM(db[table], ignore_rw=ignore_rw)
 File /path/to/web2py/gluon/sqlhtml.py, line 1151, in __init__
 inp = self.widgets.options.widget(field, default)
 File /path/to/web2py/gluon/sqlhtml.py, line 273, in widget
 options = requires[0].options()
 File /path/to/web2py/gluon/validators.py, line 559, in options
 self.build_set()
 File /path/to/web2py/gluon/validators.py, line 531, in build_set
 table = self.dbset.db[self.ktable]
 AttributeError: 'function' object has no attribute 'db'

 I am OK to use list:string with IS_IN_SET() as well - but I am unable
 to use lambda row: get_parents(row.child.last_name)
 I get function is not iterable error (Off course I will change
 get_parents() function to return list of strings based on my query)

 -Mandar

  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/web2py/nDBOL7w6qB4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/nDBOL7w6qB4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

[web2py] Re: PIL library not working with apache 2.2

2014-06-11 Thread LightDot
Show us some code. How are you importing the library, how are you using it?

Regards

On Wednesday, June 11, 2014 12:16:47 PM UTC+2, Sharjeel Ali Shaukat wrote:

 I m having a problem when running PIL library with apache i always get 
  this error
 global name 'ImageGrab' is not defined
 please help me regarding this issue


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] json to D3 graph

2014-06-11 Thread Richard
Dear fellow Web2py user,

I am trying to get a json variable into a D3 graph. This was successfull 
with a simple list of dictionaries within the python/JS vairable. But nof I 
want to get the famous flare data structure into my view.

In the controller I have:

def view_dendo():

import json
flare= [{ 'name': 'flare', 'children': [ {   'name': 'analytics',   
'children': [  { 'name': 'cluster', 'children': [ 
 {'name':'graph', 'size': 3938},  {'name': 'CommunityStructure', 
'size': 3812}, ]},{ 'name': 'graph', 'children': [ 
 {'name':'BetweennessCentrality', 'size': 3534},  {'name': 
'LinkDistance', 'size': 5731},  {'name': 'MaxFlowMinCut', 'size': 
7840},  {'name':'ShortestPaths', 'size': 5914},  {'name': 
'SpanningTree', 'size': 3416} ]},{ 'name': 
'CommunityStructure' } ]  } ] }]
 
return dict(flare=XML(json.dumps(flare)))

In the View I have:

  var flare =  {{=flare}}  ;

  var nodes = cluster.nodes( flare ),
  links = cluster.links(nodes);

The view doesn't matter yet because the Chrome console comes with the 
message:
Uncaught SyntaxError: Unexpected token } 
Comming from web2py.js

When I place the requested variable between [] :   var flare = [ {{=flare}} 
] ;   
The message is the same but does not ref to web2py.js

Is  json.dumps not supporting structured json dictionaries or am I doing 
something wrong?

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: PIL library not working with apache 2.2

2014-06-11 Thread Sharjeel Ali Shaukat

I have installed it using PIL binary file 

from PIL import ImageGrab

this is how i m calling the ImageGrab from PIL this line always give me 
error after running it on apache server

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to use requires with list:reference

2014-06-11 Thread Anthony
Are you saying you want the user to enter a last name for the child and 
then have the drop-down dynamically updated with the list of parents with 
the entered last name? If so, obviously that cannot be done at the time the 
form is generated on the server because you don't know what name the user 
will enter in the form. You'll instead have to handle this with Javascript 
in the browser, possibly with an Ajax call back to the server to populate 
the list (unless the list of parents is small enough to send to the browser 
with the initial page load).

Anthony

On Wednesday, June 11, 2014 6:49:56 AM UTC-4, Mandar Vaze wrote:

 On Tue, Jun 10, 2014 at 11:23 PM, Anthony abasta...@gmail.com wrote:

 Assuming you have a particular parent last name, it would be:

 IS_IN_DB(db(db.parent.lname == last_name), 'parent.id', db.parent._format
 , multiple=True)


 Above would work for a fixed last name. But I need it to work with 
 lambda - where last_name is same as that of the child

 -Mandar



  

 Anthony


 On Tuesday, June 10, 2014 12:51:20 PM UTC-4, Mandar Vaze wrote:


 On Tue, Jun 10, 2014 at 7:53 PM, Anthony abasta...@gmail.com wrote:

 The first argument to IS_IN_DB must be a DAL object or a Set object -- 
 it cannot be a function.


 Right, but is there a way to achieve what I am trying to do ? an example 
 would help.
 Can/should I use IS_IN_SET ? (I got different error mentioned above)

 I think I'm missing something important

 Thanks,
 -Mandar




 Anthony


 On Tuesday, June 10, 2014 10:05:21 AM UTC-4, Mandar Vaze wrote:

 when using default 'list:reference mytable' all the entries from 
 mytable are shown in the dropdown (when using SQLFORM.grid)
 I want to show the list in the drop down after applying some filters

 Here is an example :

 db.define_table('parent',
 Field('fname', 'string'),
 Field('lname', 'string'),
 format='%(fname)s %(lname)s'
 )

 def get_parents(lname):
 return db(db.parent.lname == lname)

 db.define_table('child',
 Field('first_name', 'string'),
 Field('last_name', 'string'),
 Field('parents', 'reference parent', 
   requires=IS_IN_DB(lambda row: get_parents(row.
 child.last_name), 'parent._format')),
 format='%(fname)s %(lname)s'
 )


 Here the idea is the when associating an entry from parent table - 
 only those values are shown where last name of child matches that of the 
 parent
 Obviously the example is made up - real scenario is bit complicated 
 - but I am getting following error : 

 AttributeError: 'function' object has no attribute 'db'



 web2py™ Version 2.9.5-stable+timestamp.2014.03.16.02.35.39

 Traceback

 Traceback (most recent call last):
 File /path/to/web2py/gluon/restricted.py, line 220, in restricted
 exec ccode in environment
 File /path/to/web2py/applications/parents/controllers/appadmin.py 
 http://127.0.0.1:8080/admin/default/edit/parents/controllers/appadmin.py,
  
 line 674, in module
 File /path/to/web2py/gluon/globals.py, line 385, in lambda
 self._caller = lambda f: f()
 File /path/to/web2py/applications/parents/controllers/appadmin.py 
 http://127.0.0.1:8080/admin/default/edit/parents/controllers/appadmin.py,
  
 line 153, in insert
 form = SQLFORM(db[table], ignore_rw=ignore_rw)
 File /path/to/web2py/gluon/sqlhtml.py, line 1151, in __init__
 inp = self.widgets.options.widget(field, default)
 File /path/to/web2py/gluon/sqlhtml.py, line 273, in widget
 options = requires[0].options()
 File /path/to/web2py/gluon/validators.py, line 559, in options
 self.build_set()
 File /path/to/web2py/gluon/validators.py, line 531, in build_set
 table = self.dbset.db[self.ktable]
 AttributeError: 'function' object has no attribute 'db'

 I am OK to use list:string with IS_IN_SET() as well - but I am 
 unable to use lambda row: get_parents(row.child.last_name)
 I get function is not iterable error (Off course I will change 
 get_parents() function to return list of strings based on my query)

 -Mandar

  -- 
 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 a topic in the 
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/web2py/nDBOL7w6qB4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  -- 
 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 a topic in the 
 Google Groups web2py-users group.
 To unsubscribe 

[web2py] Re: PIL library not working with apache 2.2

2014-06-11 Thread at
facing same issue both on ubuntu and windows7:

Trying:
from PIL import ImageGrab


Getting:
ImportError: No module named PIL

and the strange thing is *no errors* on:
from PIL import Image

Any help?
Thanks

On Wednesday, 11 June 2014 15:16:47 UTC+5, Sharjeel Ali Shaukat wrote:

 I m having a problem when running PIL library with apache i always get 
  this error
 global name 'ImageGrab' is not defined
 please help me regarding this issue


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Web2py grid shows key from IS_IN_SET({key: value}) model

2014-06-11 Thread Stefan van den Eertwegh
Hi all,

I have a model where a Field has IS_IN_SET({'1':T(''),2:T('')}).

When you have a grid in web2py; When you edit the record you see the value 
(the translatable string).
But when you view the record you see the key of the IS_IN_SET.

IS is possible to have the grid showing the value from the IS_IN_SET in the 
view?

Thank you!

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: PIL library not working with apache 2.2

2014-06-11 Thread Niphlod
verify that apache is running the same python version you're running and 
has PIL installed. This is a well-known issue, but has nothing to do with 
web2py.

On Wednesday, June 11, 2014 2:39:38 PM UTC+2, at wrote:

 facing same issue both on ubuntu and windows7:

 Trying:
 from PIL import ImageGrab


 Getting:
 ImportError: No module named PIL

 and the strange thing is *no errors* on:
 from PIL import Image

 Any help?
 Thanks

 On Wednesday, 11 June 2014 15:16:47 UTC+5, Sharjeel Ali Shaukat wrote:

 I m having a problem when running PIL library with apache i always get 
  this error
 global name 'ImageGrab' is not defined
 please help me regarding this issue



-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: PIL library not working with apache 2.2

2014-06-11 Thread at

Thanks for the swift reply.
I've tried installing PIL as well as Pillow, using binary install on 
windows and using *pip* and *apt-get install* on ubuntu.

Any quick way to verify which python version is being used by apache?

Regards

On Wednesday, 11 June 2014 18:21:33 UTC+5, Niphlod wrote:

 verify that apache is running the same python version you're running and 
 has PIL installed. This is a well-known issue, but has nothing to do with 
 web2py.

 On Wednesday, June 11, 2014 2:39:38 PM UTC+2, at wrote:

 facing same issue both on ubuntu and windows7:

 Trying:
 from PIL import ImageGrab


 Getting:
 ImportError: No module named PIL

 and the strange thing is *no errors* on:
 from PIL import Image

 Any help?
 Thanks

 On Wednesday, 11 June 2014 15:16:47 UTC+5, Sharjeel Ali Shaukat wrote:

 I m having a problem when running PIL library with apache i always get 
  this error
 global name 'ImageGrab' is not defined
 please help me regarding this issue



-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web2py grid shows key from IS_IN_SET({key: value}) model

2014-06-11 Thread Anthony
The IS_IN_SET validator affects form widgets but not other displays of the 
values in the field. If you want to change the way a value is displayed in 
a grid (or SQLTABLE), you must use the represent attribute of the field.

Anthony

On Wednesday, June 11, 2014 8:58:54 AM UTC-4, Stefan van den Eertwegh wrote:

 Hi all,

 I have a model where a Field has IS_IN_SET({'1':T(''),2:T('')}).

 When you have a grid in web2py; When you edit the record you see the value 
 (the translatable string).
 But when you view the record you see the key of the IS_IN_SET.

 IS is possible to have the grid showing the value from the IS_IN_SET in 
 the view?

 Thank you!


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web2py grid shows key from IS_IN_SET({key: value}) model

2014-06-11 Thread Stefan van den Eertwegh
Hi Anthony,

Me and my colleges tried it with represent but we cant figure it out.
Can you give an example how this should work?
The table and column is templates.type (key: value)

Regards,
Stefan van den Eertwegh

Op woensdag 11 juni 2014 16:37:13 UTC+2 schreef Anthony:

 The IS_IN_SET validator affects form widgets but not other displays of the 
 values in the field. If you want to change the way a value is displayed in 
 a grid (or SQLTABLE), you must use the represent attribute of the field.

 Anthony

 On Wednesday, June 11, 2014 8:58:54 AM UTC-4, Stefan van den Eertwegh 
 wrote:

 Hi all,

 I have a model where a Field has IS_IN_SET({'1':T(''),2:T('')}).

 When you have a grid in web2py; When you edit the record you see the 
 value (the translatable string).
 But when you view the record you see the key of the IS_IN_SET.

 IS is possible to have the grid showing the value from the IS_IN_SET in 
 the view?

 Thank you!



-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web2py grid shows key from IS_IN_SET({key: value}) model

2014-06-11 Thread Anthony
mydict = dict(1=T(''), 2=T(''))

db.define_table('mytable',
Field('myfield', represent=lambda v, r: mydict[v]))

Anthony

On Wednesday, June 11, 2014 10:50:06 AM UTC-4, Stefan van den Eertwegh 
wrote:

 Hi Anthony,

 Me and my colleges tried it with represent but we cant figure it out.
 Can you give an example how this should work?
 The table and column is templates.type (key: value)

 Regards,
 Stefan van den Eertwegh

 Op woensdag 11 juni 2014 16:37:13 UTC+2 schreef Anthony:

 The IS_IN_SET validator affects form widgets but not other displays of 
 the values in the field. If you want to change the way a value is displayed 
 in a grid (or SQLTABLE), you must use the represent attribute of the 
 field.

 Anthony

 On Wednesday, June 11, 2014 8:58:54 AM UTC-4, Stefan van den Eertwegh 
 wrote:

 Hi all,

 I have a model where a Field has IS_IN_SET({'1':T(''),2:T('')}).

 When you have a grid in web2py; When you edit the record you see the 
 value (the translatable string).
 But when you view the record you see the key of the IS_IN_SET.

 IS is possible to have the grid showing the value from the IS_IN_SET in 
 the view?

 Thank you!



-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Uploading a Package

2014-06-11 Thread Fabiano Almeida
Hi,

If you have application in tgz, unpack and copy to
web2py_folder/application/your_application.


2014-06-10 6:26 GMT-03:00 Priyank Yadav priyankyada...@gmail.com:

 Hello,
 I am new to web2py. Somebody sent me a tgz file which contained the source
 code.
 I am trying to upload thar code in my admin interface but first i have to
 convert that into w2p extension...
 Help
 Thank you

 --
 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 group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web2py grid shows key from IS_IN_SET({key: value}) model

2014-06-11 Thread Stefan van den Eertwegh
Hi Anthony,

I am sorry but it doesnt work.
Also gives pycharm an error at the rule mydict = dict

Stefan

Op woensdag 11 juni 2014 17:06:06 UTC+2 schreef Anthony:

 mydict = dict(1=T(''), 2=T(''))

 db.define_table('mytable',
 Field('myfield', represent=lambda v, r: mydict[v]))

 Anthony

 On Wednesday, June 11, 2014 10:50:06 AM UTC-4, Stefan van den Eertwegh 
 wrote:

 Hi Anthony,

 Me and my colleges tried it with represent but we cant figure it out.
 Can you give an example how this should work?
 The table and column is templates.type (key: value)

 Regards,
 Stefan van den Eertwegh

 Op woensdag 11 juni 2014 16:37:13 UTC+2 schreef Anthony:

 The IS_IN_SET validator affects form widgets but not other displays of 
 the values in the field. If you want to change the way a value is displayed 
 in a grid (or SQLTABLE), you must use the represent attribute of the 
 field.

 Anthony

 On Wednesday, June 11, 2014 8:58:54 AM UTC-4, Stefan van den Eertwegh 
 wrote:

 Hi all,

 I have a model where a Field has IS_IN_SET({'1':T(''),2:T('')}).

 When you have a grid in web2py; When you edit the record you see the 
 value (the translatable string).
 But when you view the record you see the key of the IS_IN_SET.

 IS is possible to have the grid showing the value from the IS_IN_SET in 
 the view?

 Thank you!



-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: multiple models in a plugin component

2014-06-11 Thread Louis Amon
I found an answer to my own question :
I split my model (plugin_name.py) into multiple files (0_settings.py, 
1_user.py, etc.) and put them all in a folder ./models/plugin_name/

Web2py does detect that all my model files belong to the same plugin and 
packs them together.


*Another problem happens if I do things that way tho :*

I use a database_uri as plugin parameter to define models (tables, fields, 
callbacks, etc.) in my plugin.
When I access this database from appadmin, the tables work fine 
(validators, callback, everything).
When I access this database from my main application (the one onto which my 
plugin is installed), my database isn't recognized at all.

From lurking on this fine forum, I established that I have 3 options here :

   1. Work around database cooperation (
   http://web2py.com/books/default/chapter/29/04#Cooperation)
   2. Use the auto_import=true argument in the DAL
   3. Rename the model files that came with my plugin, so all model 
   features are available in the global namespace

So far, I am unsatisfied with all 3 options, which a good reason for each 
of those :

   1. Because I have dependencies between tables which makes it very 
   difficult to cleanly manage all those imports
   2. Because auto_import doesn't manage to retrieve callbacks  
   validators, which leaves me with half the work left to do
   3. Because it would defeat the purpose of making a plugin in the first 
   place


I'm a mere padawan on this fine community, so if a web2py guru happens to 
read this thread I would appreciate any tip he could provide to face this 
issue !


On Friday, May 23, 2014 2:06:42 PM UTC+2, Louis Amon wrote:

 I am trying to build a big 'plugin component', with a plugin manager and 
 therefore using the full naming conventions specified in the doc.

 My model is starting to be huge (1000+ lines) and I'm trying to split it 
 into multiple files.


 Is there a way to name these files so that web2py still understands that 
 they're part of my plugin ?


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] json to D3 graph

2014-06-11 Thread Andrew W
What else is in your view?  Is the code inside a script?
What if you just returned dict( flare=flare) in your controller?

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: PIL library not working with apache 2.2

2014-06-11 Thread Niphlod
this is the relevant excerpt

*Note that the version of Python from which this baseline environment is 
created must be the same version of Python that mod_wsgi was compiled for. 
It is not possible to mix environments based on different major/minor 
versions of Python*

Usually people need to recompile mod_wsgi manually passing the right python 
homedir. 
a good method to check in debian-like OS is to run

 ldd /usr/lib/apache2/modules/mod_wsgi.so

and see what pops up

BTW: this is one among MAAANY reasons apache + mod_wsgi has been largely 
superseeded . Too many issues and too little flexibility in respect of 
other simpler and more performant alternatives.

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: json to D3 graph

2014-06-11 Thread Richard
Andrew,

When I respond with flare=flare I get the  issue, solved by XML()

Uncaught SyntaxError: Unexpected token  

My script starts with:

script

var width = 960,
height = 2200;

var cluster = d3.layout.cluster()
.size([height, width - 160]);

var diagonal = d3.svg.diagonal()
.projection(function(d) { return [d.y, d.x]; });

var svg = d3.select(body).append(svg)
.attr(width, width)
.attr(height, height)
.append(g)
.attr(transform, translate(40,0));

  var flare = {{=flare}} ;

  var nodes = cluster.nodes( flare ),
  links = cluster.links(nodes);

  var link = svg.selectAll(.link)
  .data(links)
.enter().append(path)
  .attr(class, link)
  .attr(d, diagonal);

Hope you can give me a crucial hint.


On Wednesday, June 11, 2014 5:49:13 PM UTC+2, Andrew W wrote:

 What else is in your view?  Is the code inside a script?
 What if you just returned dict( flare=flare) in your controller?


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web2py grid shows key from IS_IN_SET({key: value}) model

2014-06-11 Thread Anthony
Sorry, do it this way:

mydict = {1: T(''), 2: T('')}

Anthony

On Wednesday, June 11, 2014 11:24:34 AM UTC-4, Stefan van den Eertwegh 
wrote:

 Hi Anthony,

 I am sorry but it doesnt work.
 Also gives pycharm an error at the rule mydict = dict

 Stefan

 Op woensdag 11 juni 2014 17:06:06 UTC+2 schreef Anthony:

 mydict = dict(1=T(''), 2=T(''))

 db.define_table('mytable',
 Field('myfield', represent=lambda v, r: mydict[v]))

 Anthony

 On Wednesday, June 11, 2014 10:50:06 AM UTC-4, Stefan van den Eertwegh 
 wrote:

 Hi Anthony,

 Me and my colleges tried it with represent but we cant figure it out.
 Can you give an example how this should work?
 The table and column is templates.type (key: value)

 Regards,
 Stefan van den Eertwegh

 Op woensdag 11 juni 2014 16:37:13 UTC+2 schreef Anthony:

 The IS_IN_SET validator affects form widgets but not other displays of 
 the values in the field. If you want to change the way a value is 
 displayed 
 in a grid (or SQLTABLE), you must use the represent attribute of the 
 field.

 Anthony

 On Wednesday, June 11, 2014 8:58:54 AM UTC-4, Stefan van den Eertwegh 
 wrote:

 Hi all,

 I have a model where a Field has IS_IN_SET({'1':T(''),2:T('')}).

 When you have a grid in web2py; When you edit the record you see the 
 value (the translatable string).
 But when you view the record you see the key of the IS_IN_SET.

 IS is possible to have the grid showing the value from the IS_IN_SET 
 in the view?

 Thank you!



-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Is there a web2py plugin which lays out divs in a neat grid?

2014-06-11 Thread Derek
Ah, I use a different plugin for my website. You can animate or not, that's 
entirely up to you. Just a note that if you are animating, your animations 
should be much smoother if you use tweenmax.

The grids plugin is called Masonry. http://masonry.desandro.com/

The animation engine is 
Tweenmax. http://www.greensock.com/tweening-speed-test/



On Tuesday, June 10, 2014 7:31:12 PM UTC-7, Spokes wrote:

 It's a good plugin, and it seems to work fine with a page that is being 
 loaded or refreshed in a standard sense. However, my page has a scroll 
 feature in which the #content div's contents are updated (i.e. replaced 
 through an ajax call to a controller function that performs db queries and 
 returns a bunch of divs/cells which are not neatly arranged) - when this 
 scroll feature is utilized with freewall, you can see the cells (which 
 contain images) being shifted around within the #content div into a grid 
 arrangement. It's sort of a cool animation-like effect, but I'm not sure 
 that I want it for this page. It would be great if I could just generate 
 the grid server-side, but for that, I guess I'd need to know the heights of 
 the individual cells/divs, and those heights are variable and not set in 
 advance (i.e. no styling is applied); in other words, apparently this is 
 technically unfeasible.

 On Tuesday, June 10, 2014 1:02:15 PM UTC-5, Derek wrote:

 There's nothing preventing you from using freewall. What troubles have 
 you had with it?

 On Monday, June 9, 2014 10:41:46 AM UTC-7, Spokes wrote:

 Is anyone aware of a web2py plugin which can take a bunch of divs (let's 
 say, of the same class name) and lay them out, in sequence, in a neat grid? 
 I'm looking for something like the following jquery plugin: 
 http://vnjs.net/www/project/freewall/. Thank you.






-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Amazon RDS for PostgreSQL (Beta)

2014-06-11 Thread Michele Comitini
Support for PostgreSQL on RDS:

https://aws.amazon.com/rds/postgresql/

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: PIL library not working with apache 2.2

2014-06-11 Thread at


On Wednesday, 11 June 2014 21:08:43 UTC+5, Niphlod wrote:

 this is the relevant excerpt

 *Note that the version of Python from which this baseline environment is 
 created must be the same version of Python that mod_wsgi was compiled for. 
 It is not possible to mix environments based on different major/minor 
 versions of Python*

 Usually people need to recompile mod_wsgi manually passing the right 
 python homedir. 
 a good method to check in debian-like OS is to run

  ldd /usr/lib/apache2/modules/mod_wsgi.so

 and see what pops up 


Thank you Niphlod for the informative post. I'll further explore it.
 

 BTW: this is one among MAAANY reasons apache + mod_wsgi has been largely 
 superseeded . Too many issues and too little flexibility in respect of 
 other simpler and more performant alternatives.


What are other alternatives? really interested to know about it. 
Thanks
 

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: PIL library not working with apache 2.2

2014-06-11 Thread Niphlod
lighttpd and nginx for the webserver part, fastcgi, sgci or uwsgi for the 
python one.

On Wednesday, June 11, 2014 8:29:12 PM UTC+2, at wrote:



 On Wednesday, 11 June 2014 21:08:43 UTC+5, Niphlod wrote:

 this is the relevant excerpt

 *Note that the version of Python from which this baseline environment is 
 created must be the same version of Python that mod_wsgi was compiled for. 
 It is not possible to mix environments based on different major/minor 
 versions of Python*

 Usually people need to recompile mod_wsgi manually passing the right 
 python homedir. 
 a good method to check in debian-like OS is to run

  ldd /usr/lib/apache2/modules/mod_wsgi.so

 and see what pops up 


 Thank you Niphlod for the informative post. I'll further explore it.
  

 BTW: this is one among MAAANY reasons apache + mod_wsgi has been largely 
 superseeded . Too many issues and too little flexibility in respect of 
 other simpler and more performant alternatives.


 What are other alternatives? really interested to know about it. 
 Thanks
  


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Is This Web2py

2014-06-11 Thread Derek
Look at line 35 when you view source. 
meta name=generator content=Web2py Web Framework

On Tuesday, June 10, 2014 12:43:45 PM UTC-7, Ovidio Marinho wrote:

 http://sentibol.com/ 

 Congratulations http://sentibol.com/ourteam 

  Universidade de Lavras - Minas Gerais - Brasil.


   


  Ovidio Marinho Falcao Neto
   ITJP.NET.BR  
  ovid...@gmail.com javascript:
  itjp@gmail.com javascript:
  Brasil
   
  

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web2py grid shows key from IS_IN_SET({key: value}) model

2014-06-11 Thread 黄祥
Hi, Anthony, is it possible to combine the represent for change the color 
depend on the value with the represent for is_in_set translate above?
e.g.
table.status.represent = lambda status, field: SPAN(status, _class = 
'text-success' if status == 'Sold' else 'text-warning' if status == 'Hold' 
else 'text-error')
table.status.requires = IS_IN_SET([('On Sale', T('On Sale') ), ('Hold', 
T('Hold') ), ('Sold', T('Sold') ) ] )

thanks and 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)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: json to D3 graph

2014-06-11 Thread Andrew W
This may not be the crucial hint, but I noticed that your flare is a list 
(array).  If you checkout the structure at:
https://github.com/mbostock/d3/wiki/Cluster-Layout you see that its a dict 
(or object).

Try removing the [] around your flare definition. 

Secondly:   Where I have used XML(json... in the controller  it has been to 
produce a standaoone .json output from web2py, I then create an independent 
view that then uses the d3.json function to read the json output.   That is 
the approach that mostly matches the majority of d3 examples.   This works 
if you want to separate your data sources (thinking independent data api)  
from your presentation views.

The other approach is to use the variables, which you've done.  There may 
be more than one way to do this but this has worked for me:
1.  Change your flare definition to be a dict. remove the []
2.  Change your controller output to be return locals(). 
3.  In your view , in the script add:
{{from gluon.serializers import json}}
var flare = {{=XML(json(flare))}}







I think web2py is a good data provider for d3 apps

On Thursday, June 12, 2014 2:49:32 AM UTC+10, Richard wrote:

 Andrew,

 When I respond with flare=flare I get the  issue, solved by XML()

 Uncaught SyntaxError: Unexpected token  

 My script starts with:

 script

 var width = 960,
 height = 2200;

 var cluster = d3.layout.cluster()
 .size([height, width - 160]);

 var diagonal = d3.svg.diagonal()
 .projection(function(d) { return [d.y, d.x]; });

 var svg = d3.select(body).append(svg)
 .attr(width, width)
 .attr(height, height)
 .append(g)
 .attr(transform, translate(40,0));

   var flare = {{=flare}} ;
 
   var nodes = cluster.nodes( flare ),
   links = cluster.links(nodes);

   var link = svg.selectAll(.link)
   .data(links)
 .enter().append(path)
   .attr(class, link)
   .attr(d, diagonal);

 Hope you can give me a crucial hint.


 On Wednesday, June 11, 2014 5:49:13 PM UTC+2, Andrew W wrote:

 What else is in your view?  Is the code inside a script?
 What if you just returned dict( flare=flare) in your controller?



-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: json to D3 graph

2014-06-11 Thread Andrew W
P..S.   The above uses the approach of the generic.json files.  Refer to:
http://web2py.com/books/default/chapter/29/10/services?search=serializers
and the generic.json code.


On Thursday, June 12, 2014 8:20:04 AM UTC+10, Andrew W wrote:

 This may not be the crucial hint, but I noticed that your flare is a list 
 (array).  If you checkout the structure at:
 https://github.com/mbostock/d3/wiki/Cluster-Layout you see that its a 
 dict (or object).

 Try removing the [] around your flare definition. 

 Secondly:   Where I have used XML(json... in the controller  it has been 
 to produce a standaoone .json output from web2py, I then create an 
 independent view that then uses the d3.json function to read the json 
 output.   That is the approach that mostly matches the majority of d3 
 examples.   This works if you want to separate your data sources (thinking 
 independent data api)  from your presentation views.

 The other approach is to use the variables, which you've done.  There may 
 be more than one way to do this but this has worked for me:
 1.  Change your flare definition to be a dict. remove the []
 2.  Change your controller output to be return locals(). 
 3.  In your view , in the script add:
 {{from gluon.serializers import json}}
 var flare = {{=XML(json(flare))}}





 

 I think web2py is a good data provider for d3 apps

 On Thursday, June 12, 2014 2:49:32 AM UTC+10, Richard wrote:

 Andrew,

 When I respond with flare=flare I get the  issue, solved by XML()

 Uncaught SyntaxError: Unexpected token  

 My script starts with:

 script

 var width = 960,
 height = 2200;

 var cluster = d3.layout.cluster()
 .size([height, width - 160]);

 var diagonal = d3.svg.diagonal()
 .projection(function(d) { return [d.y, d.x]; });

 var svg = d3.select(body).append(svg)
 .attr(width, width)
 .attr(height, height)
 .append(g)
 .attr(transform, translate(40,0));

   var flare = {{=flare}} ;
 
   var nodes = cluster.nodes( flare ),
   links = cluster.links(nodes);

   var link = svg.selectAll(.link)
   .data(links)
 .enter().append(path)
   .attr(class, link)
   .attr(d, diagonal);

 Hope you can give me a crucial hint.


 On Wednesday, June 11, 2014 5:49:13 PM UTC+2, Andrew W wrote:

 What else is in your view?  Is the code inside a script?
 What if you just returned dict( flare=flare) in your controller?



-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Developer wanted!

2014-06-11 Thread Derek
$8k would cover a minimum wage person for about 5 months. I'm pretty sure 
it would take a bit longer than that and no developer worth anything would 
work for minimum wage. That said, you may have luck finding people in other 
places to do this work for you.

On Tuesday, June 10, 2014 2:06:50 PM UTC-7, Yanni Shainsky wrote:

 I am looking for a paid developer for project that goes from 
 concept-to-completion. 

 1. Database driven

 2. Functionality similar to yelp, craiglist, angieslist

 3. We will have at least 5 different user-types: visitors, authenticated 
 users, business users, moderators, administrators

 4. Users are able to submit how much they paid for a service.

 5. Graphs and tables that display information. The individual items on the 
 graph are linked to specific submissions. 

 6. Would prefer a modern design, utilizing HTML5 and/or Bootstrap.

 7. Would prefer Python based development, using a web framework such as 
 Web2Py or Django

 8. Would need some basic authentication integration with Facebook and/or 
 Google.

 9. Would prefer someone that has experience building sites that consider 
 geographical areas (zip codes,

 area codes).

 10. Would prefer someone that has worked on a classified's type project. 


 The budget for the project is $8k - but somewhat flexible (initial 
 deployment), and then per-hour support.

 Please email me at yanni.s...@gmail.com javascript:, or reply here if 
 you're interested. I will invite you to bid a private project on oDesk.com, 
 so if possible please provide your oDesk contact information. 

  


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Auto update db records behaviour per input field on release (AJAX)

2014-06-11 Thread Francisco G. T. Ribeiro
hi all,
I'm working on an app that uses forms that can be quite long and it's users 
often interrupt their sessions for whatever reason and end up losing the 
information already filled. For this and other reasons I wanted to provide 
a different behaviour to these forms where each input field updates the 
record on the database as soon as its input field is released ('focusOut' 
event on jQuery). Ideally, the server would reply with 'success' or an 
error message so users know they can go on to another field (without 
refreshing the whole page). By the end of the form, the user wouldn't have 
to review things that were written long ago since these were all already 
validated.

Now, I know this can be tricky due to database constrains but because i 
need to do this very often (multiple fields and multiple forms), I thought 
it would be useful to automate it, maybe even by having on the db Field 
something like '..auto_update=True' (merely a suggestion) but before 
getting there, I would like to know if anyone has faced this problem and if 
yes what solution did you employ? 

Thank you in advance,
Francisco

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] json javascript

2014-06-11 Thread LoveWeb2py


-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] ERROR when MYSQL try to CAST() to LONGTEXT

2014-06-11 Thread André Kablu

I have a mysql database and created a LIST:INTEGER field

It is created in MYSQL as LONGTEXT type of data


In one of my queries I have received an error:

*WEB2PY QUERY:*
db.table.id_field_list.contains(db.table2.id)

*MYSQL QUERY:*
SELECT * FROM table, table2 WHERE (table.id_field_list LIKE 
(CONCAT('%|',(REPLACE((REPLACE(CAST(table2.id AS 
LONGTEXT),'%','%%')),'|','||')),'|%')))

The error is with CAST()

Reading mysql documentation, CAST() does not support LONGTEXT
*http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast*

And there are some discussions on google about CAST with LONGTEXT in MYSQL 
that also said it is not compatible 


If you want to test this behavior, try this command in MYSQL:


SELECT CAST(123 as LONGTEXT);
you will receive the error

then try:

SELECT CAST(123 as char);
and everything goes fine


Is there any way to fix this issue in official version by removing the CAST 
from list: fields for MYSQL or any other better idea?

Thanks

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How to use requires with list:reference

2014-06-11 Thread Mandar Vaze / मंदार वझे
Anthony,

Let me say that you have been tremendous help.

On Wed, Jun 11, 2014 at 6:00 PM, Anthony abasta...@gmail.com wrote:

 Are you saying you want the user to enter a last name for the child and
 then have the drop-down dynamically updated with the list of parents with
 the entered last name? If so, obviously that cannot be done at the time the
 form is generated on the server because you don't know what name the user
 will enter in the form.


Hmm.. I did not thing of that.
Actually I was trying only Edit option - where last name of the child is
known, but parent information is not populated.
Did not think of New scenario - my bad.


 You'll instead have to handle this with Javascript in the browser,
 possibly with an Ajax call back to the server to populate the list

(unless the list of parents is small enough to send to the browser with the
 initial page load).


Makes sense. In that case :

should I even use reference parent ? Cause I think it will automatically
create and populate the widget for me (which I think I will need to hide
somehow ?)

-Mandar

-- 
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 group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.