[web2py] Re: Retrieve User details from Auth_user using restfull api

2015-12-08 Thread Jayakumar Bellie
I am also getting the same error. 
@peterdawhiz : Did you find the solution?



On Saturday, August 29, 2015 at 3:54:04 AM UTC+5:30, peterdawhiz wrote:
>
> Am able to retrieve record from all tables except the Auth tables(am using 
> default web2py names). Am using restful api function below.
> The request is in this format: 
> *this works :*
>  *http://127.0.0.1:8000/app/default/api/country.json 
>   *
>
> *this one fails:*
>  *http://127.0.0.1:8000/app/default/api/auth_user.json 
>   *
>
> @request.restful()
> def api():
> response.view = 'generic.' + request.extension
> def GET(*args, **vars):
> patterns = 'auto'
> parser = db.parse_as_rest(patterns,args,vars)
> if parser.status == 200:
> return dict(content=parser.response)
> else:
> raise HTTP(parser.status,parser.error)
> def POST(table_name,**vars):
> return db[table_name].validate_and_insert(**vars)
> def PUT(table_name,record_id,**vars):
> return db(db[table_name]._id==record_id).update(**vars)
> def DELETE(table_name,record_id):
> return db(db[table_name]._id==record_id).delete()
> return dict(GET=GET, POST=POST, PUT=PUT, DELETE=DELETE)
>
> Where is my request to Auth tables failing?
>

-- 
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: Unable to join more than one table in SQLForm.grid

2013-10-25 Thread Jayakumar Bellie
*Web2py version:* 2.5.1-stable+timestamp.2013.06.06.15.39.19

query = ((db.auth_group.id0)  
(db.auth_group.id==db.auth_membership.group_id)  
(db.auth_user.id==db.auth_membership.user_id)  
(auth.user.id==db.auth_user.id))
#return dict(table=query)
displayFields = [db.auth_group.id, db.auth_group.role, 
db.auth_group.description]
displayHeaders = {'auth_group.role': T('Role'), 
'auth_group.description' : T('Description')}
table = SQLFORM.grid(query,
 fields=displayFields,
 headers=displayHeaders,
 deletable=False,
 create=False,
 editable=False,
 details=False,
 csv=False,
 links=[lambda row: A(Edit, 
_href=URL('manage_group', args=[row.auth_group.id]))],
 paginate=10)
return dict(table=table)

*When I enable editable or create it will take to auth_user, but it should 
take to auth_group*


On Friday, October 25, 2013 2:45:58 AM UTC+5:30, Cliff Kachinske wrote:

 What version of Web2py?

 Can you post your code? 

 I've been using Web2py since v 1.8 and I've never seen the behavior you 
 describe.

 On Thursday, October 24, 2013 8:51:38 AM UTC-4, Jayakumar Bellie wrote:

 I have tried that, it did not work.

 On Thursday, October 24, 2013 12:01:05 PM UTC+5:30, Niphlod wrote:

 use the field_id argument to tell the grid what id should use to 
 generate the links.

 On Thursday, October 24, 2013 7:39:02 AM UTC+2, Jayakumar Bellie wrote:

 That does not work.
 Add button still takes to user add.


 On Thursday, October 24, 2013 1:51:26 AM UTC+5:30, Cliff Kachinske 
 wrote:

 If you want grid to manage groups, use this query: db.auth_group.id0.

 On Wednesday, October 23, 2013 4:41:46 AM UTC-4, Jayakumar Bellie 
 wrote:

 When you send the query as you defined to SQLForm, it creates the 
 list. When you click on add it takes to auth_user add, but it should 
 take 
 to auth_group add.


 On Tuesday, October 22, 2013 4:11:17 PM UTC+5:30, Cliff Kachinske 
 wrote:

 This defines a set of Row objects.
 query = db((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id)).select(db.auth_group.ALL)

 This is how you define a query object.
 query = ((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id))

 On Tuesday, October 22, 2013 2:05:12 AM UTC-4, Jayakumar Bellie 
 wrote:

 How does that matter the my query?
 I have to give some where condition.
 Can you elaborate.


 On Friday, October 18, 2013 9:05:06 PM UTC+5:30, villas wrote:

 HI Jayakumar

 Try using a query rather than a rows object.

 For example, rather than:
  query = db().select(db.auth_user.ALL)  ## gives a rows 
 object,  unusable by grid

 Use this:
  query = db.auth_user.id0  

 Hope you get the idea.
 Best regards,  D



 On Friday, 18 October 2013 06:43:24 UTC+1, Jayakumar Bellie wrote:

 Hi,

 I want to fetch all the auth_group list of a user from auth_user 
 mapping auth_membership.

 -
 query = db((db.auth_group.id==db.auth_membership.group_id)  
 (db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id
 ==auth.user.id)).select(db.auth_group.ALL)
 *# When I do the return over here, I am able to see the 
 required data. But when I send it to the SQLFORM.grip it through the 
 execption given below*
 *#return dict(table=where)   
  

 *
 displayFields = [db.auth_group.role, 
 db.auth_group.description]
 displayHeaders = {'auth_group.role': T('Role'), 
 'auth_group.description' : T('Description')}
 table = SQLFORM.grid(query,
  #left=left, 
  


  fields=displayFields,
  headers=displayHeaders,
  deletable=False,
  create=True,
  editable=False,
  details=False,
  csv=False,
  links=[lambda row: A(Edit, 
 _href=URL('manage_group', args=[row.id]))], 
  
  paginate=10)
 return dict(table=table)

 -

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 212, in 
 restricted
 exec ccode in environment

[web2py] Re: groupby in sqlform.grid resulted into unsupported query

2013-10-25 Thread Jayakumar Bellie
I am also having the same issue.

I am using 2.5.1-stable+timestamp.2013.06.06.15.39.19

--
On Tuesday, August 6, 2013 4:08:38 AM UTC+5:30, villas wrote:

 IMO anyone who want to have a grid populated by aggregate functions should 
 be rolling their own,  but that isn't the issue raised by the OP.  

 Yes, anything which doesn't have a unique record id is probably not going 
 to be editable,  on a practical basis.  I'm not convinced that SQLFORM.gird 
 should be offering a groupby clause,  but I guess we already have one,  in 
 which case just a view-only grid is the way forward...?


-- 
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/groups/opt_out.


[web2py] Re: Unable to join more than one table in SQLForm.grid

2013-10-25 Thread Jayakumar Bellie
Thanks that worked :)


On Friday, October 25, 2013 3:34:03 PM UTC+5:30, Cliff Kachinske wrote:

 Ah, now I understand what you are trying to do.

 This works for me in that the Add button takes me to auth_group.  You will 
 have to define an oncreate function to link the new group back to the user, 
 by the way. RTFM for that.

 Stare at my query until you understand how it works. 

 The controller is named auth_group.py. 

 @auth.requires_login()
 def index(): 
 query = (
 (db.auth_group.id==db.auth_membership.group_id) 
 (db.auth_membership.user_id==auth.user.id)
 )
 form = SQLFORM.grid(query)
 return dict(form=form)

 On Friday, October 25, 2013 2:34:07 AM UTC-4, Jayakumar Bellie wrote:

 *Web2py version:* 2.5.1-stable+timestamp.2013.06.06.15.39.19

 query = ((db.auth_group.id0)  
 (db.auth_group.id==db.auth_membership.group_id) 
  (db.auth_user.id==db.auth_membership.user_id)  (auth.user.id==
 db.auth_user.id))
 #return dict(table=query)
 displayFields = [db.auth_group.id, db.auth_group.role, 
 db.auth_group.description]
 displayHeaders = {'auth_group.role': T('Role'), 
 'auth_group.description' : T('Description')}
 table = SQLFORM.grid(query,
  fields=displayFields,
  headers=displayHeaders,
  deletable=False,
  create=False,
  editable=False,
  details=False,
  csv=False,
  links=[lambda row: A(Edit, 
 _href=URL('manage_group', args=[row.auth_group.id]))],
  paginate=10)
 return dict(table=table)

 *When I enable editable or create it will take to auth_user, but it 
 should take to auth_group*


 
 On Friday, October 25, 2013 2:45:58 AM UTC+5:30, Cliff Kachinske wrote:

 What version of Web2py?

 Can you post your code? 

 I've been using Web2py since v 1.8 and I've never seen the behavior you 
 describe.

 On Thursday, October 24, 2013 8:51:38 AM UTC-4, Jayakumar Bellie wrote:

 I have tried that, it did not work.

 On Thursday, October 24, 2013 12:01:05 PM UTC+5:30, Niphlod wrote:

 use the field_id argument to tell the grid what id should use to 
 generate the links.

 On Thursday, October 24, 2013 7:39:02 AM UTC+2, Jayakumar Bellie wrote:

 That does not work.
 Add button still takes to user add.


 On Thursday, October 24, 2013 1:51:26 AM UTC+5:30, Cliff Kachinske 
 wrote:

 If you want grid to manage groups, use this query: db.auth_group.id
 0.

 On Wednesday, October 23, 2013 4:41:46 AM UTC-4, Jayakumar Bellie 
 wrote:

 When you send the query as you defined to SQLForm, it creates the 
 list. When you click on add it takes to auth_user add, but it should 
 take 
 to auth_group add.


 On Tuesday, October 22, 2013 4:11:17 PM UTC+5:30, Cliff Kachinske 
 wrote:

 This defines a set of Row objects.
 query = db((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id)).select(db.auth_group.ALL)

 This is how you define a query object.
 query = ((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id))

 On Tuesday, October 22, 2013 2:05:12 AM UTC-4, Jayakumar Bellie 
 wrote:

 How does that matter the my query?
 I have to give some where condition.
 Can you elaborate.


 On Friday, October 18, 2013 9:05:06 PM UTC+5:30, villas wrote:

 HI Jayakumar

 Try using a query rather than a rows object.

 For example, rather than:
  query = db().select(db.auth_user.ALL)  ## gives a rows 
 object,  unusable by grid

 Use this:
  query = db.auth_user.id0  

 Hope you get the idea.
 Best regards,  D



 On Friday, 18 October 2013 06:43:24 UTC+1, Jayakumar Bellie 
 wrote:

 Hi,

 I want to fetch all the auth_group list of a user from 
 auth_user mapping auth_membership.

 -
 query = db((db.auth_group.id==db.auth_membership.group_id) 
  (db.auth_user.id==db.auth_membership.user_id)  (
 db.auth_user.id==auth.user.id)).select(db.auth_group.ALL)
 *# When I do the return over here, I am able to see the 
 required data. But when I send it to the SQLFORM.grip it through 
 the 
 execption given below*
 *#return dict(table=where) 

  
   *
 displayFields = [db.auth_group.role, 
 db.auth_group.description]
 displayHeaders = {'auth_group.role': T('Role'), 
 'auth_group.description' : T('Description')}
 table = SQLFORM.grid(query,
  #left=left

[web2py] Re: Unable to join more than one table in SQLForm.grid

2013-10-24 Thread Jayakumar Bellie
I have tried that, it did not work.

On Thursday, October 24, 2013 12:01:05 PM UTC+5:30, Niphlod wrote:

 use the field_id argument to tell the grid what id should use to generate 
 the links.

 On Thursday, October 24, 2013 7:39:02 AM UTC+2, Jayakumar Bellie wrote:

 That does not work.
 Add button still takes to user add.


 On Thursday, October 24, 2013 1:51:26 AM UTC+5:30, Cliff Kachinske wrote:

 If you want grid to manage groups, use this query: db.auth_group.id0.

 On Wednesday, October 23, 2013 4:41:46 AM UTC-4, Jayakumar Bellie wrote:

 When you send the query as you defined to SQLForm, it creates the list. 
 When you click on add it takes to auth_user add, but it should take to 
 auth_group add.


 On Tuesday, October 22, 2013 4:11:17 PM UTC+5:30, Cliff Kachinske wrote:

 This defines a set of Row objects.
 query = db((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id)).select(db.auth_group.ALL)

 This is how you define a query object.
 query = ((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id))

 On Tuesday, October 22, 2013 2:05:12 AM UTC-4, Jayakumar Bellie wrote:

 How does that matter the my query?
 I have to give some where condition.
 Can you elaborate.


 On Friday, October 18, 2013 9:05:06 PM UTC+5:30, villas wrote:

 HI Jayakumar

 Try using a query rather than a rows object.

 For example, rather than:
  query = db().select(db.auth_user.ALL)  ## gives a rows object,  
 unusable by grid

 Use this:
  query = db.auth_user.id0  

 Hope you get the idea.
 Best regards,  D



 On Friday, 18 October 2013 06:43:24 UTC+1, Jayakumar Bellie wrote:

 Hi,

 I want to fetch all the auth_group list of a user from auth_user 
 mapping auth_membership.

 -
 query = db((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id)).select(db.auth_group.ALL)
 *# When I do the return over here, I am able to see the 
 required data. But when I send it to the SQLFORM.grip it through the 
 execption given below*
 *#return dict(table=where) 

  
   *
 displayFields = [db.auth_group.role, db.auth_group.description]
 displayHeaders = {'auth_group.role': T('Role'), 
 'auth_group.description' : T('Description')}
 table = SQLFORM.grid(query,
  #left=left,   

  
  
  fields=displayFields,
  headers=displayHeaders,
  deletable=False,
  create=True,
  editable=False,
  details=False,
  csv=False,
  links=[lambda row: A(Edit, 
 _href=URL('manage_group', args=[row.id]))],   

  paginate=10)
 return dict(table=table)

 -

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 212, in 
 restricted
 exec ccode in environment
   File 
 /home/www-data/web2py/applications/Telematics/controllers/group.py 
 http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py,
  line 64, in module
   File /home/www-data/web2py/gluon/globals.py, line 194, in lambda
 self._caller = lambda f: f()
   File /home/www-data/web2py/gluon/tools.py, line 3022, in f
 return action(*a, **b)
   File 
 /home/www-data/web2py/applications/Telematics/controllers/group.py 
 http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py,
  line 22, in list_groups
 paginate=10)
   File /home/www-data/web2py/gluon/sqlhtml.py, line 1861, in grid
 db = query._db
 AttributeError: 'Rows' object has no attribute '_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)
--- 
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/groups/opt_out.


[web2py] Re: Unable to join more than one table in SQLForm.grid

2013-10-23 Thread Jayakumar Bellie
When you send the query as you defined to SQLForm, it creates the list. 
When you click on add it takes to auth_user add, but it should take to 
auth_group add.


On Tuesday, October 22, 2013 4:11:17 PM UTC+5:30, Cliff Kachinske wrote:

 This defines a set of Row objects.
 query = db((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id)).select(db.auth_group.ALL)

 This is how you define a query object.
 query = ((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id))

 On Tuesday, October 22, 2013 2:05:12 AM UTC-4, Jayakumar Bellie wrote:

 How does that matter the my query?
 I have to give some where condition.
 Can you elaborate.


 On Friday, October 18, 2013 9:05:06 PM UTC+5:30, villas wrote:

 HI Jayakumar

 Try using a query rather than a rows object.

 For example, rather than:
  query = db().select(db.auth_user.ALL)  ## gives a rows object,  
 unusable by grid

 Use this:
  query = db.auth_user.id0  

 Hope you get the idea.
 Best regards,  D



 On Friday, 18 October 2013 06:43:24 UTC+1, Jayakumar Bellie wrote:

 Hi,

 I want to fetch all the auth_group list of a user from auth_user 
 mapping auth_membership.

 -
 query = db((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id)).select(db.auth_group.ALL)
 *# When I do the return over here, I am able to see the required 
 data. But when I send it to the SQLFORM.grip it through the execption 
 given 
 below*
 *#return dict(table=where) 

  
   *
 displayFields = [db.auth_group.role, db.auth_group.description]
 displayHeaders = {'auth_group.role': T('Role'), 
 'auth_group.description' : T('Description')}
 table = SQLFORM.grid(query,
  #left=left,   

  
  
  fields=displayFields,
  headers=displayHeaders,
  deletable=False,
  create=True,
  editable=False,
  details=False,
  csv=False,
  links=[lambda row: A(Edit, 
 _href=URL('manage_group', args=[row.id]))],   

  paginate=10)
 return dict(table=table)

 -

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 212, in restricted
 exec ccode in environment
   File 
 /home/www-data/web2py/applications/Telematics/controllers/group.py 
 http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py,
  line 64, in module
   File /home/www-data/web2py/gluon/globals.py, line 194, in lambda
 self._caller = lambda f: f()
   File /home/www-data/web2py/gluon/tools.py, line 3022, in f
 return action(*a, **b)
   File 
 /home/www-data/web2py/applications/Telematics/controllers/group.py 
 http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py,
  line 22, in list_groups
 paginate=10)
   File /home/www-data/web2py/gluon/sqlhtml.py, line 1861, in grid
 db = query._db
 AttributeError: 'Rows' object has no attribute '_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)
--- 
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/groups/opt_out.


[web2py] Re: Unable to join more than one table in SQLForm.grid

2013-10-23 Thread Jayakumar Bellie
That does not work.
Add button still takes to user add.


On Thursday, October 24, 2013 1:51:26 AM UTC+5:30, Cliff Kachinske wrote:

 If you want grid to manage groups, use this query: db.auth_group.id0.

 On Wednesday, October 23, 2013 4:41:46 AM UTC-4, Jayakumar Bellie wrote:

 When you send the query as you defined to SQLForm, it creates the list. 
 When you click on add it takes to auth_user add, but it should take to 
 auth_group add.


 On Tuesday, October 22, 2013 4:11:17 PM UTC+5:30, Cliff Kachinske wrote:

 This defines a set of Row objects.
 query = db((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id)).select(db.auth_group.ALL)

 This is how you define a query object.
 query = ((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id))

 On Tuesday, October 22, 2013 2:05:12 AM UTC-4, Jayakumar Bellie wrote:

 How does that matter the my query?
 I have to give some where condition.
 Can you elaborate.


 On Friday, October 18, 2013 9:05:06 PM UTC+5:30, villas wrote:

 HI Jayakumar

 Try using a query rather than a rows object.

 For example, rather than:
  query = db().select(db.auth_user.ALL)  ## gives a rows object,  
 unusable by grid

 Use this:
  query = db.auth_user.id0  

 Hope you get the idea.
 Best regards,  D



 On Friday, 18 October 2013 06:43:24 UTC+1, Jayakumar Bellie wrote:

 Hi,

 I want to fetch all the auth_group list of a user from auth_user 
 mapping auth_membership.

 -
 query = db((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id)).select(db.auth_group.ALL)
 *# When I do the return over here, I am able to see the required 
 data. But when I send it to the SQLFORM.grip it through the execption 
 given 
 below*
 *#return dict(table=where)   
  

 *
 displayFields = [db.auth_group.role, db.auth_group.description]
 displayHeaders = {'auth_group.role': T('Role'), 
 'auth_group.description' : T('Description')}
 table = SQLFORM.grid(query,
  #left=left, 
  


  fields=displayFields,
  headers=displayHeaders,
  deletable=False,
  create=True,
  editable=False,
  details=False,
  csv=False,
  links=[lambda row: A(Edit, 
 _href=URL('manage_group', args=[row.id]))], 
  
  paginate=10)
 return dict(table=table)

 -

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 212, in 
 restricted
 exec ccode in environment
   File 
 /home/www-data/web2py/applications/Telematics/controllers/group.py 
 http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py,
  line 64, in module
   File /home/www-data/web2py/gluon/globals.py, line 194, in lambda
 self._caller = lambda f: f()
   File /home/www-data/web2py/gluon/tools.py, line 3022, in f
 return action(*a, **b)
   File 
 /home/www-data/web2py/applications/Telematics/controllers/group.py 
 http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py,
  line 22, in list_groups
 paginate=10)
   File /home/www-data/web2py/gluon/sqlhtml.py, line 1861, in grid
 db = query._db
 AttributeError: 'Rows' object has no attribute '_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)
--- 
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/groups/opt_out.


[web2py] Re: Unable to join more than one table in SQLForm.grid

2013-10-22 Thread Jayakumar Bellie
How does that matter the my query?
I have to give some where condition.
Can you elaborate.


On Friday, October 18, 2013 9:05:06 PM UTC+5:30, villas wrote:

 HI Jayakumar

 Try using a query rather than a rows object.

 For example, rather than:
  query = db().select(db.auth_user.ALL)  ## gives a rows object,  
 unusable by grid

 Use this:
  query = db.auth_user.id0  

 Hope you get the idea.
 Best regards,  D



 On Friday, 18 October 2013 06:43:24 UTC+1, Jayakumar Bellie wrote:

 Hi,

 I want to fetch all the auth_group list of a user from auth_user mapping 
 auth_membership.

 -
 query = db((db.auth_group.id==db.auth_membership.group_id)  (
 db.auth_user.id==db.auth_membership.user_id)  (db.auth_user.id==
 auth.user.id)).select(db.auth_group.ALL)
 *# When I do the return over here, I am able to see the required 
 data. But when I send it to the SQLFORM.grip it through the execption given 
 below*
 *#return dict(table=where)   
 
 *
 displayFields = [db.auth_group.role, db.auth_group.description]
 displayHeaders = {'auth_group.role': T('Role'), 
 'auth_group.description' : T('Description')}
 table = SQLFORM.grid(query,
  #left=left, 
 

  fields=displayFields,
  headers=displayHeaders,
  deletable=False,
  create=True,
  editable=False,
  details=False,
  csv=False,
  links=[lambda row: A(Edit, 
 _href=URL('manage_group', args=[row.id]))], 
  
  paginate=10)
 return dict(table=table)

 -

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 212, in restricted
 exec ccode in environment
   File /home/www-data/web2py/applications/Telematics/controllers/group.py 
 http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py, 
 line 64, in module
   File /home/www-data/web2py/gluon/globals.py, line 194, in lambda
 self._caller = lambda f: f()
   File /home/www-data/web2py/gluon/tools.py, line 3022, in f
 return action(*a, **b)
   File /home/www-data/web2py/applications/Telematics/controllers/group.py 
 http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py, 
 line 22, in list_groups
 paginate=10)
   File /home/www-data/web2py/gluon/sqlhtml.py, line 1861, in grid
 db = query._db
 AttributeError: 'Rows' object has no attribute '_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)
--- 
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/groups/opt_out.


[web2py] Unable to join more than one table in SQLForm.grid

2013-10-17 Thread Jayakumar Bellie
Hi,

I want to fetch all the auth_group list of a user from auth_user mapping 
auth_membership.

-
query = db((db.auth_group.id==db.auth_membership.group_id)  
(db.auth_user.id==db.auth_membership.user_id)  
(db.auth_user.id==auth.user.id)).select(db.auth_group.ALL)
*# When I do the return over here, I am able to see the required data. 
But when I send it to the SQLFORM.grip it through the execption given below*
*#return dict(table=where) 

  *
displayFields = [db.auth_group.role, db.auth_group.description]
displayHeaders = {'auth_group.role': T('Role'), 
'auth_group.description' : T('Description')}
table = SQLFORM.grid(query,
 #left=left,   

 
 fields=displayFields,
 headers=displayHeaders,
 deletable=False,
 create=True,
 editable=False,
 details=False,
 csv=False,
 links=[lambda row: A(Edit, 
_href=URL('manage_group', args=[row.id]))], 
 
 paginate=10)
return dict(table=table)

-

Traceback (most recent call last):
  File /home/www-data/web2py/gluon/restricted.py, line 212, in restricted
exec ccode in environment
  File /home/www-data/web2py/applications/Telematics/controllers/group.py 
http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py, 
line 64, in module
  File /home/www-data/web2py/gluon/globals.py, line 194, in lambda
self._caller = lambda f: f()
  File /home/www-data/web2py/gluon/tools.py, line 3022, in f
return action(*a, **b)
  File /home/www-data/web2py/applications/Telematics/controllers/group.py 
http://127.0.0.1:8000/admin/default/edit/Telematics/controllers/group.py, 
line 22, in list_groups
paginate=10)
  File /home/www-data/web2py/gluon/sqlhtml.py, line 1861, in grid
db = query._db
AttributeError: 'Rows' object has no attribute '_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)
--- 
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/groups/opt_out.


Re: [web2py] Re: Web2py on apache2 is slow

2013-10-10 Thread Jayakumar Bellie
I have both LAMP and web2py installed in the same machine.

I have the same logic to read a file.

It looks web2py is slower than PHP 5.4.9


On Saturday, October 5, 2013 9:44:59 PM UTC+5:30, Ricardo Pedroso wrote:

 On Sat, Oct 5, 2013 at 12:36 AM, Derek sp1...@gmail.com javascript: 
 wrote: 

  Yes, Python will be slower than PHP. 

 No, Python will not be slower than PHP. 

 Some things are faster in Python other are faster in PHP. 


  PHP doesn't have a VM or garbage collection. 

 How PHP does not have a VM? How PHP code runs, then? 

 PHP  5.3.0  has garbage collection. 

 Ricardo 


-- 
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/groups/opt_out.


[web2py] Is there any timeout settings for server response?

2013-10-08 Thread Jayakumar Bellie
We can set timeout settings for a request sent to the server through ajax.

Is there any timeout settings for server response in web2py?

-- 
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/groups/opt_out.


[web2py] Re: HTML error code 206, due to headers not set

2013-10-08 Thread Jayakumar Bellie
Is there any timeout settings?

On Monday, October 7, 2013 9:31:52 PM UTC+5:30, Jayakumar Bellie wrote:

 I have also found if there is good internet speed, this problem does not 
 occur. It works fine with 8 Mbps connection.

 On Monday, October 7, 2013 11:15:43 AM UTC+5:30, Jayakumar Bellie wrote:

 I created a new application and just added 

 {{=response.toolbar()}} 

 In my view and check for my response is

 headers:X-Powered-By:web2pylogo:*web2py*™  http://www.web2py.com/
 On Saturday, October 5, 2013 8:12:21 AM UTC+5:30, Massimo Di Pierro wrote:

 This is where the 206 status is set and looks to me the headers are set. 
 Can anybody reproduce the problem?
 Can you show us the controller?

 On Friday, 4 October 2013 14:16:04 UTC-5, Niphlod wrote:

 if you get back only that header, something is wrong with your setup. 
 web2py adds a bunch of standard headers on every response.
 https://github.com/web2py/web2py/blob/master/gluon/main.py#L209

 On Friday, October 4, 2013 9:12:22 AM UTC+2, Jayakumar Bellie wrote:

 Hi,
 When my application loads, it does not load the js files fully. I 
 found it loads then partially, 
 due to this application is not at all usable.

 I found that application has only one header

 {'X-Powered-By': 'web2py'}

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html  10.2.7 206 
 Partial Content
 says adding content type and content length will solve the issue.
 How to add then in web2py
 It is possible to add content type. 
 How about content length?
 Will this solve my problem?



-- 
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/groups/opt_out.


[web2py] How to create Testimonials page using web2py?

2013-10-07 Thread Jayakumar Bellie
Hi,

Have anyone created a testimonial page using web2py?

-- 
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/groups/opt_out.


[web2py] Re: HTML error code 206, due to headers not set

2013-10-07 Thread Jayakumar Bellie
I have also found if there is good internet speed, this problem does not 
occur. It works fine with 8 Mbps connection.

On Monday, October 7, 2013 11:15:43 AM UTC+5:30, Jayakumar Bellie wrote:

 I created a new application and just added 

 {{=response.toolbar()}} 

 In my view and check for my response is

 headers:X-Powered-By:web2pylogo:*web2py*™  http://www.web2py.com/
 On Saturday, October 5, 2013 8:12:21 AM UTC+5:30, Massimo Di Pierro wrote:

 This is where the 206 status is set and looks to me the headers are set. 
 Can anybody reproduce the problem?
 Can you show us the controller?

 On Friday, 4 October 2013 14:16:04 UTC-5, Niphlod wrote:

 if you get back only that header, something is wrong with your setup. 
 web2py adds a bunch of standard headers on every response.
 https://github.com/web2py/web2py/blob/master/gluon/main.py#L209

 On Friday, October 4, 2013 9:12:22 AM UTC+2, Jayakumar Bellie wrote:

 Hi,
 When my application loads, it does not load the js files fully. I found 
 it loads then partially, 
 due to this application is not at all usable.

 I found that application has only one header

 {'X-Powered-By': 'web2py'}

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html  10.2.7 206 
 Partial Content
 says adding content type and content length will solve the issue.
 How to add then in web2py
 It is possible to add content type. 
 How about content length?
 Will this solve my problem?



-- 
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/groups/opt_out.


[web2py] Re: HTML error code 206, due to headers not set

2013-10-06 Thread Jayakumar Bellie
I created a new application and just added 

{{=response.toolbar()}} 

In my view and check for my response is

headers:X-Powered-By:web2pylogo:*web2py*™  http://www.web2py.com/
On Saturday, October 5, 2013 8:12:21 AM UTC+5:30, Massimo Di Pierro wrote:

 This is where the 206 status is set and looks to me the headers are set. 
 Can anybody reproduce the problem?
 Can you show us the controller?

 On Friday, 4 October 2013 14:16:04 UTC-5, Niphlod wrote:

 if you get back only that header, something is wrong with your setup. 
 web2py adds a bunch of standard headers on every response.
 https://github.com/web2py/web2py/blob/master/gluon/main.py#L209

 On Friday, October 4, 2013 9:12:22 AM UTC+2, Jayakumar Bellie wrote:

 Hi,
 When my application loads, it does not load the js files fully. I found 
 it loads then partially, 
 due to this application is not at all usable.

 I found that application has only one header

 {'X-Powered-By': 'web2py'}

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html  10.2.7 206 
 Partial Content
 says adding content type and content length will solve the issue.
 How to add then in web2py
 It is possible to add content type. 
 How about content length?
 Will this solve my problem?



-- 
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/groups/opt_out.


[web2py] HTML error code 206, due to headers not set

2013-10-04 Thread Jayakumar Bellie
Hi,
When my application loads, it does not load the js files fully. I found it 
loads then partially, 
due to this application is not at all usable.

I found that application has only one header

{'X-Powered-By': 'web2py'}

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html  10.2.7 206 Partial 
Content
says adding content type and content length will solve the issue.
How to add then in web2py
It is possible to add content type. 
How about content length?
Will this solve my problem?

-- 
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/groups/opt_out.


[web2py] Re: Web2py on apache2 is slow

2013-10-04 Thread Jayakumar Bellie
Both the servers H/W configuration are

   - Intel i5 650 @ 3.20GHz
   - 320 GB hard disk
   - 4GB RAM

Both the server has Ubuntu 13.04

The major difference between the servers are

Server 1:
LAMP
PostgreSQL (Installed but not used)

Server 2:
LAMP (Installed but not used, apart from apache2 used by web2py)
web2py
PostgreSQL

I try to run a grep command on a 30 MB file and redirect output to a tmp 
folder.
Read the file in the tmp folder and display it.

When I do this in PHP it is very fast.
But when I do it in web2py it is slow.

I have tested this on different machines with different internet bandwidth. 
Result is the same, sometimes web2py is slow in the host machine itself.

I don't know why it is slow in the host machine.

Is there any configuration setting I should change?
As Derek said python is slow?


On Thursday, October 3, 2013 4:58:00 AM UTC+5:30, Derek wrote:

 No clue. What do you mean by slow? Anything in python might be considered 
 slow comparatively to php. 

 On Tuesday, October 1, 2013 4:09:38 AM UTC-7, Jayakumar Bellie wrote:

 I have two servers, both are linux same configuration (OS and hardware).

 I have a program running in PHP in one server and it is very fast is 
 loading the data.

 I have web2py running in an different server, it is very slow.

 Why it is so?



-- 
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/groups/opt_out.


[web2py] Re: Unable to get the data, ajax fail with status is 200

2013-10-04 Thread Jayakumar Bellie
I found the error it is Error 206, Only partially of the data is received.

I have not found the solution yet. 

On Wednesday, September 25, 2013 7:36:21 PM UTC+5:30, Anthony wrote:

 Because jQuery is expecting a JSON response, if the returned data do not 
 parse to valid JSON, you will get an error (even with a 200 status). Can 
 you check the returned data in the failure cases and see if they are valid 
 JSON?

 Anthony

 On Wednesday, September 25, 2013 1:22:17 AM UTC-4, Jayakumar Bellie wrote:

 Hi,
 I have a function in controller 

 def get_data_content():
 message = []
 dateSel = str(request.vars.dateSel).replace(-,)
 tmp_file = /tmp/data/View + dateSel
 f = open(tmp_file, 'r')
 for lineContent in reversed(list(f)):
 lineMessage = {}
 lineMessage['data'] = unicode(lineContent, latin-1)
 message.append(lineMessage)
 return dict(records=message)


 I do an ajax call as follows

 $.ajax({
 url: get_data_content.json,
 type: POST,
 data: {
 dateSel: dateField
 }
 }).done(function( responseMsg ) {
 alert(responseMsg);
 }).fail(function( jqXHR, textStatus, errorMsg ) {
 if(jqXHR.status == 200) {
 alert(Unable to load the data, try again after some time.);
 } else {
 alert(Error :  + jqXHR.status +   + errorMsg);
 }
 });

 This work but not always.
 This fails dont know for some reason.
 I think and sure that the data is processed and sent to the client, but 
 on the client ajax it falls under *fail* state, because of that I am 
 not able to get the response message. I get an error message which is empty.



-- 
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/groups/opt_out.


[web2py] Web2py on apache2 is slow

2013-10-01 Thread Jayakumar Bellie
I have two servers, both are linux same configuration (OS and hardware).

I have a program running in PHP in one server and it is very fast is 
loading the data.

I have web2py running in an different server, it is very slow.

Why it is so?

-- 
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/groups/opt_out.


[web2py] Re: Permission check for a user in multiple groups

2013-09-24 Thread Jayakumar Bellie
We have the following

   - db.auth_user
   - db.auth_group
   - db.auth_membership
   - db.auth_permission
   
I have created few more tables

db.define_table(devices_config,
  Field(name, string, length=50, notnull=True),
  Field(device_type, string, length=5, notnull=True))

db.define_table(devices_membership,
  Field(devices_config_id, reference devices_config),
  Field(auth_group_id, reference auth_group))

We can have one user in multiple groups. 
We can have one device in multiple groups.
Each group can have different permission.
Many to many combination with 3 tables.
When the user login he should be assigned with his appropriate permission 
for each screen.


On Tuesday, September 24, 2013 12:14:43 AM UTC+5:30, Massimo Di Pierro 
wrote:

 Can you show us some of your code?

 On Thursday, 19 September 2013 00:13:59 UTC-5, Jayakumar Bellie wrote:

 Hi,
 I have groups with multiple permission.
 I have a user assigned to multiple groups.
 How to give access to user only for the groups they are assigned to.



-- 
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/groups/opt_out.


[web2py] Unable to get the data, ajax fail with status is 200

2013-09-24 Thread Jayakumar Bellie
Hi,
I have a function in controller 

def get_data_content():
message = []
dateSel = str(request.vars.dateSel).replace(-,)
tmp_file = /tmp/data/View + dateSel
f = open(tmp_file, 'r')
for lineContent in reversed(list(f)):
lineMessage = {}
lineMessage['data'] = unicode(lineContent, latin-1)
message.append(lineMessage)
return dict(records=message)


I do an ajax call as follows

$.ajax({
url: get_data_content.json,
type: POST,
data: {
dateSel: dateField
}
}).done(function( responseMsg ) {
alert(responseMsg);
}).fail(function( jqXHR, textStatus, errorMsg ) {
if(jqXHR.status == 200) {
alert(Unable to load the data, try again after some time.);
} else {
alert(Error :  + jqXHR.status +   + errorMsg);
}
});

This work but not always.
This fails dont know for some reason.
I think and sure that the data is processed and sent to the client, but on 
the client ajax it falls under *fail* state, because of that I am not 
able to get the response message. I get an error message which is empty.

-- 
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/groups/opt_out.


[web2py] How to create a gird without SQL

2013-09-23 Thread Jayakumar Bellie
Hi,
Is it possible to create a SQLForm.grid functionality without reading data 
from SQL.

I have a list or dict of data read from a file.
I want to create a grid with search and view functionality like SQLForm is 
it possible?

-- 
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/groups/opt_out.


Re: [web2py] Permission check for a user in multiple groups

2013-09-23 Thread Jayakumar Bellie
The user will be in multiple groups, in that case how to check for specific 
permission.

On Thursday, September 19, 2013 6:54:36 PM UTC+5:30, viniciusban wrote:

 Speaking in RBAC terms, you should check for permissions. 

 In your controller, something like: 
 @auth.has_permission(can_do_it) 
 def my_action(): 
# code goes from here... 



 On Thu, Sep 19, 2013 at 2:13 AM, Jayakumar Bellie 
 jkuma...@gmail.comjavascript: 
 wrote: 
  Hi, 
  I have groups with multiple permission. 
  I have a user assigned to multiple groups. 
  How to give access to user only for the groups they are assigned to. 
  
  -- 
  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+un...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 


-- 
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/groups/opt_out.


Re: [web2py] Permission check for a user in multiple groups

2013-09-23 Thread Jayakumar Bellie
Ya I did :( but it did not work.

On Monday, September 23, 2013 4:53:30 PM UTC+5:30, viniciusban wrote:

 Have you tried the way I suggested? 
 Didn't it work? 

 On Mon, Sep 23, 2013 at 6:50 AM, Jayakumar Bellie 
 jkuma...@gmail.comjavascript: 
 wrote: 
  The user will be in multiple groups, in that case how to check for 
 specific 
  permission. 
  
  
  On Thursday, September 19, 2013 6:54:36 PM UTC+5:30, viniciusban wrote: 
  
  Speaking in RBAC terms, you should check for permissions. 
  
  In your controller, something like: 
  @auth.has_permission(can_do_it) 
  def my_action(): 
 # code goes from here... 
  
  
  
  On Thu, Sep 19, 2013 at 2:13 AM, Jayakumar Bellie jkuma...@gmail.com 
  wrote: 
   Hi, 
   I have groups with multiple permission. 
   I have a user assigned to multiple groups. 
   How to give access to user only for the groups they are assigned to. 
   
   -- 
   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+un...@googlegroups.com. 
   For more options, visit https://groups.google.com/groups/opt_out. 
  
  -- 
  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+un...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 


-- 
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/groups/opt_out.


[web2py] Permission check for a user in multiple groups

2013-09-18 Thread Jayakumar Bellie
Hi,
I have groups with multiple permission.
I have a user assigned to multiple groups.
How to give access to user only for the groups they are assigned to.

-- 
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/groups/opt_out.


[web2py] Drop down not available for custom many to many relationship between tables

2013-08-07 Thread Jayakumar Bellie
Hi,
I have created a device_config table and wanted to create a many to many 
relationship between the device_config and auth_group

db.define_table(devices_membership,
  Field(devices_config_id, integer, db.devices_config),
  Field(auth_group_id, integer, db.auth_group))

I am looking for something like 

http://www.web2pyslices.com/slice/show/1542/manage-users-and-memebership-in-the-same-form

But when I give a devices_config table I am getting a text box rather 
than drop down with table details.

-- 

--- 
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/groups/opt_out.




[web2py] Re: Drop down not available for custom many to many relationship between tables

2013-08-07 Thread Jayakumar Bellie
Thanks it works.

On Wednesday, August 7, 2013 2:22:49 PM UTC+5:30, Niphlod wrote:

 use
 db.define_table(devices_membership,
   Field(devices_config_id, reference devices_config),
   Field(auth_group_id, reference auth_group)
 )

 that is the recommended way to specify references. you don't need to 
 specify the integer type, because a) any reference type (other than str 
 pkeys) is an integer b) you loose the default validator applied to 
 reference fields, that is a IS_IN_DB() that gets a dropdown in the html 
 representation


 On Wednesday, August 7, 2013 10:42:06 AM UTC+2, Jayakumar Bellie wrote:

 Hi,
 I have created a device_config table and wanted to create a many to 
 many relationship between the device_config and auth_group

 db.define_table(devices_membership,
   Field(devices_config_id, integer, db.devices_config),
   Field(auth_group_id, integer, db.auth_group))

 I am looking for something like 


 http://www.web2pyslices.com/slice/show/1542/manage-users-and-memebership-in-the-same-form

 But when I give a devices_config table I am getting a text box rather 
 than drop down with table details.



-- 

--- 
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/groups/opt_out.




[web2py] Re: web2py query filter with datatime field using between

2013-08-03 Thread Jayakumar Bellie
Ya your correct, this is supported. I have tried it. 
But wanted to check if between is supported.

On Saturday, August 3, 2013 11:35:16 AM UTC+5:30, Annet wrote:

 I don't think web2py supports 'between'. However, this works:

 (db.table.startDatetimedatetime1)(db.table.endDatetimedatetime2)


 Kind regards,

 Annet


-- 

--- 
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/groups/opt_out.




[web2py] web2py query filter with datatime field using between

2013-08-02 Thread Jayakumar Bellie
Hi,
Is there any way to filter datetime field using between in web2py?
I have not seen anything in the document or in the web. Have anyone tried 
it?
The only way I see is through executesql() function is there any other way?

-- 

--- 
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/groups/opt_out.




[web2py] KeyError: 1L in hash table

2013-06-16 Thread Jayakumar Bellie
I have to create a has table like
{ '1':'data1', '2':'data2', '10':'data3', '50':'data4' }

I get the data from the database, here is the code where I format the data

1dataTypeList = {}
2for row in result:
3   dataTypeList[row.number_indicator] = dataTypeList[row.data]

I get KeyError: 1L error in line 3

-- 

--- 
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/groups/opt_out.




[web2py] Re: KeyError: 1L in hash table

2013-06-16 Thread Jayakumar Bellie
It is a mistake made my me I dont know how did I miss it, very bad.

dataTypeList[row.number_indicator] = dataTypeList[row.data]

it should be 

dataTypeList[row.number_indicator] = row.data


On Sunday, June 16, 2013 1:21:15 PM UTC+5:30, Jayakumar Bellie wrote:

 I have to create a has table like
 { '1':'data1', '2':'data2', '10':'data3', '50':'data4' }

 I get the data from the database, here is the code where I format the data

 1dataTypeList = {}
 2for row in result:
 3   dataTypeList[row.number_indicator] = dataTypeList[row.data]

 I get KeyError: 1L error in line 3


-- 

--- 
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/groups/opt_out.