[web2py] Re: not web2py question - test timezone detection

2015-02-25 Thread Mirek Zvolský
Hi,
maybe I don't understand how web2py handles a situation, when some python 
module is required by the web2py plugin.
I think, web2py cannot recognize it as part of the plugin (because of name 
not starting with plugin_...) or I can rename it (and have to identical 
files with standard and non-standard name).
Or is here some solution?




Dne úterý 24. února 2015 21:31:51 UTC+1 Niphlod napsal(a):
>
> I don't see any cons in the actual naming conventions, and frankly, no 
> pros on the one you're suggesting...granted, web2py plugins won't work with 
> django, but the same applies for django packages: they don't work on 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: not web2py question - test timezone detection

2015-02-25 Thread Mirek Zvolský
and have TWO identical...

Dne středa 25. února 2015 9:32:26 UTC+1 Mirek Zvolský napsal(a):
>
> Hi,
> maybe I don't understand how web2py handles a situation, when some python 
> module is required by the web2py plugin.
> I think, web2py cannot recognize it as part of the plugin (because of name 
> not starting with plugin_...) or I can rename it (and have to identical 
> files with standard and non-standard name).
> Or is here some solution?
>
>
>
>
> Dne úterý 24. února 2015 21:31:51 UTC+1 Niphlod napsal(a):
>>
>> I don't see any cons in the actual naming conventions, and frankly, no 
>> pros on the one you're suggesting...granted, web2py plugins won't work with 
>> django, but the same applies for django packages: they don't work on 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] auth_user uppercase

2015-02-25 Thread Gael Princivalle
Hello.

In my db I have this discounts table:
db.define_table('discounts',
Field('user_id', 'reference auth_user'),
Field('brand', 'reference brands', requires = IS_IN_DB(db, 
db.brands.id, '%(name)s'),
  represent=lambda id, r: db.brands[id].name),
Field('xcent', type='double'))

I would like to display the name and first name of the auth_user uppercase.
Something like that:
Field('user_id', 'reference auth_user', requires = IS_IN_DB(db, 
db.auth_user.id, '%(first_name.upper())s %(last_name.upper())s')),
But I've got this error:
'Row' object has no attribute 'upper()'

I've tried also like that, str(first_name).upper(), same error.

Someone have a solution?

Thanks, regards.

-- 
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] Query string lost when redirecting through routes.py

2015-02-25 Thread Louis Amon
Hello,

I'm trying to map this URL 
: localhost:8000/annonces?lat=48.8610181&lng=2.3140934&locality=Paris
To this : localhost:8000/s/paris

(Full-text search hurrayyy)


I'm using the pattern-based routes.py to do that :

routes_in =[...

('/annonces', '301->/s'),
]

But when I try to reach the URL above, I get redirected to 
"localhost:8000/s" with no query string (no request.vars).

This is the rewrite log I get:

routes_app: [127.0.0.1:http://localhost:get /annonces] [jestocke] -> 
jestocke

select routing parameters: jestocke

routes_in: [127.0.0.1:http://localhost:get /annonces] [301->/s\g] 
-> 301->/s

routes_app: [127.0.0.1:http://localhost:get /s] [jestocke] -> jestocke

select routing parameters: jestocke

routes_in: [127.0.0.1:http://localhost:get /s] [/jestocke/offer/search] -> 
/jestocke/offer/search


Am I missing something there ?

-- 
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] Routes pattern and args / query strings

2015-02-25 Thread Louis Amon
I'm opening this thread to discuss pattern-based routing and especially the 
handling of args and vars in an incoming URL.


Based on the doc, you can use a simplified syntax in pattern-based routes 
to avoid struggling with regular expressions:

('/new_name/$anything', '/app/controller/function$anything')

If you do so however, the URL */new_name/args* would be reachable but 
*/new_name* wouldn't and neither would */new_name?this=that*.

One solution I found to this problem is to write instead:

('/s$anything', '/myapp/default/search$anything')

(notice there is no */* before the *$*)

I changed *new_name* to *s* in order to illustrate another issue : if you 
use *$anything* like I just did, you might have conflicts between URLs 
depending on where in the list (routes_in) your put this specific rule.

For instance, routing */static* would be problematic with a */s$anything* 
rule.


In fact, what you really need to route is much less than */s$anything*. As 
far as I can see there are 4 cases:
1. /s
2. /s?vars
3. /s/args
4. /s/args?vars

I guess writing explicity these 4 rules would do the trick much better than 
*/s$anything*, thus avoiding the conflict with /static... but it could also 
become very bulky if you have to write 4 rules for each URL.


Is there a clean way to do this using the pattern-based system ?

-- 
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: Routes pattern and args / query strings

2015-02-25 Thread Anthony
In some cases, $anything isn't powerful enough, and you need to use regular 
expressions.

Anyway, the rules are processed in order, so you should be able to include 
a rule mapping static to static, and then include the /s$anything rule 
(which won't be matched to "static" because the static rule will already 
have matched).

Anthony

On Wednesday, February 25, 2015 at 6:18:02 AM UTC-5, Louis Amon wrote:
>
> I'm opening this thread to discuss pattern-based routing and especially 
> the handling of args and vars in an incoming URL.
>
>
> Based on the doc, you can use a simplified syntax in pattern-based routes 
> to avoid struggling with regular expressions:
>
> ('/new_name/$anything', '/app/controller/function$anything')
>
> If you do so however, the URL */new_name/args* would be reachable but 
> */new_name* wouldn't and neither would */new_name?this=that*.
>
> One solution I found to this problem is to write instead:
>
> ('/s$anything', '/myapp/default/search$anything')
>
> (notice there is no */* before the *$*)
>
> I changed *new_name* to *s* in order to illustrate another issue : if you 
> use *$anything* like I just did, you might have conflicts between URLs 
> depending on where in the list (routes_in) your put this specific rule.
>
> For instance, routing */static* would be problematic with a */s$anything* 
> rule.
>
>
> In fact, what you really need to route is much less than */s$anything*. 
> As far as I can see there are 4 cases:
> 1. /s
> 2. /s?vars
> 3. /s/args
> 4. /s/args?vars
>
> I guess writing explicity these 4 rules would do the trick much better 
> than */s$anything*, thus avoiding the conflict with /static... but it 
> could also become very bulky if you have to write 4 rules for each URL.
>
>
> Is there a clean way to do this using the pattern-based system ?
>
>

-- 
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: Query string lost when redirecting through routes.py

2015-02-25 Thread Anthony
You need to match and copy the query string explicitly:

('/annonces$query', '301->/s$query')

On Wednesday, February 25, 2015 at 6:00:09 AM UTC-5, Louis Amon wrote:
>
> Hello,
>
> I'm trying to map this URL 
> : localhost:8000/annonces?lat=48.8610181&lng=2.3140934&locality=Paris
> To this : localhost:8000/s/paris
>
> (Full-text search hurrayyy)
>
>
> I'm using the pattern-based routes.py to do that :
>
> routes_in =[...
>
> ('/annonces', '301->/s'),
> ]
>
> But when I try to reach the URL above, I get redirected to 
> "localhost:8000/s" with no query string (no request.vars).
>
> This is the rewrite log I get:
>
> routes_app: [127.0.0.1:http://localhost:get /annonces] [jestocke] -> 
> jestocke
>
> select routing parameters: jestocke
>
> routes_in: [127.0.0.1:http://localhost:get /annonces] 
> [301->/s\g] -> 301->/s
>
> routes_app: [127.0.0.1:http://localhost:get /s] [jestocke] -> jestocke
>
> select routing parameters: jestocke
>
> routes_in: [127.0.0.1:http://localhost:get /s] [/jestocke/offer/search] -> 
> /jestocke/offer/search
>
>
> Am I missing something there ?
>

-- 
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: auth_user uppercase

2015-02-25 Thread Anthony
The third argument to IS_IN_DB is the label argument, which can either be 
Python string formatting (to which the Row object will be passed) or a 
function that takes a Row object. You cannot use arbitrary Python code 
inside Python string formatting. Try:

IS_IN_DB(db, db.auth_user.id,
 lambda r: '%s %s' % (r.first_name.upper(), r.last_name.upper()))

Anthony


On Wednesday, February 25, 2015 at 4:19:29 AM UTC-5, Gael Princivalle wrote:
>
> Hello.
>
> In my db I have this discounts table:
> db.define_table('discounts',
> Field('user_id', 'reference auth_user'),
> Field('brand', 'reference brands', requires = IS_IN_DB(db, 
> db.brands.id, '%(name)s'),
>   represent=lambda id, r: db.brands[id].name),
> Field('xcent', type='double'))
>
> I would like to display the name and first name of the auth_user uppercase.
> Something like that:
> Field('user_id', 'reference auth_user', requires = IS_IN_DB(db, 
> db.auth_user.id, '%(first_name.upper())s %(last_name.upper())s')),
> But I've got this error:
> 'Row' object has no attribute 'upper()'
>
> I've tried also like that, str(first_name).upper(), same error.
>
> Someone have a solution?
>
> Thanks, regards.
>
>

-- 
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: cache.disk.clear() crashes in appadmin

2015-02-25 Thread Leonel Câmara
Hey Robin,

This was my fix for this issue
https://github.com/web2py/web2py/commit/9d4b2e66c4736c218033e8be70d135cdf0fc718f

If you show me some code I can try to solve your issue.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: cache.disk stores mysql password in a path visible to all!

2015-02-25 Thread Leonel Câmara
Yes you can Robin, it's basically just making sure the key is always hashed.

-- 
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] Routes pattern and args / query strings

2015-02-25 Thread Louis Amon
> Anyway, the rules are processed in order, so you should be able to include a 
> rule mapping static to static, and then include the /s$anything rule (which 
> won't be matched to "static" because the static rule will already have 
> matched).


That’s actually what I ended up doing, but it isn’t something you can rely on 
in a big project…

> In some cases, $anything isn't powerful enough, and you need to use regular 
> expressions.

I was hoping there would be an alternative, but I guess regular expressions are 
indeed the only option to do things properly.



> Le 25 févr. 2015 à 13:03, Anthony  a écrit :
> 
> In some cases, $anything isn't powerful enough, and you need to use regular 
> expressions.
> 
> Anyway, the rules are processed in order, so you should be able to include a 
> rule mapping static to static, and then include the /s$anything rule (which 
> won't be matched to "static" because the static rule will already have 
> matched).
> 
> Anthony
> 
> On Wednesday, February 25, 2015 at 6:18:02 AM UTC-5, Louis Amon wrote:
> I'm opening this thread to discuss pattern-based routing and especially the 
> handling of args and vars in an incoming URL.
> 
> 
> Based on the doc, you can use a simplified syntax in pattern-based routes to 
> avoid struggling with regular expressions:
> ('/new_name/$anything', '/app/controller/function$anything')
> If you do so however, the URL /new_name/args would be reachable but /new_name 
> wouldn't and neither would /new_name?this=that.
> 
> One solution I found to this problem is to write instead:
> ('/s$anything', '/myapp/default/search$anything')
> (notice there is no / before the $)
> 
> I changed new_name to s in order to illustrate another issue : if you use 
> $anything like I just did, you might have conflicts between URLs depending on 
> where in the list (routes_in) your put this specific rule.
> 
> For instance, routing /static would be problematic with a /s$anything rule.
> 
> 
> In fact, what you really need to route is much less than /s$anything. As far 
> as I can see there are 4 cases:
> 1. /s
> 2. /s?vars
> 3. /s/args
> 4. /s/args?vars
> 
> I guess writing explicity these 4 rules would do the trick much better than 
> /s$anything, thus avoiding the conflict with /static... but it could also 
> become very bulky if you have to write 4 rules for each URL.
> 
> 
> Is there a clean way to do this using the pattern-based system ?
> 
> 
> -- 
> 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/sMPkRPjZWrg/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.


Re: [web2py] Query string lost when redirecting through routes.py

2015-02-25 Thread Louis Amon
That’s odd.

I put exactly the rule you proposed but the URL 
(http://localhost:8000/annonces?lat=48.8610181&lng=2.3140934&locality=Paris) 
ended up not being matched at all.

Log statement:
routes_in: [127.0.0.1:http://localhost:get /annonces] -> /annonces (not 
rewritten)

> Le 25 févr. 2015 à 13:07, Anthony  a écrit :
> 
> You need to match and copy the query string explicitly:
> 
> ('/annonces$query', '301->/s$query')
> 
> On Wednesday, February 25, 2015 at 6:00:09 AM UTC-5, Louis Amon wrote:
> Hello,
> 
> I'm trying to map this URL : 
> localhost:8000/annonces?lat=48.8610181&lng=2.3140934&locality=Paris
> To this : localhost:8000/s/paris
> 
> (Full-text search hurrayyy)
> 
> 
> I'm using the pattern-based routes.py to do that :
> 
> routes_in =[...
> ('/annonces', '301->/s'),
> ]
> 
> 
> But when I try to reach the URL above, I get redirected to "localhost:8000/s" 
> with no query string (no request.vars).
> 
> This is the rewrite log I get:
> routes_app: [127.0.0.1:http://localhost:get /annonces] [jestocke] -> jestocke
> 
> select routing parameters: jestocke
> 
> routes_in: [127.0.0.1:http://localhost:get /annonces] [301->/s\g] 
> -> 301->/s
> 
> routes_app: [127.0.0.1:http://localhost:get /s] [jestocke] -> jestocke
> 
> select routing parameters: jestocke
> 
> routes_in: [127.0.0.1:http://localhost:get /s] [/jestocke/offer/search] -> 
> /jestocke/offer/search
> 
> 
> Am I missing something there ?
> 
> -- 
> 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/g1oVFepFQ5o/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: auth_user uppercase

2015-02-25 Thread Gael Princivalle
Thanks Anthony.

But if I replacing my code with your suggested code I have crashed the 
table:
discounts.table appears corrupted

db.define_table('discounts',
Field('user_id', 'reference auth_user', requires = IS_IN_DB(
db, db.auth_user.id,
lambda r: '%s %s' % (r.first_name.upper(), r.last_name.
upper(,
Field('brand', 'reference brands', requires = IS_IN_DB(db, 
db.brands.id, '%(name)s'),
  represent=lambda id, r: db.brands[id].name),
Field('xcent', type='double'))

Any idea?

Il giorno mercoledì 25 febbraio 2015 13:12:50 UTC+1, Anthony ha scritto:
>
> The third argument to IS_IN_DB is the label argument, which can either be 
> Python string formatting (to which the Row object will be passed) or a 
> function that takes a Row object. You cannot use arbitrary Python code 
> inside Python string formatting. Try:
>
> IS_IN_DB(db, db.auth_user.id,
>  lambda r: '%s %s' % (r.first_name.upper(), r.last_name.upper()))
>
> Anthony
>
>
> On Wednesday, February 25, 2015 at 4:19:29 AM UTC-5, Gael Princivalle 
> wrote:
>>
>> Hello.
>>
>> In my db I have this discounts table:
>> db.define_table('discounts',
>> Field('user_id', 'reference auth_user'),
>> Field('brand', 'reference brands', requires = IS_IN_DB(db
>> , db.brands.id, '%(name)s'),
>>   represent=lambda id, r: db.brands[id].name),
>> Field('xcent', type='double'))
>>
>> I would like to display the name and first name of the auth_user 
>> uppercase.
>> Something like that:
>> Field('user_id', 'reference auth_user', requires = IS_IN_DB(db, 
>> db.auth_user.id, '%(first_name.upper())s %(last_name.upper())s')),
>> But I've got this error:
>> 'Row' object has no attribute 'upper()'
>>
>> I've tried also like that, str(first_name).upper(), same error.
>>
>> Someone have a solution?
>>
>> Thanks, regards.
>>
>>

-- 
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: Modifying "A" helper callback behavior

2015-02-25 Thread Leonel Câmara
Fix:
https://github.com/web2py/web2py/pull/821

-- 
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: confirm

2015-02-25 Thread JorgeH
I mean, 
in one line you are saying that the object 'form' equals  a class function  
SQLFORM.grid

an object must be equal to a class

Ex
form = SQLFORM



thus.
form = SQLFORM.onefunction .() 
doesn't make sense.


Now, in regard to your main question, check this out:

http://web2py.com/books/default/chapter/29/11/jquery-and-ajax#Confirmation-on-delete
 



On Tuesday, February 24, 2015 at 10:27:56 PM UTC-5, Alex Glaros wrote:
>
> is a social network app.  Form asks user to accept, reject, or block 
> member who is seeking to connect with other member.
>
> want "are you sure?" in case user accidentally chooses an unintended 
> selection
>
> thanks
>
> Alex 
>

-- 
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: rewrite the controller function for clarity

2015-02-25 Thread Leonel Câmara
There's nothing wrong with that code. You may want to do additional checks 
on request.args(0), for instance making sure it's an int with 
request.args(0, cast=int) and even that it's an id of a category that 
actually exists (which you may want to use to inform the user why he isn't 
getting any results). Otherwise it's perfectly fine to do it that way.

-- 
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: rewrite the controller function for clarity

2015-02-25 Thread Ron Chatterjee
R u in the states? Looking for work?
On Feb 25, 2015 8:58 AM, "Leonel Câmara"  wrote:

> There's nothing wrong with that code. You may want to do additional checks
> on request.args(0), for instance making sure it's an int with
> request.args(0, cast=int) and even that it's an id of a category that
> actually exists (which you may want to use to inform the user why he isn't
> getting any results). Otherwise it's perfectly fine to do it that way.
>
> --
> 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/jUQ8G3GCdBw/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: importing .csv to create DAL object

2015-02-25 Thread Abhijit Chatterjee
I haven't tried to code yet. But if I have .sql file. How to import.

-- 
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] PDF view - set printing page size

2015-02-25 Thread José Luis Redrejo
2015-02-24 14:36 GMT+01:00 Pavel :

> Really thanks José,
> your "labels" app help me with understanding fpdf. My apps is working now.
>


You're welcome

> "Little" problem is unicode characters. I tried examples from fpdf wiki
> pages, but without success.
> Fortunately all dynamic fields on our ID cars is numbers and characters
> without accent.
>

Yes, all of us who don't live in english spoken countries share the same
problem.
There are two solutions for this issue, depending on the charset you need.

The easy one is executing:

import sys
reload(sys)
sys.setdefaultencoding("latin-1")

In the function you are generating the pdf. This works for me with accents
or spanish ñ.


But, if there are some chars not available in latin-1 encoding (like the
european currency €) the second solution is loading a true type font:

As an example:
import sys

reload(sys)
sys.setdefaultencoding("utf-8")

pdf.add_font('DejaVu', '',os.path.join(request.folder,'static',
'DejaVuSansCondensed.ttf'), uni=True)

This should work like a charm (if you leave the file
DejaVuSansCondensed.ttf  in the static folder of your application)


Regards
José L.



>
> Thanks
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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: not web2py question - test timezone detection

2015-02-25 Thread Niphlod
if a module is required, it is imported. if it's in two places, the same 
thing applies. why should it be an issue ?

On Wednesday, February 25, 2015 at 9:33:35 AM UTC+1, Mirek Zvolský wrote:
>
> and have TWO identical...
>
> Dne středa 25. února 2015 9:32:26 UTC+1 Mirek Zvolský napsal(a):
>>
>> Hi,
>> maybe I don't understand how web2py handles a situation, when some python 
>> module is required by the web2py plugin.
>> I think, web2py cannot recognize it as part of the plugin (because of 
>> name not starting with plugin_...) or I can rename it (and have to 
>> identical files with standard and non-standard name).
>> Or is here some solution?
>>
>>
>>
>>
>> Dne úterý 24. února 2015 21:31:51 UTC+1 Niphlod napsal(a):
>>>
>>> I don't see any cons in the actual naming conventions, and frankly, no 
>>> pros on the one you're suggesting...granted, web2py plugins won't work with 
>>> django, but the same applies for django packages: they don't work on 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: importing .csv to create DAL object

2015-02-25 Thread Niphlod
by hand.

On Wednesday, February 25, 2015 at 4:29:52 PM UTC+1, Abhijit Chatterjee 
wrote:
>
> I haven't tried to code yet. But if I have .sql file. How to import.

-- 
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: rewrite the controller function for clarity

2015-02-25 Thread Leonel Câmara
Portugal :)

-- 
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: rewrite the controller function for clarity

2015-02-25 Thread Ron Chatterjee
Thats cool. I was telling massimo that I have some ideas. Would b nice to
network if something does spin off.
On Feb 25, 2015 11:03 AM, "Leonel Câmara"  wrote:

> Portugal :)
>
> --
> 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/jUQ8G3GCdBw/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: Create many similar forms on one page

2015-02-25 Thread niki
I think i get components now. Each .load function should be linked to a 
unique database table inorder to see different posts for different sections.
Hopefully that is not the longer solution :)

It works superb now.

Thanks really for all the help.
On Tuesday, 24 February 2015 19:08:12 UTC+2, 黄祥 wrote:
>
> The LOad components is really helpful. However i seem to be loading the 
>> same form in all my sections. 
>>
>
> yes you are right. taken from book it said (components) :
> build modular applications that minimize server load and maximize code 
> reuse
>  
>
>> Can you perhaps help me out if you have tried this before. I can see that 
>> the database does not even assign the comments to a certain form.
>> How can i ensure each comment is associated with a form. 
>>
>
> i think the form is for input the table comment_post
> def post():
> return dict(*form=SQLFORM(db.comment_post).process()*,
> comments=db(db.comment_post).select())
>

-- 
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: rewrite the controller function for clarity

2015-02-25 Thread Leonel Câmara
Sure, I'm willing to help with what I can do remotely.

-- 
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] Reset Password Not Working in Production

2015-02-25 Thread Neil Oswald
Hi,

Good day!

After clicking the reset_password link I received from email,
I got redirected to the homepage not on the reset password page.

The strange thing is that this problem only occur in my production
site. The reset works perfectly in my local machine.

I've done some checking in firebug and it said something like
a "303 See Other" error.

Any help is appreciated. 

Thanks.

Neil Oswald



-- 
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: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-25 Thread Mike
Lighttpd is configured as follows:

server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
 "mod_redirect",
 "mod_rewrite",
 "mod_fastcgi",
 "mod_accesslog",
 "mod_status",
)

server.document-root= "/var/www"
server.upload-dirs  = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname= "www-data"
server.port = 8080
server.bind = "0.0.0.0"
server.error-handler-404= "/fgcihandler.fcgi"

index-file.names= ( "index.html",
"index.htm", "default.htm",
   " index.lighttpd.html" )

url.access-deny = ( "~", ".inc" , ".py")
accesslog.filename = "/var/log/lighttpd/access.log"
static-file.exclude-extensions = ( ".php", ".pl", ".py", ".fcgi" )

$HTTP["host"] == "^localhost/cc" {
url.rewrite-once = (
  "^(/.+?/static/.+)$" => "/applications$1",
  "(^|/.*)$" => "/fcgihandler.fcgi$1",
)
}

$HTTP["scheme"] == "http" {
$HTTP["host"] =~ ".*" {
url.redirect = ("^/ccs/.*" => "https://%0$0";)
}
}


fastcgi.server = (
  ".fcgi" => (
  "localhost" => ( #name for logs
 "debug" => "1",
 "check-local" => "disable",
 "min-procs" => "1",
 "socket" => "/tmp/fcgi.sock"
  )
   ),
)


fcgi handler is started with:
sudo -u www-data python fcgihandler.fcgi 

thanks,
Mike

On Tuesday, February 24, 2015 at 12:24:50 PM UTC-8, Niphlod wrote:
>
> how did you setup lighttpd and fastcgi ?
>
>

-- 
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] When not HTTPS i receive TypeError: 'NoneType' object is not callable

2015-02-25 Thread UG
Hi,

I am receiving an error when i access my app from non SSL .
i have set
request.requires_https()

It used to redirect to HTTPS but now it just gives me the error below.
i don' even know where to start. i have looked for anyplace i am storing 
variables in session , but i am not.

any ideas?

Framework TypeError: 'NoneType' object is not callable 
 + details 

  

1.
2.
3.
4.
5.
6.
7.

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/main.py", line 435, in wsgibase
session.connect(request, response)
  File "/home/www-data/web2py/gluon/globals.py", line 934, in connect
session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
TypeError: 'NoneType' object is not callable




-- 
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 framework as iOS app backend

2015-02-25 Thread Amit Kumar
Hi,

We are deciding backend layer for our iOS and Android mobile app. The app 
will interact with MySQL DB via REST JSON service. The implementation is 
not really complex.

I wanted to check if web2py is a good option for our app. We have been 
looking at multiple python framework - Django, Flask and Web2Py... based on 
the documents it appears that web2py is a good fit. I wanted to check in 
the group if anyone has used web2py for iOS backend. These are going to be 
native iOS and Android apps.

thanks for your time.

amit

-- 
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: First post: Is this a bug?

2015-02-25 Thread Mat Miles
I found that the problem was that my tables had become corrupted by making
too many changes at once. When I removed the tables, ran database admin,
then re-added the tables it worked. It was not related to the different db
types.
On Feb 24, 2015 1:45 PM, "Niphlod"  wrote:

> the first thing to be noted is that you'd need to define the referencED
> table before the referencING one. not strictly needed always but a good
> place to start.
>
> On Monday, February 23, 2015 at 11:44:43 PM UTC+1, Mat Miles wrote:
>>
>> db.define_table('daily_schedule',
>> Field('the_day', type='date', label='Schedule Day',
>> requires=IS_NOT_EMPTY()),
>> Field('assignment_type_id', type='reference
>> assignment_type', label='Assignment', requires=IS_NOT_EMPTY()),
>> format = '%(the_day)s')
>>
>> db.define_table('assignment_type',
>> Field('name', type='string', label='Assignment Type'),
>> format = '%(name)s')
>>
>> On Sunday, February 22, 2015 at 8:37:31 PM UTC-7, Mat Miles wrote:
>>>
>>> I had a project that a number of tables that reference other tables
>>> using MySQL as the DB. I started another project using SQlite and the
>>> reference tables did not work. I went over and over the project to see if I
>>> had a typo somewhere and could not find one. Finally I converted the table
>>> to MSSQL and the references began working. Is this a bug, or is there some
>>> configuration option that I am missing when using SQlite?
>>>
>>> What I mean by the reference tables not working is that when you go to
>>> create a new record where one of the fields is referencing values in
>>> another table, the box would show for the field, but it would display as a
>>> text field with no values and not a dropdown list.
>>>
>>> -mat
>>>
>>>
>>>  --
> 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/uiFt4csLo-k/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.


Re: [web2py] web2py framework as iOS app backend

2015-02-25 Thread Marin Pranjić
I have apps that run as android/ios backend services.
It's REST, there's nothing special about it.
You can use web2py if you like it, I would definitely reccomend it :)

Marin


On Wed, Feb 25, 2015 at 5:22 PM, Amit Kumar  wrote:

> Hi,
>
> We are deciding backend layer for our iOS and Android mobile app. The app
> will interact with MySQL DB via REST JSON service. The implementation is
> not really complex.
>
> I wanted to check if web2py is a good option for our app. We have been
> looking at multiple python framework - Django, Flask and Web2Py... based on
> the documents it appears that web2py is a good fit. I wanted to check in
> the group if anyone has used web2py for iOS backend. These are going to be
> native iOS and Android apps.
>
> thanks for your time.
>
> amit
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: When not HTTPS i receive TypeError: 'NoneType' object is not callable

2015-02-25 Thread Leonel Câmara
I would just clear all sessions in this application that should solve it.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this 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]

2015-02-25 Thread Annet
In a table definition I have the following field:

Field('URL', length=128, requires=IS_EMPTY_OR(IS_URL(prepend_scheme=None)), 
label='Url - formaat: www.domeinnaam.extensie')

in form = SQLFORM() this field contains the folliwng code by default:



I have no idea where this come from, how do I get rid of it?


Kind regards,

Annet

-- 
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 menu and CTRL+Click redirect both actual and new tab

2015-02-25 Thread Richard
Hello,

I am not sure where is it from, but I notice and change in the behavior of 
CTRL + Click over main web2py menu and submenu entry which in the pass were 
only open an new tab conducting the user on the requested page base on menu 
entry link. But now, when doing CTRL + Click over menu and submenu entry 
new tab still get create and pointing over the proper location, but the 
actual page also get redirecting...

Any idea?

I will open a issue on github if you think that actually a regression issue?

Thanks

Richard

-- 
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: When not HTTPS i receive TypeError: 'NoneType' object is not callable

2015-02-25 Thread UG
An update on this is 
i have multiple apps on the same server i am using routes.py to map domains.
 when Apache is restarted the first protocol used will function but then 
the other will not . If i access the app on port 80 all sites will function 
on port 80 and 443 will create the below error and if HTTPS is the firs 
then requests on port 80 will generate the error. 

i have tailed the Apache error logs when this is happening and there is 
nothing.



On Wednesday, February 25, 2015 at 8:38:29 AM UTC-8, UG wrote:
>
> Hi,
>
> I am receiving an error when i access my app from non SSL .
> i have set
> request.requires_https()
>
> It used to redirect to HTTPS but now it just gives me the error below.
> i don' even know where to start. i have looked for anyplace i am storing 
> variables in session , but i am not.
>
> any ideas?
>
> Framework TypeError: 'NoneType' object is not callable 
>  + details 
> 
>   
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
>
> Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/main.py", line 435, in wsgibase
> session.connect(request, response)
>   File "/home/www-data/web2py/gluon/globals.py", line 934, in connect
> session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
> TypeError: 'NoneType' object is not callable
>
>
>
>
>

-- 
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: only whole table search instead granular by field in grid?

2015-02-25 Thread Anthony
One simple option is just to disable the Javascript that shows the drop 
down:

search_input = grid.element('#w2p_directory_keywords')
search_input and search_input.attributes.pop('_onfocus')

You can also create your own search widget (e.g., a simple form with an 
input and submit button) and pass it as the "search_widget" argument to the 
grid.

Finally, by default, the grid will search all searchable fields for the 
keywords. If you want some other behavior (e.g., limit search to particular 
fields), you can pass your own search function to the grid via the 
"searchable" argument.

Anthony

On Wednesday, February 25, 2015 at 1:10:33 AM UTC-5, Alex Glaros wrote:
>
> is there a way to prevent granular field-specific search in grid?
>
> just want the top-level search (that searches all fields) and not the drop 
> down that let's user choose which fields to search
>
> thanks
>
> Alex Glaros
>

-- 
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] Routes pattern and args / query strings

2015-02-25 Thread Anthony
On Wednesday, February 25, 2015 at 7:54:36 AM UTC-5, Louis Amon wrote:
>
> Anyway, the rules are processed in order, so you should be able to include 
> a rule mapping static to static, and then include the /s$anything rule 
> (which won't be matched to "static" because the static rule will already 
> have matched).
>
>
> That’s actually what I ended up doing, but it isn’t something you can rely 
> on in a big project…
>

Why not?
 

> In some cases, $anything isn't powerful enough, and you need to use 
> regular expressions.
>
>
> I was hoping there would be an alternative, but I guess regular 
> expressions are indeed the only option to do things properly.
>

Did you have a particular API in mind? The parameter-based system is 
designed to be much simpler while cover the most common use cases, but if 
you want something highly customized, there will inevitably be some 
complexity to the rules you set up.

Anthony

-- 
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: auth_user uppercase

2015-02-25 Thread Anthony
Can you explain further what you are observing. I don't see how that code 
could affect any data in your database table.

Anthony

On Wednesday, February 25, 2015 at 8:15:14 AM UTC-5, Gael Princivalle wrote:
>
> Thanks Anthony.
>
> But if I replacing my code with your suggested code I have crashed the 
> table:
> discounts.table appears corrupted
>
> db.define_table('discounts',
> Field('user_id', 'reference auth_user', requires = 
> IS_IN_DB(db, db.auth_user.id,
> lambda r: '%s %s' % (r.first_name.upper(), r.last_name
> .upper(,
> Field('brand', 'reference brands', requires = IS_IN_DB(db, 
> db.brands.id, '%(name)s'),
>   represent=lambda id, r: db.brands[id].name),
> Field('xcent', type='double'))
>
> Any idea?
>
> Il giorno mercoledì 25 febbraio 2015 13:12:50 UTC+1, Anthony ha scritto:
>>
>> The third argument to IS_IN_DB is the label argument, which can either be 
>> Python string formatting (to which the Row object will be passed) or a 
>> function that takes a Row object. You cannot use arbitrary Python code 
>> inside Python string formatting. Try:
>>
>> IS_IN_DB(db, db.auth_user.id,
>>  lambda r: '%s %s' % (r.first_name.upper(), r.last_name.upper()))
>>
>> Anthony
>>
>>
>> On Wednesday, February 25, 2015 at 4:19:29 AM UTC-5, Gael Princivalle 
>> wrote:
>>>
>>> Hello.
>>>
>>> In my db I have this discounts table:
>>> db.define_table('discounts',
>>> Field('user_id', 'reference auth_user'),
>>> Field('brand', 'reference brands', requires = IS_IN_DB(
>>> db, db.brands.id, '%(name)s'),
>>>   represent=lambda id, r: db.brands[id].name),
>>> Field('xcent', type='double'))
>>>
>>> I would like to display the name and first name of the auth_user 
>>> uppercase.
>>> Something like that:
>>> Field('user_id', 'reference auth_user', requires = IS_IN_DB(db, 
>>> db.auth_user.id, '%(first_name.upper())s %(last_name.upper())s')),
>>> But I've got this error:
>>> 'Row' object has no attribute 'upper()'
>>>
>>> I've tried also like that, str(first_name).upper(), same error.
>>>
>>> Someone have a solution?
>>>
>>> Thanks, regards.
>>>
>>>

-- 
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: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-25 Thread Niphlod
reaally strange, although I don't use lighttpd since nginx came out. 
request.vars are parsed out of request.QUERY_STRING. could you please 
doublecheck what request.get('QUERY_STRING') dumps ?


-- 
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 framework as iOS app backend

2015-02-25 Thread Michele Comitini
I have used jsonrpc2 with good success as protocol between web2py and iOS
apps.  Straightforward: no need to think about encoding over the wire.

2015-02-25 17:45 GMT+01:00 Marin Pranjić :

> I have apps that run as android/ios backend services.
> It's REST, there's nothing special about it.
> You can use web2py if you like it, I would definitely reccomend it :)
>
> Marin
>
>
> On Wed, Feb 25, 2015 at 5:22 PM, Amit Kumar  wrote:
>
>> Hi,
>>
>> We are deciding backend layer for our iOS and Android mobile app. The app
>> will interact with MySQL DB via REST JSON service. The implementation is
>> not really complex.
>>
>> I wanted to check if web2py is a good option for our app. We have been
>> looking at multiple python framework - Django, Flask and Web2Py... based on
>> the documents it appears that web2py is a good fit. I wanted to check in
>> the group if anyone has used web2py for iOS backend. These are going to be
>> native iOS and Android apps.
>>
>> thanks for your time.
>>
>> amit
>>
>>  --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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] Reset Password Not Working in Production

2015-02-25 Thread Michele Comitini
303 is not an HTTP error but a redirection.
Is the token in the reset link valid? Is the reset link correctly pointing
to the reset password URL?



2015-02-25 17:19 GMT+01:00 Neil Oswald :

> Hi,
>
> Good day!
>
> After clicking the reset_password link I received from email,
> I got redirected to the homepage not on the reset password page.
>
> The strange thing is that this problem only occur in my production
> site. The reset works perfectly in my local machine.
>
> I've done some checking in firebug and it said something like
> a "303 See Other" error.
>
> Any help is appreciated.
>
> Thanks.
>
> Neil Oswald
>
>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Routes pattern and args / query strings

2015-02-25 Thread Niphlod
BTW... just to synchronize ourself, what the book gives as an example is

('/new_name/$anything', '/app/controller/function*/*$anything')

mind the */* part . This is the only safe way to do what people usually 
want to "translate", that is the app/c/f part, while leaving args and vars 
untouched. You can work around using something like you suggested, but you 
already faced what the developers faced: the utter and complete disaster in 
mapping what comes in .

Of course (if you think to the method a piece of code would convert this to 
a regex) this just maps whatever is coming AFTER /newname/ and not what 
reaches /newname (again, mind the lack of the last /).

Frankly, I'm a bit scared to suggest that your issue (i.e. being accustomed 
on how web2py treats incoming urls in without arguments, which is that 
calling /a/c/f is the same as /a/c/f*/*) can be easily solved by 

('/new_name', '/app/controller/function')



-- 
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: importing .csv to create DAL object

2015-02-25 Thread Dave S


On Wednesday, February 25, 2015 at 7:43:46 AM UTC-8, Niphlod wrote:
>
> by hand.
>
>
That is, use the import functions of the database the site will use, 
right?  And then use migrate=False and/or fakemigrate to create the DAL's 
.table files?
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#migrate--fake_migrate>
 
But Abhijit will still have to set up the models file with the correct 
field definitions to match the table(s) being imported.

/dps

On Wednesday, February 25, 2015 at 4:29:52 PM UTC+1, Abhijit Chatterjee 
> wrote:
>>
>> I haven't tried to code yet. But if I have .sql file. How to import.
>
>

-- 
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: importing .csv to create DAL object

2015-02-25 Thread Niphlod
.sql files are files filled with

insert into table(col1, col2, col3) values ('a', 'b', 'c')

web2py can't parse them, and frankly, it doesn't need to. it's a job best 
served by native tools.
it'll better to restore the dump using native tools, then read the section 
on the book 
,
 
which basically resorts to:

1. set migrate=true, fake_migrate_all=true
2. create models accordingly
3. verify that all works fine
4. set fake_migrate_all=false
5. continue working as usual with application development

as previously pointed, 2. can be satisfied (for the most part) with the 
extract_mysql_models.py

-- 
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: not web2py question - test timezone detection

2015-02-25 Thread Dave S


On Wednesday, February 25, 2015 at 7:45:03 AM UTC-8, Niphlod wrote:
>
> if a module is required, it is imported.
>

What names can be be imported?  Must a 3rd-party module be renamed to fit 
the plug-in scheme?  My understanding is "no".
 

> if it's in two places, the same thing applies. why should it be an issue ?
>

Updating all copies, but the OP seems to be on linux, so using links can 
help with that.
 
/dps


> On Wednesday, February 25, 2015 at 9:33:35 AM UTC+1, Mirek Zvolský wrote:
>>
>> and have TWO identical...
>>
>> Dne středa 25. února 2015 9:32:26 UTC+1 Mirek Zvolský napsal(a):
>>>
>>> Hi,
>>> maybe I don't understand how web2py handles a situation, when some 
>>> python module is required by the web2py plugin.
>>> I think, web2py cannot recognize it as part of the plugin (because of 
>>> name not starting with plugin_...) or I can rename it (and have to 
>>> identical files with standard and non-standard name).
>>> Or is here some solution?
>>>
>>>
>>>
>>>
>>> Dne úterý 24. února 2015 21:31:51 UTC+1 Niphlod napsal(a):

 I don't see any cons in the actual naming conventions, and frankly, no 
 pros on the one you're suggesting...granted, web2py plugins won't work 
 with 
 django, but the same applies for django packages: they don't work on 
 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.


Re: [web2py] Re: not web2py question - test timezone detection

2015-02-25 Thread Roberto Perdomo
America/Caracas
El feb. 25, 2015 4:55 PM, "Dave S"  escribió:

>
>
> On Wednesday, February 25, 2015 at 7:45:03 AM UTC-8, Niphlod wrote:
>>
>> if a module is required, it is imported.
>>
>
> What names can be be imported?  Must a 3rd-party module be renamed to fit
> the plug-in scheme?  My understanding is "no".
>
>
>> if it's in two places, the same thing applies. why should it be an issue ?
>>
>
> Updating all copies, but the OP seems to be on linux, so using links can
> help with that.
>
> /dps
>
>
>> On Wednesday, February 25, 2015 at 9:33:35 AM UTC+1, Mirek Zvolský wrote:
>>>
>>> and have TWO identical...
>>>
>>> Dne středa 25. února 2015 9:32:26 UTC+1 Mirek Zvolský napsal(a):

 Hi,
 maybe I don't understand how web2py handles a situation, when some
 python module is required by the web2py plugin.
 I think, web2py cannot recognize it as part of the plugin (because of
 name not starting with plugin_...) or I can rename it (and have to
 identical files with standard and non-standard name).
 Or is here some solution?




 Dne úterý 24. února 2015 21:31:51 UTC+1 Niphlod napsal(a):
>
> I don't see any cons in the actual naming conventions, and frankly, no
> pros on the one you're suggesting...granted, web2py plugins won't work 
> with
> django, but the same applies for django packages: they don't work on 
> 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.
>

-- 
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: only whole table search instead granular by field in grid?

2015-02-25 Thread Alex Glaros
thanks Anthony,

Javascript didn't work - where does it go?  Tried both in 

[web2py] Re: on CheckboxesWidget styles

2015-02-25 Thread 'DenesL' via web2py-users
So if anyone prints the 'ul' style form it will have a dropdown for field 
s1 with the following structure:


>   
> 
>   
>   one
> 
>   
>   
> 
>   
>   two
> 
>   
>   ...
>   
> 
>

while if you could use an (UL, LI, TAG[''] ) wrapper instead, it would look 
like this:


>   
> 
> one
>   
>   
> 
> two
>   
>   ...
>   
>  />
>   
> 
>

The latter feels more semantic and is shorter.
Is anyone interested, at least in having a way to provide your own style?.

Regards,
Denes

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

2015-02-25 Thread Dave S


On Wednesday, February 25, 2015 at 10:55:51 AM UTC-8, Annet wrote:
>
> In a table definition I have the following field:
>
> Field('URL', length=128, 
> requires=IS_EMPTY_OR(IS_URL(prepend_scheme=None)), label='Url - formaat: 
> www.domeinnaam.extensie')
>
> in form = SQLFORM() this field contains the folliwng code by default:
>
> 
>
> I have no idea where this come from, how do I get rid of it?
>

Is "URL' supposed to be the name of the field, or the type? 

/dps
 

>
>
> Kind regards,
>
> Annet
>

-- 
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 menu and CTRL+Click redirect both actual and new tab

2015-02-25 Thread Dave S


On Wednesday, February 25, 2015 at 11:25:06 AM UTC-8, Richard wrote:
>
> Hello,
>
> I am not sure where is it from, but I notice and change in the behavior of 
> CTRL + Click over main web2py menu and submenu entry which in the pass were 
> only open an new tab conducting the user on the requested page base on menu 
> entry link. But now, when doing CTRL + Click over menu and submenu entry 
> new tab still get create and pointing over the proper location, but the 
> actual page also get redirecting...
>
> Any idea?
>
> I will open a issue on github if you think that actually a regression 
> issue?
>


Past behavior  was  open top-level menu item, highlight entry for submenu, 
CTRL+click opens new tab which takes you to page corresponding to top-level 
item?

New behavior -- the tab opens as before, but the tab you started on also 
changes to that location?

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


[web2py] Re: only whole table search instead granular by field in grid?

2015-02-25 Thread Anthony
My code is not Javascript -- it is Python and goes in the controller where 
you create the grid (note it refers to the "grid"). It *disables* the 
Javascript that triggers the drop down, but it is not Javascript code.

On Wednesday, February 25, 2015 at 4:53:37 PM UTC-5, Alex Glaros wrote:
>
> thanks Anthony,
>
> Javascript didn't work - where does it go?  Tried both in 

[web2py] Re: importing .csv to create DAL object

2015-02-25 Thread Dave S


On Wednesday, February 25, 2015 at 1:14:34 PM UTC-8, Niphlod wrote:
>
> .sql files are files filled with
>
> insert into table(col1, col2, col3) values ('a', 'b', 'c')
>

I used to know that =8-O
 

>
> web2py can't parse them, and frankly, it doesn't need to. it's a job best 
> served by native tools.
> it'll better to restore the dump using native tools, then read the 
> section on the book 
> ,
>  
> which basically resorts to:
>

Okay, I didn't look far enough on my first try.
 

> 1. set migrate=true, fake_migrate_all=true
>

(more evidence that I didn't look far enough)
 

> 2. create models accordingly
> 3. verify that all works fine
> 4. set fake_migrate_all=false
> 5. continue working as usual with application development
>
> as previously pointed, 2. can be satisfied (for the most part) with the 
> extract_mysql_models.py
>
>
I am happy to not have had to do much  to do much migrating.  The last time 
I had anything close, it was adding fields, and I was in a position to 
re-start with a clean slate, and use CSV files to import into the new 
tables via appadmin.  One of these days my luck will run out, and I'll need 
the above instructions.

Thanks for your patience.

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


[web2py] Re: adding signature to url after login

2015-02-25 Thread weheh
Is there any way to work around this issue? It's hanging me up in my 
checkout flow. 

User wants to buy product but must be registered. User gets logged in 
automatically if registration is valid. Is there a way at this point to 
generate a valid signature so that downstream checkout process can use 
URL(..., user_signature=True)? Currently, even though logged in, auth is 
rejecting signature and sending me back to login screen.


On Saturday, February 7, 2015 at 8:41:17 PM UTC-8, Massimo Di Pierro wrote:
>
> This is a good point. Please open a ticket (on github) and we will 
> investigate.
>
> On Friday, 6 February 2015 15:18:55 UTC-6, weheh wrote:
>>
>> I have a URL that I want to direct to after login. Something like 
>> _next_url = URL(c, f, v, signature=True).
>>
>> The problem is this. The signature is computed before login. After login, 
>> the signature isn't valid. Is there a way to recompute the signature for a 
>> URL after the fact ... after the URL is already computed. Something like 
>> _next_url = URL(c, f, v) ... then later _next_url_fixed = 
>> add_signature_to(_next_url)?
>>
>

-- 
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: adding signature to url after login

2015-02-25 Thread Leonel Câmara
As a workaround, I guess that instead of using next, you could use 
auth.settings.login_onaccept and append a function/lambda that does the 
redirection, in this lambda the user would already be logged in so you 
could generate an URL with a proper signature.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py framework as iOS app backend

2015-02-25 Thread Matheus Cardoso
Web2py by itself it is a very easy tool to implement a API REST. However, 
you should attempt to multiple requests to your API, therefore you should 
to look after to your scalability's API. See this subsection in web2py's 
book: 
http://www.web2py.com/books/default/chapter/29/13/deployment-recipes#Efficiency-and-scalability
Besides that, try to think more in your infra rather than the framework. 
The first thing in my mind is Openshift. It has support for web2py, 
although not native, and scales for you automatically when multiple 
requests (10 per sec, I guess) raises up over the current capability. 

On Wednesday, February 25, 2015 at 1:38:29 PM UTC-3, Amit Kumar wrote:
>
> Hi,
>
> We are deciding backend layer for our iOS and Android mobile app. The app 
> will interact with MySQL DB via REST JSON service. The implementation is 
> not really complex.
>
> I wanted to check if web2py is a good option for our app. We have been 
> looking at multiple python framework - Django, Flask and Web2Py... based on 
> the documents it appears that web2py is a good fit. I wanted to check in 
> the group if anyone has used web2py for iOS backend. These are going to be 
> native iOS and Android apps.
>
> thanks for your time.
>
> amit
>
>

-- 
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: Integrating web2py and a CMS

2015-02-25 Thread Kenneth
Hi,

finally getting around doing this. I have a Drupal site with a CAS module 
installed. 

Anyone done this before?


Kenneth


Den lördag 15 januari 2011 kl. 17:49:46 UTC+2 skrev Massimo Di Pierro:
>
> It can. 
>
> http://web2py.com/cas 
>
> On Jan 15, 9:13 am, David Bain  wrote: 
> > I believe web2py can act as a CAS authentication server. If you CMS does 
> CAS 
> > then you're good. Maybe an easier place to start is to figure what CMSes 
> out 
> > there can authenticate against CAS. 
> > 
> > 2011/1/15 Kenneth Lundström  
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > I was thinking about using web2py as the authentication platform as it 
> > > holds the members database. Or then a LDAP that gets it information 
> from 
> > > members database. 
> > 
> > > The intranet will hold a lot of information that should be visible on 
> the 
> > > website via the CMS. Either lots of small info (names, telephone 
> numbers) or 
> > > maybe whole pages. Could iframe be a way of displaying data from web2y 
> on a 
> > > webpage? 
> > 
> > > Kenneth 
> > 
> > >  This kind of information is often stored in a corporate directory 
> using 
> > >> something called LDAP. I am not sure of the size of your company but 
> it 
> > >> sounds like it is large enough to consider this solution. There is 
> OpenLDAP 
> > >> on Linux or Active Directory on Microsoft which perform this task as 
> > >> concrete examples of product. The web2py server has a contrib module 
> for 
> > >> using LDAP authentication which is documented in the manual. Check if 
> your 
> > >> CMS is capable of this as well. 
> > 
> > >> The web2py server has a very diverse set of authentication mechanisms 
> such 
> > >> as SMTP server login etc. This would get you username and password in 
> one 
> > >> location but not a hierarchy or org chart. 
> > 
> > >> Since the choice of CMS is unknown at this point it is difficult to 
> tell 
> > >> if it is open enough to be able to refer to tables in the web2py 
> portion of 
> > >> the infrastructure. 
> > 
> > >> A couple of ideas, 
> > >> Ron

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

2015-02-25 Thread Annet
Hi Dave,

Thanks for your reply.

URL is the name of the field. I thought this would not cause any problem
for check_reserved = ['all'] accepted it as a field name.

Kind regards,

Annet

-- 
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] Google Cloud Storage in GAE refresh token access

2015-02-25 Thread Jacinto Parga
Hi, 

I am using Google Cloud Storage (GCS) with web2py.

I've implemented 
( https://cloud.google.com/storage/docs/json_api/v1/json-api-python-samples 
) it works fine in localhost or in systems where you can write in the 
filesystem.

But in Google App Engine (GAE) you can not write in the filesystem so it 
doesn't create nor update *sample.dat*

 # If the credentials don't exist or are invalid run through the native client
  # flow. The Storage object will ensure that if successful the good
  # credentials will get written back to the file.
  storage = file.Storage('sample.dat')
  credentials = storage.get()
  if credentials is None or credentials.invalid:
credentials = tools.run_flow(FLOW, storage, flags)

  # Create an httplib2.Http object to handle our HTTP requests and authorize it

  # with our good Credentials.
  http = httplib2.Http()
  http = credentials.authorize(http)

  # Construct the service object for the interacting with the Cloud Storage API.
  service = discovery.build('storage', _API_VERSION, http=http)


The result is that anytime I deploy it in GAE it works fine until the 
*token* stored in *sample.dat * expires. As soon as it expires it cannot 
update the file so the access is revoked.

Maybe I can change the file *sample.dat*  for a variable stored in a table, 
something like this. 

db.define_table('t_sample',
Field('f_sampledat', type='text',  label=T('Mensaje')))

But I haven't found how to do it right, how to store the content of 
sample.dat and to access it in the same way. Any suggestion.

The sample.dat file is like this:

{"_module": "oauth2client.client", "token_expiry": "2015-02-25T20:17:48Z", 
"access_token": "", 
"token_uri": "https://accounts.google.com/o/oauth2/token";, "invalid": false,
 "token_response": {"access_token": 
"x", "token_type": 
"Bearer", "expires_in": 3600}, "client_id": 
"xx.apps.googleusercontent.com", "id_token":
 null, "client_secret": "xxx", "revoke_uri": 
"https://accounts.google.com/o/oauth2/revoke";, "_class": "OAuth2Credentials"
, "refresh_token": 
"x", 
"user_agent": null}

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