[web2py] Re: Why web2pyslices.com is down? What we can do?

2015-05-09 Thread Carlos Zenteno
Maybe maintenance???

On Saturday, May 9, 2015 at 4:54:51 AM UTC-5, Carlos A. Armenta Castro 
wrote:

 Im trying to acces web2pyslices.com but the site is down ( 
 http://downforeveryoneorjustme.com/web2pyslices.com ). Anyone knows the 
 reason? =(


-- 
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: how does search work on sql grid? (search over a whole table instead of a field)

2015-05-09 Thread Anthony
See https://groups.google.com/d/msg/web2py/WvGH9XAH160/TjzYVCDBzQ0J

Anthony

On Saturday, May 9, 2015 at 9:57:03 PM UTC-4, Kenneth wrote:


 I am curious how I can implement the search widget used on sql grid.

 It seems to me that sql grid searche widget searches a keword over a whole 
 table and show the result.

 Can anyone tell me how to create a search widget to search a keyword on a 
 table instead of selecting fields?

 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: Prince - Print Python Html to PDF

2015-05-09 Thread Kenneth
You can check out this post.

https://groups.google.com/forum/?fromgroups#!topic/web2py/B21c-PgscJg

On Monday, April 20, 2015 at 3:52:10 PM UTC-4, Ovidio Marinho wrote:


 Has anyone tried to use it with web2py?

 http://www.princexml.com/doc/9.0/python/



[image: http://itjp.net.br] http://itjp.net.br
  http://itjp.net.b http://itjp.net.brr
   *Ovidio Marinho Falcao Neto*
  ovid...@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] 3gp

2015-05-09 Thread Ovidio Marinho
Alguem ja rodou 3gp no web2py?

Good Night , someone already performed 3gp files?


   [image: http://itjp.net.br] http://itjp.net.br
 http://itjp.net.b http://itjp.net.brr
  *Ovidio Marinho Falcao Neto*
 ovidio...@gmail.com
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: Tutorial: Populating a Handsontable Grid using web2py

2015-05-09 Thread Kenneth
Look great, Tom.

Thank you for sharing. I wonder what we can implement with this instead of 
CRUD.

On Thursday, April 9, 2015 at 11:49:02 PM UTC-4, Tom Campbell wrote:

 Niphlod helped me with some crucial code getting Handsontable to work with 
 web2py so I wrote this: web2py Handsontable tutorial #1: Populating a 
 Handsontable grid using web2py 
 http://www.pyguy.com/web2py/web2py-handsontable-tutorial-1-populating-a-handsontable-grid-using-web2py/.
  
 It also shows a typical use of Crud. Please tear it apart and let me know 
 where I screwed up. 


-- 
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: Tutorial: Populating a Handsontable Grid using web2py

2015-05-09 Thread Tom Campbell
Done and done, Ken--another blog post floating in the wind. Fixed the CRUD 
thing and a few other items.

PyGuy web2py Handsontable tutorial #1: Populating a Handsontable grid using 
web2py 
http://www.pyguy.com/web2py/web2py-handsontable-tutorial-1-populating-a-handsontable-grid-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/d/optout.


[web2py] Re: Tutorial: Populating a Handsontable Grid using web2py

2015-05-09 Thread Ron Chatterjee
I tried to go to slice and its kind of sliced off instead of slides on. 
lol. Any ideas?

On Saturday, May 9, 2015 at 8:51:11 PM UTC-4, Kenneth wrote:

 Look great, Tom.

 Thank you for sharing. I wonder what we can implement with this instead of 
 CRUD.

 On Thursday, April 9, 2015 at 11:49:02 PM UTC-4, Tom Campbell wrote:

 Niphlod helped me with some crucial code getting Handsontable to work 
 with web2py so I wrote this: web2py Handsontable tutorial #1: Populating 
 a Handsontable grid using web2py 
 http://www.pyguy.com/web2py/web2py-handsontable-tutorial-1-populating-a-handsontable-grid-using-web2py/.
  
 It also shows a typical use of Crud. Please tear it apart and let me know 
 where I screwed up. 



-- 
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: Mongodb api reference

2015-05-09 Thread Ron Chatterjee
Saying, they can be used interchangeably if warranted. 

On Saturday, May 9, 2015 at 9:34:31 AM UTC-4, Alan Etkin wrote:

 Question: is there an equivalent 

 db().select(db.blog.author) in pymongo api? For example if I use the 
 above implementation in pymongo:

 db1.blog.author (wouldn’t work). But I can get specific author 
 db1.blog.find({‘author’:’Ron’}) That is also equivalent to:

 db(db.blog.author == ‘Ron’).select() #In DAL


 There cannot be any equivalent since pymongo can't output Rows resultsets 
 (web2py objects)
  

 So, there is two way to go about it. I know some of pymongo syntax 
 wouldn't apply to DAL as there are no sql equivalent to it. How is it the 
 other way around?


 What do you mean by how is it the other way around? web2py's DAL and 
 pymongo have different purposes


-- 
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: instagram login

2015-05-09 Thread Kenneth
This is what I've added on db.py. Hope this helps.

==

from instagram.client import InstagramAPI
access_token = access_token
client_secret= client_secret
client_id = client_id
redirect_uri = redirect_uri

auth = Auth(db)

auth_table = db.define_table(
auth.settings.table_user_name,
Field('fullname', 'string', default=),
Field('first_name', length=128,default=''),
Field('last_name', length=128,default=''),
Field('email', length=128,default=''),
Field('username', 'string', unique=True),
Field('user_bio', 'text', default=),
Field('website', 'string', default=),
Field('profile_picture', 'string', default=),
Field('instagram_id', 'string', unique=True),
Field('password', 'password', length=256, readable=False, 
label='Password'),
Field('access_token','string'),
Field('registration_id', length=128, default= , writable=False, 
readable=False))

auth_table.username.requires = IS_NOT_IN_DB(db, auth_table.username)
auth.define_tables()

class InstagramOauth():
def login_url(self, next=/):
from instagram import client
instagram_client = client.InstagramAPI(client_id= client_id, 
client_secret=client_secret, redirect_uri=redirect_uri)
return instagram_client.get_authorize_url(scope=[likes,comments])
 def get_user(self):
from instagram import client
instagram_client = client.InstagramAPI(client_id= client_id, 
client_secret=client_secret, redirect_uri=redirect_uri)
if request.vars.code:
code = request.vars.code
access_token, instagram_user = 
instagram_client.exchange_code_for_access_token(code)
return dict(username = instagram_user['username'],instagram_id = 
instagram_user['id'],user_bio=instagram_user['bio'],website = 
instagram_user['website'],profile_picture = 
instagram_user['profile_picture'],full_name=instagram_user['full_name'],registration_id
 
= instagram_user['id'],access_token=access_token)

auth.settings.login_form = InstagramOauth()

On Sunday, April 19, 2015 at 6:44:40 PM UTC-4, www.diazluis.com wrote:

 greetings,
 one could publish the adapted code
 to login on instagram?

 try to, but I overcame :(


 I do not have the ability to adapt
 oauth20_account.py to work with it:

 from instagram.client import InstagramAPI
 instagram_api = InstagramAPI(client_id=CLIENT_ID, 
 client_secret=CLIENT_SECRET, redirect_uri=REDIRECT_URI)
 auth.settings.login_url = instagram_api.get_authorize_login_url(scope = 
 'basic')

 instagram_code = request.vars.code or None

 if instagram_code:
 instagram_token, user_info = 
 instagram_api.exchange_code_for_access_token(code)



-- 
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] how does search work on sql grid? (search over a whole table instead of a field)

2015-05-09 Thread Kenneth

I am curious how I can implement the search widget used on sql grid.

It seems to me that sql grid searche widget searches a keword over a whole 
table and show the result.

Can anyone tell me how to create a search widget to search a keyword on a 
table instead of selecting fields?

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] SQLFORM.grid multiple left joins and where clause

2015-05-09 Thread A36_Marty
A few novice questions while learning the SQLFORM.grid on a throw-away app. 
  My apologies for the basic questions

*1) How to show all users (auth_user) and related group roles 
(auth_group.role) only for certain auth_groups?*

I can display *all* groups with the following code, but can't seem to 
figure out how to get the WHERE clause to SQLFORM.grid.

query = db.auth_user

fields = db.auth_user.first_name, db.auth_group.role

left = db.auth_user.on(
db.auth_user.id == 
db.auth_membership.user_id).db.auth_membership.on(
db.auth_membership.group_id == db.auth_group.id)

grid = SQLFORM.grid(query = query, left=left, fields=fields)

My failed attempts to get the WHERE clause inserted:

query = (db.auth_group.id == PARENT_GROUP_ID)  #No auth_user fields shown

query = (db.auth_user)(db.auth_group.id == PARENT_GROUP_ID)  #get query 
not supported error by the grid


*2) How to custom-format a column based on field values?*

In the above grid example, if an auth_group.role of Parent is returned, 
how can show something like a check mark (or any like boolean yes/no flag) 
and nothing for anything other auth_group.role values?


Thanks in advance.   A little nudge getting me through some the syntax 
learning curve is much appreciated.


-- 
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] Store Selected DB Data in Array

2015-05-09 Thread fuuby
Hello Everyone :)

I just startet using Web2Py and I currently work on a little project. 
Therefor I want to store the results from a sql request 
(SQLTABLE(db().select(something))) into an array (Each result into one 
array slot)
Like I said, I am very new to this and dont really know how to do it. Thank 
you in advance, and sorry for bad english

-- 
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 ldap

2015-05-09 Thread Matheus Suffi
Hello,
 have an ActiveDirectory Server and,
 I was wondering how to catch all user data and return the view , i can 
connect normally , just need to know how to get all user data 

-- 
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] Why web2pyslices.com is down? What we can do?

2015-05-09 Thread Carlos A. Armenta Castro
Im trying to acces web2pyslices.com but the site is down ( 
http://downforeveryoneorjustme.com/web2pyslices.com ). Anyone knows the 
reason? =(

-- 
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: web2pyslices down

2015-05-09 Thread Carlos A. Armenta Castro
Web2pysplices.com is on sale

I think we need to rescue Web2pysplices.com because is part of our web2py 
movement.

How can we help? any ideas?

El miércoles, 19 de junio de 2013, 3:51:26 (UTC-7), Johann Spies escribió:

 I get a 404 error (Not found) when I try to access web2pyslices.com

 Regards
 Johann

 -- 
 Because experiencing your loyal love is better than life itself, 
 my lips will praise you.  (Psalm 63:3)
  

-- 
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] MSSQL and auth.signature

2015-05-09 Thread Claudinei Fernandes
Hi,

Has anyone used auth.signature attribute with MSSQL database?
For me it is returning the following error:

class 'gluon.contrib.pypyodbc.ProgrammingError' (u'42000', u[42000] 
[Microsoft][ODBC SQL Server Driver][SQL Server]Introducing FOREIGN KEY 
constraint 'signature_test_modified_by__constraint' on table 
'signature_test' may cause cycles or multiple cascade paths. Specify ON 
DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY 
constraints.)

Can anyone help me please?

-- 
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] Store DB Data in Array

2015-05-09 Thread fuuby
Hello Everyone :)

I just startet using Web2py and currently I am working on a little project. 
Therefor I want to store data I selected with a 
SQLTABLE(db().select(something)) from my database into a array (each result 
into a seperate array slot). 
Like I said, I am new to this and dont really know how to tackle this. 
Thank you for your help, sorry for bad english

-- 
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] Mongodb api reference

2015-05-09 Thread Alan Etkin

I'm bringing to the list some new user's questions

It will b nice to document all the DAL syntax n equivalent pymongo api.


Not sure what he meant, but documenting the pymongo api makes little sense 
(it is already documented by the authors). IMO we should instead document 
the way of accessing the adapter connection to use the pymongo api commands 
or any adapter (maybe it is already documented).
 

 N all the DAL doesnt apply to pymongo n added pymongo features.  Just 
 saying:)


DAL only uses pymongo features required by the DAL api itself, but there's 
no equivalent command between the lower level api and DAL.

It will b nice to document all the DAL syntax n equivalent pymongo api. N 
 all the DAL doesnt apply to pymongo n added pymongo features.


mongodb adapter is not meant to include or extend pymongo api commands, it 
is a high level interface for mongodb databases in web2py apps

-- 
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] web2py ldap

2015-05-09 Thread Massimiliano
It's a question related to ldap not to web2py...
Anyway this should work. Teste on openldap I can't try AD:

import ldap

LDAP_URI = ldap://127.0.0.1:389;
SEARCH_BASE = ou=users, dc=domain,dc=lan
QUERY = 'cn=*'

try:
  l = ldap.initialize(LDAP_URI)
  l.protocol_version = ldap.VERSION3

  search_scope = ldap.SCOPE_SUBTREE
  retrieve_attributes = None

  ldap_result_id = l.search(
SEARCH_BASE,
search_scope,
QUERY,
retrieve_attributes
  )
  result_set = []
  while 1:
result_type, result_data = l.result(ldap_result_id, 0)
if (result_data == []):
  break
else:
  if result_type == ldap.RES_SEARCH_ENTRY:
result_set.append(result_data)

  print result_data

except ldap.LDAPError, e:
  print('LDAPError: %s.' % e)

finally:
  l.unbind_s()




On Thu, May 7, 2015 at 8:53 PM, Matheus Suffi matheus.suff...@gmail.com
wrote:

 Hello,
  have an ActiveDirectory Server and,
  I was wondering how to catch all user data and return the view , i can
 connect normally , just need to know how to get all user data

 --
 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.




-- 
Massimiliano

-- 
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] Another kind of conditional models, maybe?

2015-05-09 Thread Octavian G
Hello,

 I'd like to get the community's opinion about a design pattern. I have 
about 35 tables at the moment. I'm not happy with the performance, yet. I 
plan to use memcache extensively. Right now, here's how things are set up:

1. Controllers create a variables dict to pass to views. 

Ex: stages.py (the controller)

2. The functions to populate the variables dict are in modules. 

Ex: stage_list(variables)

3. The stage_list(variables) function imports a cache_get_stage_list 
function (from a different module) that checks the memcache and either gets 
a cached list or asks the db for one.

My question is: since I plan to cache everything, would it be ok / good / 
bad performance wise to only import the database models inside the 
cache_get_* functions ? If I decide to do it this way, the cache_get_* 
types of functions would be the only places where the db is queried, so 
it's only there that the models are needed, and even then, only if the 
cache is missing.

P.S. I'm only talking about the read part in the CRUD model.

-- 
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: Mongodb api reference

2015-05-09 Thread Ron Chatterjee


On this note: I have this blog post let’s say (with mongodb connection):

db.define_table('blog',

Field('author', 'string', requires = IS_NOT_EMPTY()),

Field('date', 'datetime', default = request.now),

Field('text', 'text'))

 

I can do: print db().select(db.blog.author) - This will give me all the 
author in the post

I can also use mongodb api to interchangeably:

import pymongo

from pymongo import MongoClient

client = MongoClient()

client = MongoClient('localhost', 27017)

db1= client.foo #lets say foo is my database name

db1.blog.find_one() #here blog is my collection and I want the first 
document

Out[3]: 

{u'_id': ObjectId('55498fe02514971894c70538'),

 u'author': u'Ron',

 u'date': datetime.datetime(2015, 5, 5, 23, 51, 48),
 
 u'text': u'This is my question'}
 
Question: is there an equivalent 

db().select(db.blog.author) in pymongo api? For example if I use the above 
implementation in pymongo:

db1.blog.author (wouldn’t work). But I can get specific author 
db1.blog.find({‘author’:’Ron’}) That is also equivalent to:

db(db.blog.author == ‘Ron’).select()

So, there is two way to go about it. I know some of pymongo syntax wouldn't 
apply to DAL as there are no sql equivalent to it. How is it the other way 
around?

On Saturday, May 9, 2015 at 6:27:28 AM UTC-4, Alan Etkin wrote:


 I'm bringing to the list some new user's questions

 It will b nice to document all the DAL syntax n equivalent pymongo api.


 Not sure what he meant, but documenting the pymongo api makes little sense 
 (it is already documented by the authors). IMO we should instead document 
 the way of accessing the adapter connection to use the pymongo api commands 
 or any adapter (maybe it is already documented).
  

 N all the DAL doesnt apply to pymongo n added pymongo features.  Just 
 saying:)


 DAL only uses pymongo features required by the DAL api itself, but there's 
 no equivalent command between the lower level api and DAL.
 mongodb adapter is not meant to include or extend pymongo api commands, it 
 is a high level interface for mongodb databases in web2py apps



-- 
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: from desktop to web2py

2015-05-09 Thread Marcello Console
Thank you again Stifan.
I solved the poresent problem, but i suppose in a not efficiente and
even les elegant way...
The second form, should be in the the second view, am i right?
To face, i need to change the in memory db to oon disk, and working
with apache configuration for let me pass all the variables.
Thanks again

2015-05-09 2:15 GMT+02:00, 黄祥 steve.van.chris...@gmail.com:
 just an idea, i think you need 2 form, 1 for the upload file and store the
 value into session, and put it on another form, using requires =
 IS_IN_SET()
 *e.g. not tested*
 *create your 1st form and store the value of uploaded file into session*
 a = open(form.vars.upload_file, 'wb').write(session.upload_file)

 *create another form that requires IS_IN_SET from the stored session*
 Field('choose_excel', requires=IS_IN_SET(for id, value from
 session.upload_file) ),

 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/c247sPk5ALU/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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Store Selected DB Data in Array

2015-05-09 Thread 黄祥
perhaps you can use session for store the db data query
ref:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#as_dict-and-as_list

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.


Re: [web2py] Re: Creating a grid based on queries pertaining to a primary db table, and a table that references it

2015-05-09 Thread Massimiliano
Maybe something like that?

db.define_table('person', Field('first_name'), Field('last_name'),
format='%(first_name)s')
db.define_table('thing', Field('name'),
 Field('owner_id', 'reference person'),
 format='%(name)s')

t = db.thing
p = db.person

fields = [p.first_name, p.last_name]

q = ((t.owner_id == p.id)  (t.name == 'chair'))
ids_people_with_chair = [a.id for a in db(q).select(p.id)]

query = (t.owner_id == p.id)
query = query  (t.owner_id.belongs(ids_people_with_chair))
query = query  (t.name == 'table')

print db(query).select(*fields, distinct=True, orderby=p.first_name)



On Fri, May 8, 2015 at 10:49 PM, Spokes spokes8...@gmail.com wrote:

 Hi, Dave. Yes, that seems to be an accurate summary of what I was
 attempting to do.



 On Friday, May 8, 2015 at 3:25:24 PM UTC-5, Dave S wrote:



 On Friday, May 8, 2015 at 11:55:13 AM UTC-7, Spokes wrote:

 I'd like to create a grid based on criteria relating to a primary table,
 and a table that references that primary table. Slightly modifying the
 example from the web2py docs, let's say the primary table is 't_person',
 and it's referenced by the table, 't_thing'. I'd like the grid to list
 't_person' entries that are referenced by a 't_thing' entry with a value
 'table' for the 'name' field, and by a 't_thing' entry with value 'chair'
 for the name field (that is, entries that meet both criteria, not one or
 the other).


 Let's see if I understand this.  You want to use the set A of t_things
 that have value 'table'  and the set B of t_things that have value 'chair'
 and find those members of t_person that are referenced by both sets?  Sort
 of for a in A where a.owner_id == b.owner_id for b in B, select p from
 t_person where p.id == a.owner_id ?

 /dps

  --
 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.




-- 
Massimiliano

-- 
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: Mongodb api reference

2015-05-09 Thread Alan Etkin
Question: is there an equivalent 

 db().select(db.blog.author) in pymongo api? For example if I use the above 
 implementation in pymongo:

 db1.blog.author (wouldn’t work). But I can get specific author 
 db1.blog.find({‘author’:’Ron’}) That is also equivalent to:

 db(db.blog.author == ‘Ron’).select() #In DAL


There cannot be any equivalent since pymongo can't output Rows resultsets 
(web2py objects)
 

 So, there is two way to go about it. I know some of pymongo syntax 
 wouldn't apply to DAL as there are no sql equivalent to it. How is it the 
 other way around?


What do you mean by how is it the other way around? web2py's DAL and 
pymongo have different purposes

-- 
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: web2pyslices down

2015-05-09 Thread Michael Beller
In the meantime ... http://web2pyslices.pythonanywhere.com/

-- 
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: MSSQL and auth.signature

2015-05-09 Thread Paolo Valleri
that's odd. Can you open an issue on github 
(https://github.com/web2py/pydal/issues) with a simple example to reproduce 
it? I'll have a look in the next few days

Paolo

On Saturday, May 9, 2015 at 11:54:30 AM UTC+2, Claudinei Fernandes wrote:

 Hi,

 Has anyone used auth.signature attribute with MSSQL database?
 For me it is returning the following error:

 class 'gluon.contrib.pypyodbc.ProgrammingError' (u'42000', u[42000] 
 [Microsoft][ODBC SQL Server Driver][SQL Server]Introducing FOREIGN KEY 
 constraint 'signature_test_modified_by__constraint' on table 
 'signature_test' may cause cycles or multiple cascade paths. Specify ON 
 DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY 
 constraints.)

 Can anyone help me please?


-- 
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: Creating a grid based on queries pertaining to a primary db table, and a table that references it

2015-05-09 Thread Spokes
Thanks, Massimiliano. I was also considering an approach involving creating 
a list of IDs from the 'thing' table, but I'm not sure that this would be 
feasible in this case. They may be tens, possibly hundreds of IDs 
corresponding to the given criteria, and the grid based on these queries is 
part of the site's front page (i.e. it will be generated very often), so 
I'm not sure that this approach is necessarily efficient enough. I can't 
help thinking that there's a more straightforward and efficient way to 
accomplish this task.


On Saturday, May 9, 2015 at 8:14:51 AM UTC-5, Massimiliano wrote:

 Maybe something like that?

 db.define_table('person', Field('first_name'), Field('last_name'), 
 format='%(first_name)s')
 db.define_table('thing', Field('name'), 
  Field('owner_id', 'reference person'), 
  format='%(name)s')

 t = db.thing
 p = db.person

 fields = [p.first_name, p.last_name]

 q = ((t.owner_id == p.id)  (t.name == 'chair'))
 ids_people_with_chair = [a.id for a in db(q).select(p.id)]

 query = (t.owner_id == p.id)
 query = query  (t.owner_id.belongs(ids_people_with_chair))
 query = query  (t.name == 'table')

 print db(query).select(*fields, distinct=True, orderby=p.first_name)



 On Fri, May 8, 2015 at 10:49 PM, Spokes spoke...@gmail.com javascript: 
 wrote:

 Hi, Dave. Yes, that seems to be an accurate summary of what I was 
 attempting to do.



 On Friday, May 8, 2015 at 3:25:24 PM UTC-5, Dave S wrote:



 On Friday, May 8, 2015 at 11:55:13 AM UTC-7, Spokes wrote:

 I'd like to create a grid based on criteria relating to a primary 
 table, and a table that references that primary table. Slightly modifying 
 the example from the web2py docs, let's say the primary table is 
 't_person', and it's referenced by the table, 't_thing'. I'd like the grid 
 to list 't_person' entries that are referenced by a 't_thing' entry with a 
 value 'table' for the 'name' field, and by a 't_thing' entry with value 
 'chair' for the name field (that is, entries that meet both criteria, not 
 one or the other). 


 Let's see if I understand this.  You want to use the set A of t_things 
 that have value 'table'  and the set B of t_things that have value 'chair' 
 and find those members of t_person that are referenced by both sets?  Sort 
 of for a in A where a.owner_id == b.owner_id for b in B, select p from 
 t_person where p.id == a.owner_id ?

 /dps

  -- 
 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/d/optout.




 -- 
 Massimiliano
  

-- 
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.