[web2py] Legacy DB using uuid value for "id" column

2021-11-10 Thread Tito Garrido
Hi!

I am trying to connect pydal to external database with fake_migration false
just to use the pydal interface to interact with this database.

But when I try to select something like:
db(db.profiles.id == current_user.user_id).select(db
.profiles.can_vote).first()

It complains about "profiles.id" because it is a "uuid" value and it
expects a int10. Is there a way to define the id column to accept the uuid
value?

db.define_table('profiles',
Field('id', 'string'),
Field('can_vote', 'boolean'),
Field('username'),
Field('avatar_url')
)


Thanks!


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHEOJ5gC49nbufdcNrMfQtWr-B-Uda4d6eVq2rmYabaKKA%40mail.gmail.com.


[web2py] Error 400 for Not authorized? Shouldn't we use 401?

2019-12-19 Thread Tito Garrido
Hi Guys,

I am using AuthJWT from
https://github.com/web2py/web2py/blob/master/gluon/tools.py
I could see that an expired token or not authorized token is
returning error 400. Shouldn't we use 401 - Unauthorized?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401

Thanks!

Tito


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHHB%3DxrppU9s%2BKT_UoxRJiWtmxjNyFqnYK5hSS1Pe0p1cg%40mail.gmail.com.


[web2py] Is there any documentation about DBAPI and JWT?

2019-12-17 Thread Tito Garrido
Hi Guys,

Is there any documentation about DBAPI and JWT working together?

I am trying to create a protected API that will be access by vue.

Thanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHEMBVPwwJWBDnm-QByaUv4og-EPKFYxrnyWr%2B1fxA81CQ%40mail.gmail.com.


Re: [web2py] Re: web3py -> py4web

2019-07-29 Thread Tito Garrido
I am trying to reproduce the RestAPI example:



*>>> print (pydal.__version__)19.05.11>>> from pydal.dbapi import RestAPI,
Policy*
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'pydal.dbapi'

What am I missing?


On Mon, Jul 29, 2019 at 10:43 AM António Ramos  wrote:

> Why not using gitbook to create the documentation ???
> repos already using gitbook...
>
> https://guide.elm-lang.org/
> https://docs.feathersjs.com/#
>
> etc
>
> Em seg, 29 de jul de 2019 às 10:36, Jose C 
> escreveu:
>
>> Darn, I hunted around but didn't see it.  Thanks for the link...
>>
>>
>>
>> On Monday, 29 July 2019 10:06:42 UTC+1, Nico Zanferrari wrote:
>>>
>>> Hi Jose,
>>>
>>> the documentation is already on GitHub
>>> 
>>>  ,
>>> and PR are always welcome ;-)
>>>
>>> Nico
>>>
>>> Il giorno lun 29 lug 2019 alle ore 10:14 Jose C 
>>> ha scritto:
>>>
 Looks promising... some questions:

 1) Have spotted many typos in docs but can't find docs for py4web on
 github.  If docs are on there, like web2py book, people can submit pull
 requests and help massage the docs into shape.
 2) Should there be a new official group created for py4web (or some
 other repo of Q&A knowledge, StackExchange?)   A) to minimize noise in the
 web2py group and B) also make it easier to find py4web related stuff?
 3) When are you aiming for the first "stable" release?

 Rgds,


 --
 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 web...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/web2py/0693c615-1283-413e-b976-91c238da8384%40googlegroups.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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/05415021-9b4a-41bb-ab6e-2c9c3648dad0%40googlegroups.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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CAEM0BxMNf%2BDKcKqU-GsdT7JZX%3DEWoKzT7aPQBieGiDb3dhd5Yg%40mail.gmail.com
> 
> .
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHH%2BXnje7hmQ4Pt0HX%3DH%2BmczFcitZC3A9rzAs5K-b4rUsw%40mail.gmail.com.


Re: [web2py] Re: validate_insert, status 200 and data="iderrors"

2019-07-18 Thread Tito Garrido
I just figured out that the error:

is because of:
return db.transactions.validate_and_insert(**parent)

seems that db.transactions.validate_and_insert(**parent) is causing an
error during the return.. if I return a string it works...

On Wed, Jul 17, 2019 at 11:52 PM Dave S  wrote:

>
>
> On Wednesday, July 17, 2019 at 3:40:07 PM UTC-7, Dave S wrote:
>>
>>
>> On Wednesday, July 17, 2019 at 11:02:59 AM UTC-7, Tito Garrido wrote:
>>>
>>> No entry in the database...
>>>
>>> I could execute the post from postman... but if I try from axios in vue
>>> I am even getting a web2py server error:
>>>
>>> ERROR:Rocket.Errors.Thread-2:Traceback (most recent call last):
>>>>   File
>>>> "/Users/titogarridoogando/Documents/Projetos/web2py/controle/web2py/gluon/rocket.py",
>>>> line 1797, in run_app
>>>> sections = len(output)
>>>> TypeError: object of type 'Reference' has no len()
>>>>
>>>> During handling of the above exception, another exception occurred:
>>>>
>>>> Traceback (most recent call last):
>>>>   File
>>>> "/Users/titogarridoogando/Documents/Projetos/web2py/controle/web2py/gluon/rocket.py",
>>>> line 1288, in run
>>>> self.run_app(conn)
>>>>   File
>>>> "/Users/titogarridoogando/Documents/Projetos/web2py/controle/web2py/gluon/rocket.py",
>>>> line 1819, in run_app
>>>> output.close()
>>>> TypeError: 'NoneType' object is not callable
>>>
>>>
>>>
>>> No idea what it means...
>>>
>>
>> Which version of web2py are you using?   Is this with Python2 or Python3?
>>
>>
>
> Also, can you show us request.body, either from inside your controller, or
> from the browser tools?
>
> If you do any logging, can you check what the return value of
> validate_and_insert() is?
>
> (I use curl, or occasionally wget, for some request debugging; I'm not
> familiar with postman or axios; the one browser extension I've used is on
> the home computer, so I'll report its name later.)
>
> /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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/f2b43605-f028-4293-8093-41243a9c4331%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/f2b43605-f028-4293-8093-41243a9c4331%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHEt9fc6j%2B2RaYxRsY%3Di0adsk0qL6mhtDL3qjYLLi36taw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: validate_insert, status 200 and data="iderrors"

2019-07-17 Thread Tito Garrido
No entry in the database...

I could execute the post from postman... but if I try from axios in vue I
am even getting a web2py server error:

ERROR:Rocket.Errors.Thread-2:Traceback (most recent call last):
>   File
> "/Users/titogarridoogando/Documents/Projetos/web2py/controle/web2py/gluon/rocket.py",
> line 1797, in run_app
> sections = len(output)
> TypeError: object of type 'Reference' has no len()
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File
> "/Users/titogarridoogando/Documents/Projetos/web2py/controle/web2py/gluon/rocket.py",
> line 1288, in run
> self.run_app(conn)
>   File
> "/Users/titogarridoogando/Documents/Projetos/web2py/controle/web2py/gluon/rocket.py",
> line 1819, in run_app
> output.close()
> TypeError: 'NoneType' object is not callable



No idea what it means...

On Wed, Jul 17, 2019 at 2:23 PM Dave S  wrote:

>
>
> On Wednesday, July 17, 2019 at 7:36:40 AM UTC-7, Tito Garrido wrote:
>>
>> Hi!
>>
>> I am trying to call a POST method from a Vue.js frontend. My backend is
>> web2py serving a REST API:
>> [...]
>>
> This is the Data sent:
>>
>>> {'parent_transaction': None, 'transaction_date': '01/01/2019',
>>> 'transaction_label': 'label', 'transaction_type': 'Receita', 'treatment':
>>> 1, 'transaction_value': 250, 'paid': False, 'payment_method': None}
>>>
>>
>> This is the response:
>>
>>
>>>1. config: {url: "
>>>http://127.0.0.1:8000/controle7030/product/save_transaction";, method
>>>: "post", data:
>>>
>>> "{"total_value":250,"costs":[[{"id":1,"product":1,"…85","total_cost":66,"transaction_type":"Receita"}"
>>>, headers: {…}, transformRequest: Array(1), …}
>>>2. data: "iderrors"
>>>3. headers: {pragma: "no-cache", content-type: "text/html;
>>>charset=utf-8", cache-control: "no-store, no-cache, must-revalidate,
>>>post-check=0, pre-check=0", expires: "Wed, 17 Jul 2019 14:35:41 GMT"}
>>>4. request: XMLHttpRequest {onreadystatechange: ƒ, readyState: 4,
>>>timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, …}
>>>5. status: 200
>>>6. statusText: "OK"
>>>7. __proto__: Object
>>>
>>>
>> Any idea what is wrong? What does mean "iderrors"?
>>
>
> Does that transaction get entered into the database?
>
> The one thought I have about "iderrors" is that you have a mishmash
> occurring in converting the result into JSON.
>
> I'd expect the body of the response to look something like
> {"id": 2345, "errors": None}
>
> where 2345 is the value returned by validate_and_insert() [the id field of
> the new row in the table] and None to indicate no errors.
>
> /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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/daa835f7-e232-494c-9bbc-def2a249869f%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/daa835f7-e232-494c-9bbc-def2a249869f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHE3fpSVeW0cjGB2s1beYf0nAEhYivuqNwdXVN6ss_X%3DdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] validate_insert, status 200 and data="iderrors"

2019-07-17 Thread Tito Garrido
Hi!

I am trying to call a POST method from a Vue.js frontend. My backend is
web2py serving a REST API:

@request.restful()
> @cors_allow
> def save_transaction():
> response.view = 'generic.json'
>
> def POST(**data):
> # Creating the parent transaction
>
> parent = {'parent_transaction' : None,
>   'transaction_date': '01/01/2019',
>   'transaction_label' : 'label',
>   'transaction_type' : data['transaction_type'],
>   'treatment': data['selected_treatment'],
>   'transaction_value': data['total_value'],
>   'paid': data['allpaid'],
>   'payment_method': None
>   }
>
> return db.transactions.validate_and_insert(**parent)
>
> return locals()
>

My DB is:

db.define_table('transactions',
> Field('parent_transaction', type='reference transactions',
> requires=IS_EMPTY_OR(IS_IN_DB(db, 'transactions.id',
> '%(transaction_label)s'))),
> Field('transaction_date', 'date',
> requires=IS_DATE(format='%d/%m/%Y',error_message='Coloque uma data no
> formato DD/MM/')),
> Field('transaction_label', 'string'),
> Field('transaction_type', 'string',
> requires=IS_IN_SET(['Receita','Despesa'])),
> Field('treatment', type='reference contact_treatment',
> requires=IS_EMPTY_OR(IS_IN_DB(db, 'contact_treatment.id',
> '%(description)s'))),
> Field('description', 'string',
> requires=IS_NOT_EMPTY(error_message='Preencha com uma descrição')),
> Field('transaction_by', 'reference contacts',
> requires=IS_EMPTY_OR(IS_IN_DB(db, 'contacts.id', '%(name)s',))),
> Field('transaction_value', 'float',
> requires=IS_FLOAT_IN_RANGE(None, None, dot=","), default=0),
> Field('paid', 'boolean', default=False),
> Field('payment_method', type='reference payment_methods',
> requires=IS_EMPTY_OR(IS_IN_DB(db, 'payment_methods.id', '%(name)s'))),
> )
>

This is the Data sent:

> {'parent_transaction': None, 'transaction_date': '01/01/2019',
> 'transaction_label': 'label', 'transaction_type': 'Receita', 'treatment':
> 1, 'transaction_value': 250, 'paid': False, 'payment_method': None}
>

This is the response:


>1. config: {url: "
>http://127.0.0.1:8000/controle7030/product/save_transaction";, method:
>"post", data:
>
> "{"total_value":250,"costs":[[{"id":1,"product":1,"…85","total_cost":66,"transaction_type":"Receita"}"
>, headers: {…}, transformRequest: Array(1), …}
>2. data: "iderrors"
>3. headers: {pragma: "no-cache", content-type: "text/html;
>charset=utf-8", cache-control: "no-store, no-cache, must-revalidate,
>post-check=0, pre-check=0", expires: "Wed, 17 Jul 2019 14:35:41 GMT"}
>4. request: XMLHttpRequest {onreadystatechange: ƒ, readyState: 4,
>timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, …}
>5. status: 200
>6. statusText: "OK"
>7. __proto__: Object
>
>
Any idea what is wrong? What does mean "iderrors"?

Thank you!

Tito
-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHGkE3PscxpbDrcGBHMJK-jwSFJOon2NjCVE3EKe08q5gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: authapi.py

2019-05-15 Thread Tito Garrido
When I try to use the code above with the @api_requires_login declared I am
receiving:

JWT header not found and JWT parameter _token missing in request

Even for functions without the decorator, like:
def token():
return myjwt.jwt_token_manager()

Any ideas why it is asking me this header?

Thank you!

Tito

On Tue, May 14, 2019 at 3:15 PM Tito Garrido  wrote:

> Thank you,
>
> https://github.com/robertop23/web2py_vuejs_vuetify/blob/master/controllers/api.py
>
> works for me!
>
> On Mon, May 13, 2019 at 4:23 PM Val K  wrote:
>
>> https://github.com/web2py/web2py/blob/4a90c82ee4271b2a17c187d41138a03249c14350/gluon/tools.py#L1002
>>
>>
>>
>>
>>
>> https://github.com/robertop23/web2py_vuejs_vuetify/blob/master/controllers/api.py
>>
>> On Monday, May 13, 2019 at 10:11:31 PM UTC+3, Tito Garrido wrote:
>>>
>>> Hi Guys!
>>>
>>> Is there any example using authapi + jwt in any documentation?
>>>
>>> Thank you!
>>>
>>> Tito
>>>
>>> --
>>>
>>> Linux User #387870
>>> .
>>>  _/_õ|__|
>>> ..º[ .-.___.-._| . . . .
>>> .__( o)__( o).:___
>>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/97e19835-dce8-499d-aa2b-140641f862fa%40googlegroups.com
>> <https://groups.google.com/d/msgid/web2py/97e19835-dce8-499d-aa2b-140641f862fa%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHGjBp5dcns%3DaDRNFiVo-ah8RAhSKmnnEc4DA4-PdyTGvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: authapi.py

2019-05-14 Thread Tito Garrido
Thank you,
https://github.com/robertop23/web2py_vuejs_vuetify/blob/master/controllers/api.py

works for me!

On Mon, May 13, 2019 at 4:23 PM Val K  wrote:

> https://github.com/web2py/web2py/blob/4a90c82ee4271b2a17c187d41138a03249c14350/gluon/tools.py#L1002
>
>
>
>
>
> https://github.com/robertop23/web2py_vuejs_vuetify/blob/master/controllers/api.py
>
> On Monday, May 13, 2019 at 10:11:31 PM UTC+3, Tito Garrido wrote:
>>
>> Hi Guys!
>>
>> Is there any example using authapi + jwt in any documentation?
>>
>> Thank you!
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/97e19835-dce8-499d-aa2b-140641f862fa%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/97e19835-dce8-499d-aa2b-140641f862fa%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHEBHqboPMPhvqfaCZjvh1gE37s9HZZHJ4eNpDVpeQa1bA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] authapi.py

2019-05-13 Thread Tito Garrido
Hi Guys!

Is there any example using authapi + jwt in any documentation?

Thank you!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAL67CHHbgH6Y9z-3SyYm-7SSorJtagX7rpW2QAdRz2y7GhZZtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Anybody using Istio on kubernetes + web2py?

2019-01-22 Thread Tito Garrido
Hi Folks!

Anybody using a dockerized application in kubernetes with Istio enabled?
Any experience to share?

Thanks in advance!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] New site on web2py

2017-06-19 Thread Tito Garrido
Cool! Seems that the autocomplete after the first "Next" is crashing on
Firefox, example:

https://www.wherecani.live/data_wizard?born=Brazil

Using Chrome it works.

Regards,

Tito

On Mon, Jun 19, 2017 at 8:44 AM, Ovidio Marinho  wrote:

> Congratulations, very good!
>
>
>
>
>
>[image: http://itjp.net.br] 
>  http://itjp.net.b r
>   *Ovidio Marinho Falcao Neto*
>  ovidio...@gmail.com
> Brasil
>
>
> 2017-06-14 10:36 GMT-03:00 Ian Ryder :
>
>> Hi all, not sure if it's OK to do this - slap me down if not!
>>
>> We're just about to launch a new tool / site based on web2py -
>> https://www.wherecani.live
>>
>> Any feedback appreciated and if it's useful to anyone looking to live in
>> different parts of the world, great stuff.
>>
>> Thanks Massimo et al for the great framework :)
>>
>> Cheers
>> Ian
>>
>> --
>> 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.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Re: How to recreate Scheduler tables?

2016-08-22 Thread Tito Garrido
Thanks!

On Mon, Aug 22, 2016 at 10:36 AM, Niphlod  wrote:

> mysched = Scheduler(., migrate=True)
>
>
> On Monday, August 22, 2016 at 3:17:24 PM UTC+2, Tito Garrido wrote:
>>
>> I have upgraded from 2.5.1 to the latest version but seems that the
>> scheduler tables had changed... I have dropped the old ones and now I am
>> trying to set web2py to recreate it.
>>
>> If I try to enable migrate it complains about some tables that already
>> exists... how to circunvent the tables that are already created and create
>> just scheduler tables?
>>
>> Regards,
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
> --
> 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.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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 to recreate Scheduler tables?

2016-08-22 Thread Tito Garrido
I have upgraded from 2.5.1 to the latest version but seems that the
scheduler tables had changed... I have dropped the old ones and now I am
trying to set web2py to recreate it.

If I try to enable migrate it complains about some tables that already
exists... how to circunvent the tables that are already created and create
just scheduler tables?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] Upgrade from 2.5.1 to latest

2016-08-02 Thread Tito Garrido
Hi Folks,

I am trying to upgrade my web2py from 2.5.1 to latest and the appadmin text
editor breaks... I have tried to get appadmin.html, layout.hmt and some js
files from the Welcome app but it still complains:

TypeError: editor is undefined

var data = editor.getValue();


What is the best way to upgrade from 2.5.1 to latest?

Regards,

Tito


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] how to return nothing

2015-10-14 Thread Tito Garrido
try:

return dict()

On Wed, Oct 14, 2015 at 6:43 PM, Alex Glaros  wrote:

> how to get function to return nothing?
>
> Goal is simply to avoid pages of records on html page as function runs
>
> def utility_change_column_name(): #used once in a while by programmer.
> Not used by users.
>   for r in db.PostalCode:
>   db((r.update(r.countryCode = r.countryCodeFromGeoNames))
>   return(nothing)
>
> 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.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] PyCharm license for web2py dev - who wants?

2015-10-12 Thread Tito Garrido
+1 :)

On Mon, Oct 12, 2015 at 8:32 AM, António Ramos  wrote:

> Picharm eats more memory than sublime.
>
> In sublime i have everything, w2py console and server logs so
>
> 2015-10-12 11:01 GMT+01:00 Paolo Amboni :
>
>> I'm using pycharm community edition, that for what I understand is free.
>> Are these licenses for the pro version?
>> Is the pro version supporting web2py?
>> If yes i'm iterested.
>>
>> Il giorno domenica 11 ottobre 2015 21:29:54 UTC+2, Encompass solutions ha
>> scritto:
>>>
>>> I can try it if you want. +1
>>>
>>> On Sun, Oct 11, 2015, 22:21 Francisco Ribeiro 
>>> wrote:
>>>
 Hello all,

 for those who know PyCharm is a great IDE from JetBrains that provides
 free licenses for Open Source projects like web2py (
 https://www.jetbrains.com/buy/opensource/?product=pycharm ). To
 request such a license, I need to know how many of you would want one of
 these as well so I can provide them with a number of seats.

 A "+1" response for me is enough but I will also need your email
 address to send you the license key (which you can send on a private
 message).

 Kind regards,
 Francisco

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+un...@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.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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 + celery + pydal

2015-02-13 Thread Tito Garrido
I just found "auto_import" that is great!

db = DAL('mysql://user:pass@localhost
/datab',folder='path_to/applications/myapp/databases',auto_import=True)

Works great!



On Fri, Feb 13, 2015 at 3:24 PM, Tito Garrido  wrote:

> Hi Folks!
>
> I am working on a project that will require some celery tasks and I would
> like to use pydal to manage the tables created on web2py.
>
> So an example, a simple tw clone... that would use auth_user table +
> references
>
> db.define_table('tweet',
> Field('user_id', 'reference auth_user'),
> Field('post', 'text', requires=IS_NOT_EMPTY()),
> Field('created_on', 'datetime', default=request.now),
> )
>
> db.define_table('follow',
> Field('follower', 'reference auth_user'),
> Field('following', 'reference auth_user'),
> Field('created_on', 'datetime', default=request.now),
> )
>
> How could I use pydal out of web2py? I wouldn't like to maintain 2 db.py
> files... I mean is there a way to make pydal read db.py from web2py and
> avoid double "define_table" statements?
>
> Regards,
>
> Tito
>
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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 + celery + pydal

2015-02-13 Thread Tito Garrido
Hi Folks!

I am working on a project that will require some celery tasks and I would
like to use pydal to manage the tables created on web2py.

So an example, a simple tw clone... that would use auth_user table +
references

db.define_table('tweet',
Field('user_id', 'reference auth_user'),
Field('post', 'text', requires=IS_NOT_EMPTY()),
Field('created_on', 'datetime', default=request.now),
)

db.define_table('follow',
Field('follower', 'reference auth_user'),
Field('following', 'reference auth_user'),
Field('created_on', 'datetime', default=request.now),
)

How could I use pydal out of web2py? I wouldn't like to maintain 2 db.py
files... I mean is there a way to make pydal read db.py from web2py and
avoid double "define_table" statements?

Regards,

Tito


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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

2015-01-19 Thread Tito Garrido
I wouldn't change the name at all... Because it is not related to python
version lets just stay with web2py :)

On Mon, Jan 19, 2015 at 1:03 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> py4web?
>
>
> On Sunday, 18 January 2015 15:22:10 UTC-6, Michele Comitini wrote:
>>
>> the 3 in web3py is not related to python3, just as the 2 was not related
>> to python2.
>>
>> We could skip the 3 and use 4 which is much more meaningful :-)
>>
>> look:
>> web 2(to) py
>> web 4(for) py
>>
>> and compare:
>> web 3(???) py??
>>
>>
>>
>> 2015-01-17 7:22 GMT+01:00 Massimo Di Pierro :
>>
>>> Nothing anytime soon. Stick with web2py if it works for you. It works
>>> for us. ;-)
>>>
>>>
>>> On Friday, 16 January 2015 09:56:32 UTC-6, Manny Felicio wrote:

 Hi Massimo,

 How are you?

 I will be starting a new project, so far I think for may reasons, I
 want to use Python and I like the style of your Web2py.  Since, Web3py is
 already on the air for Python 3 support, Do you think it will be seamless,
 if let's say, I will use web2py now then when web3py is released I will
 upgrade my application? I am also thinking when I can get a full grip of
 Python like what I have in PHP & C++, and as my kids are growing up, I may
 have time to help with your project for the benefit of all.

 Thank you very much for your support.

 Regards,

 Manny

 On Saturday, October 26, 2013 at 8:53:58 PM UTC-6, Massimo Di Pierro
 wrote:
>
> I would not say it is the main "problem". It should be easy to do. It
> was done once already my Mariano for an earlier version.
> It is just that nobody has shown must interest in helping do it. We
> already use a a python 3 compatible syntax.
> After this is converted it needs testing and I am not sure all drivers
> work with python 3.
>
> Massimo
>
>
>
>
>
> On Saturday, 26 October 2013 17:06:33 UTC-5, samuel bonill wrote:
>>
>>
>> the main problem is porting dal.py to python 3.x
>>
>> El viernes, 25 de octubre de 2013 21:26:36 UTC-5, elguavas escribió:
>>>
>>> hi there,
>>>
>>> i've seen peppered throughout this list references to "web3py". i
>>> seems like it's mostly the unofficial name of of a concept at this 
>>> stage,
>>> but i also see references to work being pulled into web2py from 
>>> web3py...
>>> where is this web3py and what's its current state?
>>>
>>> thanks,
>>> e.
>>>
>>>  --
>>> 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.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] Websocket doesn't work on stable version

2015-01-04 Thread Tito Garrido
Hi Folks,

I am using 2.9.11 and when I try to use $.web2py.web2py_websocket('ws://
127.0.0.1:/realtime/mygroup', function(e){alert(e.data)}) I receive
error 403 Forbidden from the server.

Chrome: WebSocket connection to 'ws://127.0.0.1:/realtime/mygroup'
failed: Error during WebSocket handshake: Unexpected response code: 403

Firefox:
Firefox can't establish a connection to the server at ws://127.0.0.1
:/realtime/mygroup.

var ws = new WebSocket(url);


>From python terminal it works:
>> from gluon.contrib.websocket_messaging import websocket_send
>>> websocket_send('http://127.0.0.1:', 'Hello World', 'mykey',
'mygroup')
''
>>>

What am I missing?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Re: How can I from a celery task post a message in websocket_messaging.py?

2015-01-04 Thread Tito Garrido
Cool! Thanks Niphlod!

On Sun, Jan 4, 2015 at 3:40 PM, Niphlod  wrote:

> usually using the same method you'd do in web2py...
>
> from gluon.contrib.websocket_messaging import websocket_send
> websocket_send('http://127.0.0.1:', 'Hello World', 'mykey', 'mygroup')
>
>
> On Saturday, January 3, 2015 9:27:17 PM UTC+1, Tito Garrido wrote:
>>
>> Hey Folks,
>>
>> I am studying websockets and I am wondering how could I post a message
>> from a script that is running outside of web2py, like a celery task.
>> Anybody has an small example?
>>
>> Thanks in advance!
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
> 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.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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 can I from a celery task post a message in websocket_messaging.py?

2015-01-03 Thread Tito Garrido
Hey Folks,

I am studying websockets and I am wondering how could I post a message from
a script that is running outside of web2py, like a celery task. Anybody has
an small example?

Thanks in advance!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] This looks like it needs some web2py love...

2015-01-02 Thread Tito Garrido
+1

On Sat, Dec 7, 2013 at 1:32 PM, Jason (spot) Brower 
wrote:

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



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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: Validator for Unix path

2014-12-31 Thread Tito Garrido
I could figure out :)













*import osclass IS_PATH(object):def __init__(self, error_message='use a
valid unix path'):self.error_message = error_messagedef
__call__(self, value):try:if not
os.path.isabs(value):raise Exception("Invalid
Path")else:return (value, None)
except:return (value, self.error_message)*


On Wed, Dec 31, 2014 at 6:45 PM, Tito Garrido  wrote:

> Hi Folks!
>
> Anybody has built a custom validator for unix paths? I need to validate if
> a path is valid even if the directory/file doesn't exist.
>
> Thanks!
>
> Tito
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] Validator for Unix path

2014-12-31 Thread Tito Garrido
Hi Folks!

Anybody has built a custom validator for unix paths? I need to validate if
a path is valid even if the directory/file doesn't exist.

Thanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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: happy holidays everybody

2014-12-24 Thread Tito Garrido
*Happy holidays! Awesome gift!*

On Wed, Dec 24, 2014 at 2:39 PM, Leonel Câmara 
wrote:

>  Happy holidays everyone!
>
> Great job on the DAL!
>
> --
> 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.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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

2014-12-24 Thread Tito Garrido
HI Massimo,

It is working on a virtual machine using Ubuntu.. this is the steps that I
have followed:

I have built the image and tagged as web2py1 using:

sudo docker build -t web2py1 .

So an image has been generated called "web2py1".

To run in on an exposed port I have ran:

docker run -i -P -t web2py1

I got it running on a random port, like 49153 (it could be changed
using -p 80:80 instead of -P)

The only issue is accessing the admin... seems that the secure
connection is not open...
When I tried https://localhost:49153 it says "Secure conection failed"

Let me know if you need help with the tests... I will try to figure
out how to enable https.

Regards,

Tito


On Tue, Dec 9, 2014 at 4:20 AM, rif  wrote:

> Did you check the Container port redirection section from mac installation
> guide (https://docs.docker.com/installation/mac/)?
>
> If you run a container with an exposed port,
>
> $ docker run --rm -i -t -p 80:80 nginx
>
> then you should be able to access that Nginx server using the IP address
> reported by:
>
> $ boot2docker ip
>
> Typically, it is 192.168.59.103:2375, but VirtualBox's DHCP
> implementation might change this address in the future.
>
> marți, 9 decembrie 2014, 04:29:53 UTC+2, Massimo Di Pierro a scris:
>
>> Could be a firewall. I am using a mac.
>>
>> On Sunday, 7 December 2014 10:02:22 UTC-6, rif wrote:
>>>
>>>   I tested that before I wrote. Are you sure it's not some firewall or
>>> something? What OS did you use?
>>>
>>> duminică, 7 decembrie 2014, 17:59:43 UTC+2, Massimo Di Pierro a scris:

 Done that but no response. :-(

 On Saturday, 6 December 2014 11:37:04 UTC-6, rif wrote:
>
> As far as I can tell the only thing you have to do is to run the
> container like this:
>
> docker run -p 8080:80 web2py
>
> and you will be able to connect at http://localhost:8080
>
> Of course you can change the 8080 to any other port.
>
> -rif
>
> vineri, 5 decembrie 2014, 05:11:22 UTC+2, Massimo Di Pierro a scris:
>>
>> Has anybody here used docker with web2py? I have built a container
>> (docker + web2py + nginx + uwsgi + supervisor) and everything seems to be
>> fine (no errors) except that I cannot connect. I attached the docker 
>> folder
>> in case you can help debug.
>>
>> Massimo
>>
>>
>>  --
> 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.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] Current logged in users

2014-09-17 Thread Tito Garrido
Hi Folks,

Is there a way to list the current logged in users?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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

2014-06-10 Thread Tito Garrido
Hi Massimo,

Would you recommend to setup anything on routes.py? I have the same
question of Carlos...
In my application all users will select a username and a subdomain will be
available
user1.example.com
user2.example.com

Every time that they use this URL it would go to a specific controller
function (default/mypage) using their usernames as arguments but now
showing off (it is not a redirect). Example:

user1.example.com would open default/mypage -> the personal page of this
user
user1.example.com/articles would open default/articles of this user
and so on, without lose the subdomain.

What is the recommended implementation? Use request.env.http_host or
routes.py? If it is routes could you provide a quick example?

Thanks in advance!

Tito




On Tue, Sep 3, 2013 at 7:56 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> This is trivial. You just need a DNS entry for example.com and not for
> the specific domains (this is the default anyway). Than in web2py you read
> the entry from request.env.http_host
>
> If you use apache (you do not have to use apache) make sure you have a
> catch all virtual host 
>
>
> On Monday, 2 September 2013 16:08:02 UTC-5, Carlos Zenteno wrote:
>>
>> Has anybody done Dynamic Subdomains?
>>
>> What I mean:
>> I want each major user of my app to create a Dynamic subdomain when they
>> register, i.e.:
>>  cowboys.example.com
>>  steelers.example.com
>>  dolphins.example.com
>>
>> The user selects the subdomain when registering.
>>
>> I have read that in some frameworks they have to use Apache redirect
>> "magic",
>> and in other ones they use some kind of internal routing.
>>
>> I read the routing section in the book but did not get any clues of how
>> to do this.
>>
>> Any help and advice is greatly appreciated as usual...
>> Carlos\
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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: Here's how to run Web2Py on IBM BlueMix

2014-05-09 Thread Tito Garrido
Hi Duncan,

It is my first time deploying web2py on a PaSS could you please let me know
how to proceed on step 1?
Step 1:

Use the source version of Web2Py and copy the entire lot into a folder
path: 'env/app' so that web2py.py is in the 'app' folder.

Step 2:

You need to have a requirements.txt file in the 'app' folder -- even if it
is empty. (Although you might want to add a single line with just psycopg2,
for example.)

How to access the folder path? I could manage to install cf-cli but I have
no idea how to access this folder path so I can copy the source... Also,
should I do anything to enable python?

Regards,

Tito





On Fri, May 9, 2014 at 10:44 AM, Don O'Hara  wrote:

>
> Very nice “morning report”!  It gives a framework that can  be developed
> into a large paper explaining
> what each term means; the pros/cons of the available options (at this
> point in time);
> motivations for design choices; future technologies to become aware of;
> etc; etc.
>
> Then it can become an O’Reilly book…..!
>
> Don
>
>
>
> On May 9, 2014, at 9:33, duncan macneil  wrote:
>
> On Thursday, 8 May 2014 22:29:31 UTC+10, Willoughby wrote:
>>
>> Is Azure in your shoot-out?  I'd be interested in hearing those results...
>>
>>>

> Hey, woah, I'm the cloud shootout guy now? ;-) Cool!
>
> I have had a small-to-serious look at Azure, Google Compute, Amazon,
> Rackspace, Heroku, etc. There are more serious cloud comparison efforts
> than mine, for sure!
>
> In the end, my prediction is that cloud computing, storage, CDN etc will
> become such a hyper-commodity that your future app-hosting dash will
> instead be via a cloud aggregator.
>
> That future cloud aggregator would report something like:
>
> "Good morning, Dave. Your application 'MyCoolApp' is healthy. It is
> currently running across 4 continents and 17 cloud providers. CDN has been
> weighted to 3 providers based on our 'Gamma' speed/price ratio, last
> updated on Tuesday. One provider was dropped due to a terms-of-service
> change. Your current redundancy profile allows you to drop 1 continent or
> up to 5 providers at any time without business interruption. Your
> application load balancers route to compute-intensive servers in the UK
> between 2:30 and 4:30pm weekdays GMT due to a weekday spike detected for
> which your compute pricing was previously not optimal. Your data is hosted
> on a shared-secrets algorithm model. At least 6 providers would need to
> collaborate in order to decrypt the data they host for you. Your monthly
> fees total is currently 16.2 Cayman Bitcoins, for which you have earned
> 0.001 Frequent SpaceMiles points. Thank you."
>
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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] Anybody has an example of inner join + sum?

2014-04-04 Thread Tito Garrido
Hi,

I am trying to sum a query that is a result of an inner join, the inner
join returns as expected but I am not able to sum, when I put my sum inside
of the select() it returns None.

Do I need to change anything in my sum variable? I am trying:

sum=db.table2.value.sum()
query=db((db.table1.field!=None)&(db.table1.id==db.table2.table1)&(db.table2.field_date.month()==03)).select()
# this works
query=db((db.table1.field!=None)&(db.table1.id==db.table2.table1)&(db.table2.field_date.month()==03)).select(sum)
# this returns None

Regards,

Tito
-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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: Anybody has an example of inner join + sum?

2014-04-04 Thread Tito Garrido
Nevermind I was not using the .first()[sum] at the end :)


On Fri, Apr 4, 2014 at 3:01 PM, Tito Garrido  wrote:

> Hi,
>
> I am trying to sum a query that is a result of an inner join, the inner
> join returns as expected but I am not able to sum, when I put my sum inside
> of the select() it returns None.
>
> Do I need to change anything in my sum variable? I am trying:
>
> sum=db.table2.value.sum()
> query=db((db.table1.field!=None)&(db.table1.id==db.table2.table1)&(db.table2.field_date.month()==03)).select()
> # this works
> query=db((db.table1.field!=None)&(db.table1.id==db.table2.table1)&(db.table2.field_date.month()==03)).select(sum)
> # this returns None
>
> Regards,
>
> Tito
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 
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: Is there a way to set the class in auth.register() form?

2014-02-18 Thread Tito Garrido
thanks!


On Tue, Feb 18, 2014 at 4:20 PM, Anthony  wrote:

> def user:
> form = auth()
> if request.args(0) == 'register':
> form['_class'] = 'myclass'
> return dict(form=form)
>
> Anthony
>
> On Tuesday, February 18, 2014 12:54:46 PM UTC-5, Tito Garrido wrote:
>>
>> Hi Folks,
>>
>> I am trying to customize my registration form. Is there a way to set the
>> class of the generated form of auth.register()?
>>
>> Thanks!
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


[web2py] Is there a way to set the class in auth.register() form?

2014-02-18 Thread Tito Garrido
Hi Folks,

I am trying to customize my registration form. Is there a way to set the
class of the generated form of auth.register()?

Thanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Re: Social Login - Twitter logs out plus some other issues- web2py 2.8.2 / Mac OS X 10.9.1

2014-02-17 Thread Tito Garrido
Hi Luciano,

Did you find a way to use auth.settings.login_form in the controllers? I am
facing the same issue.

Regards,

Tito


On Mon, Dec 23, 2013 at 2:06 PM, Luciano Laporta Podazza <
lucianopoda...@gmail.com> wrote:

> Thanks for the advice Leonel!,
>
> You're totally right, I should change the workflow, for instance, register
> the user using web2py auth and then asking for Facebook/Twitter permissions
> to access their API.
>
> On the other hand, I'm still having some issues if I change the workflow:
> Web2py stores Facebook user's data only if I set *auth.settings.login_form
> *in *db.py *and I trigger /user/login. Otherwise it does not work as
> expected.
>
> This is the code I'm currently using:
> *db.py:*
>
>
> auth_table = db.define_table(
> auth.settings.table_user_name,
> Field('name', length=128, default=""),
> Field('first_name', length=128, default=""),
> Field('last_name', length=128, default=""),
> Field('username', length=128, default="", unique=True),
> Field('password', 'password', length=256, readable=False, label='Password'
> ),
> Field('registration_id', length=128, default= "", writable=False, readable
> =False),
> Field('registration_key', length=128, default= "", writable=False,readable
> =False))
>
>
> auth_table.username.requires = IS_NOT_IN_DB(db, auth_table.username)
> auth.define_tables(username=False, signature=False)
>
>
> ## configure email
> mail = auth.settings.mailer
> mail.settings.server = 'logging' or 'smtp.gmail.com:587'
> mail.settings.sender = 'y...@gmail.com'
> mail.settings.login = 'username:password'
>
>
> ## configure auth policy
> auth.settings.registration_requires_verification = False
> auth.settings.registration_requires_approval = False
> auth.settings.reset_password_requires_verification = True
>
>
> ## Define oauth application id and secret.
> FB_CLIENT_ID='my_id'
> FB_CLIENT_SECRET="my_secret"
>
>
> # import required modules
> try:
> import json
> except ImportError:
> from gluon.contrib import simplejson as json
> from facebook import GraphAPI, GraphAPIError
> from gluon.contrib.login_methods.oauth20_account import OAuthAccount
>
>
>
>
> ## extend the OAUthAccount class
> class FaceBookAccount(OAuthAccount):
> """OAuth impl for FaceBook"""
> AUTH_URL="https://graph.facebook.com/oauth/authorize";
> TOKEN_URL="https://graph.facebook.com/oauth/access_token";
>
>
> def __init__(self):
> OAuthAccount.__init__(self, None, FB_CLIENT_ID, FB_CLIENT_SECRET,
>   self.AUTH_URL, self.TOKEN_URL,
>   scope='email,user_about_me,user_activities,
> user_birthday, user_education_history, user_groups, user_hometown,
> user_interests, user_likes, user_location, user_relationships,
> user_relationship_details, user_religion_politics, user_subscriptions,
> user_work_history, user_photos, user_status, user_videos, publish_actions,
> friends_hometown, friends_location,friends_photos',
>   state="auth_provider=facebook",
>   display='popup')
> self.graph = None
>
>
> def get_user(self):
> '''Returns the user using the Graph API.
> '''
> if not self.accessToken():
> return None
>
>
> if not self.graph:
> self.graph = GraphAPI((self.accessToken()))
>
>
> user = None
> try:
> user = self.graph.get_object("me")
> except GraphAPIError, e:
> session.token = None
> self.graph = None
>
>
> if user:
> if not user.has_key('username'):
> username = user['id']
> else:
> username = user['username']
>
> if not user.has_key('email'):
> email = '%s.fakemail' %(user['id'])
> else:
> email = user['email']
>
>
> return dict(first_name = user['first_name'],
> last_name = user['last_name'],
> username = username,
> email = '%s' %(email) )
>
>
> # auth.settings.login_form=FaceBookAccount()
> crud.settings.auth = None
>
>
> import oauth2 as oauth
> from gluon.contrib.login_methods.oauth10a_account import OAuthAccount as
> OAuthAccount10a
>
>
> consumer_key = "my_key"
> consumer_secret =  "my_secret"
>
>
> class TwitterAccount(OAuthAccount10a):
> AUTH_URL = "http://twitter.com/oauth/authorize";
> TOKEN_URL = "https://twitter.com/oauth/request_token";
> ACCESS_TOKEN_URL = "http://twitter.com/oauth/access_token";
> def __init__(self, g=globals()):
> OAuthAccount10a.__init__(self, g,
>   consumer_key,
>   consumer_secret,
>   self.AUTH_URL,
>   self.TOKEN_URL,
>   self.ACCESS_TOKEN_URL)
>
> def get_user(self):
> if self.accessToken() is not None:
> 

Re: [web2py] Re: Free opensource Janrain alternative - Python Social auth

2014-02-17 Thread Tito Garrido
Do we have any update about this integration?

Thanks!

Tito


On Wed, Jul 31, 2013 at 4:27 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Thank you. Will look at it asap.
>
>
> On Wednesday, 31 July 2013 09:45:39 UTC-5, Quint wrote:
>>
>> I made an attempt to do this myself but i need some expert opinions about
>> it.
>>
>> https://code.google.com/p/web2py/issues/detail?id=1495
>>
>>
>>
>> On Friday, June 21, 2013 11:34:26 AM UTC+2, Leonel Câmara wrote:
>>>
>>> +1 on this one.
>>>
>>> Social login support is a huge pain on the ass. The social network
>>> histrionics change their APIs every month.
>>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Re: Is there a way to use parameters on --run (-R) ?

2014-02-16 Thread Tito Garrido
Thanks!!!


On Sat, Feb 15, 2014 at 1:10 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> python web2py.py -S welcome -M -R tito.py -A param1 param2
>
>
> On Friday, 14 February 2014 16:35:15 UTC-6, Tito Garrido wrote:
>>
>> Hi Folks,
>>
>> Just a simple test... an external script:
>> $: cat tito.py
>> import sys
>> print sys.argv
>>
>> Then running with web2py:
>> $ python web2py.py -S welcome -M -R tito.py param1 param2
>> web2py Web Framework
>> Created by Massimo Di Pierro, Copyright 2007-2014
>> Version 2.8.2-stable+timestamp.2013.11.28.13.54.07
>> Database drivers available: SQLite(sqlite3), MySQL(pymysql),
>> PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc),
>> Ingres(pyodbc), IMAP(imaplib)
>> ['tito.py']
>>
>> *How could I grab the parameters that I need for my script from shell?*
>>
>> Regards,
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


[web2py] Is there a way to use parameters on --run (-R) ?

2014-02-14 Thread Tito Garrido
Hi Folks,

Just a simple test... an external script:
$: cat tito.py
import sys
print sys.argv

Then running with web2py:
$ python web2py.py -S welcome -M -R tito.py param1 param2
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2014
Version 2.8.2-stable+timestamp.2013.11.28.13.54.07
Database drivers available: SQLite(sqlite3), MySQL(pymysql),
PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc),
Ingres(pyodbc), IMAP(imaplib)
['tito.py']

*How could I grab the parameters that I need for my script from shell?*

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Re: Caching selects or use memcache, is it the same?

2014-01-28 Thread Tito Garrido
Thanks!

Tito


On Mon, Jan 27, 2014 at 5:19 PM, Niphlod  wrote:

> memcache is a storage engine that web2py can use to cache selects.
> Both memcache or redis are faster than cache.ram or cache.disk (especially
> with concurrent access): those are "pure-python" solutions embedded in the
> framework.
>
>
> On Monday, January 27, 2014 3:50:36 PM UTC+1, Tito Garrido wrote:
>>
>> Hi Folks,
>>
>> I am planning a new application and I am wondering, should I use memcache
>> instead of cache selects?
>>
>> Do I need to use memcache if I am using cache select? Which one is
>> faster? What is the best practice?
>>
>> The plan is to cache some selects to show in view and get a fast response
>> time.
>>
>> Thanks in advance,
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


[web2py] Caching selects or use memcache, is it the same?

2014-01-27 Thread Tito Garrido
Hi Folks,

I am planning a new application and I am wondering, should I use memcache
instead of cache selects?

Do I need to use memcache if I am using cache select? Which one is faster?
What is the best practice?

The plan is to cache some selects to show in view and get a fast response
time.

Thanks in advance,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


[web2py] Using find on cached queries

2013-12-04 Thread Tito Garrido
Hi Folks,

I have report function that is caching my query, example:
def report():
sites=db(db.site.ativo==True).select(db.site.id
,db.site.nome,cache=(cache.ram,6000),cacheable=True)
lojas=db(db.estoque.ativo==True).select(db.estoque.id
,db.estoque.nome,cache=(cache.ram,6000),cacheable=True)
reports=db(db.report.id
>0).select(groupby=db.report.carro,cache=(cache.ram,6000),cacheable=True)
if request.vars.filtro_site: # WHEN I USE THIS VARIABLE IT GETS SLOW
site=int(request.vars.filtro_site)
testdrives=reports.find(lambda row: site in row.contato.site if
row.contato.site else None)
if request.vars.filtro_loja: # WHEN I USE THIS VARIABLE IT GETS SLOW
loja=int(request.vars.filtro_loja)
testdrives=reports.find(lambda row: loja in row.contato.loja if
row.contato.loja else None)
return
dict(section='relatorio',testdrives=testdrives,lojas=lojas,sites=sites)

So, when I use "request.vars" and the find function it gets pretty slow, is
it using the cache to execute the find function? Most of the time I am
getting timeout from the webserver.

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Web2Py Pages module (basic CMS)

2013-11-19 Thread Tito Garrido
How to install it? I have tried to clone it on my applications directory
but I am having trouble.


On Tue, Nov 19, 2013 at 9:44 AM, Michele Comitini <
michele.comit...@gmail.com> wrote:

> +1!
>
> Will you make a demo on pythonanywhere.com/try-web2py or GAE, for the
> lazy ones of us, that would like to look, but not touch? ;-)
>
> mic
>
>
> 2013/11/19 Ruud Schroen 
>
>> Hi,
>>
>> I'm here to share a great module with you. It's called *web2py-pages*, 
>> created
>> by Formatics  which I'm currently working for.
>> You can download it here: 
>> web2py-pages
>>
>> Pages module for web2py gives you a good starting point for any type of
>> CMS. It features a tree of pages with sluggified (URL friendly) names.
>> Pages can consist out of items.
>>
>> Current page items are:
>>
>>- Markmin text
>>- HTML text
>>- Plain text
>>- Image (with optional Fancybox)
>>- Imageslider
>>- Photoalbum (Google Picasa)
>>- FAQ Address
>>- File upload
>>- Links
>>- and a couple of pre defined forms
>>
>> It also has neat features like:
>>
>>- CKeditor
>>- plugin_tagging
>>- Admin Menu
>>- Easy way to create a test page with all items
>>- Page copy functionality
>>- Functionality to change the order of items displayed
>>- Two columns (left align, right align, full align)
>>- Nivoslider
>>- Fancybox
>>
>> Current available languages:
>>
>>- Dutch (NL)
>>- English (EN)
>>
>> *Download here!* 
>>
>>  --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


[web2py] Suggestion for admin Views section

2013-11-12 Thread Tito Garrido
Hi Folks,

It is just a suggestion, why the views files doesn't collapse like the
files in static section?

I think that folders should collapse so we could easily view just the files
from that folder. I am suggesting because I have a big application using a
lot of views separated by folders and the views section is too big,
sometimes I get lost looking for a view file.

 I guess, if we could collapse folders in the views section would be great.

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


[web2py] Too many tables selected

2013-11-10 Thread Tito Garrido
Hi Folks,

I am trying to execute a simple test in mongodb (it worked on SQLite):
Model:
db.define_table('mytable',
Field('name','string'),
Field('age', 'integer'),
Field('description', 'text'))

db.define_table('another_table',
Field('mytable', 'reference mytable'),
Field('name', 'string'),
Field('description', 'text'))

Controller:
def index():
table=db((db.mytable.id==db.another_table.mytable)).select()
return dict(table=table)

Ticket ID

177.205.253.190.2013-11-10.18-36-12.7a03dad2-ba10-45f0-93b1-958b0f02c843
 Too many tables selected Versão
web2py™ Version
2.7.4-stable+timestamp.2013.10.14.15.16.29  Python Python 2.7.3:
/usr/local/bin/uwsgi (prefix: /usr)  Traceback


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.


Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 217, in restricted

exec ccode in environment
  File "/home/www-data/web2py/applications/bootstrap/controllers/default.py"
,
line 78, in 

  File "/home/www-data/web2py/gluon/globals.py", line 372, in 

self._caller = lambda f: f()

  File "/home/www-data/web2py/applications/bootstrap/controllers/default.py"
,
line 21, in index

table=db((db.mytable.id==db.another_table.mytable)).select()

  File "/home/www-data/web2py/gluon/dal.py", line 10111, in select

return adapter.select(self.query,fields,attributes)

  File "/home/www-data/web2py/gluon/dal.py", line 5552, in select

limitby_limit, limitby_skip = self._select(query, fields, attributes)

  File "/home/www-data/web2py/gluon/dal.py", line 5534, in _select

tablename = self.get_table(query)

  File "/home/www-data/web2py/gluon/dal.py", line 1544, in get_table

raise RuntimeError("Too many tables selected")
RuntimeError: Too many tables selected



This is what I got... Is there any inner join limit on mongodb?

Thanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Re: Loading message using web2py_ajax_page

2013-10-31 Thread Tito Garrido
During the component load it is working, since I am using LOAD() function,
I am trying to refresh the component via a button click using
web2py_ajax_page... I guess there is no way to add a "loading" during the
refresh, right?

Regards,

Tito


On Thu, Oct 31, 2013 at 2:00 PM, Niphlod  wrote:

> use the "content" attribute of the LOAD helper for that
>
>
> http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components
>
>
> On Thursday, October 31, 2013 3:15:24 PM UTC+1, Tito Garrido wrote:
>>
>> Hi Folks,
>>
>> Is there a way to render a loading message while web2py_ajax_page is
>> redering the component?
>>
>>
>> Thanks,
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


[web2py] Loading message using web2py_ajax_page

2013-10-31 Thread Tito Garrido
Hi Folks,

Is there a way to render a loading message while web2py_ajax_page is
redering the component?


Thanks,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Re: How to serve multiple domains and multiple applications on nginx using pattern-based route

2013-10-07 Thread Tito Garrido
This route didn't work for me...
routes_in = ((
(('.*http://demo.ivinh.com.* /*', '/demo')),
 (('.*http://demo1.ivinh.com.* /*', '/demo1'))
))

Not sure it is because I am using uwsgi... it keeps going to the default
website...




On Sat, Oct 5, 2013 at 4:30 PM, Tito Garrido  wrote:

> Thanks!!! I will try!
>
>
> On Fri, Oct 4, 2013 at 11:32 PM, IVINH  wrote:
>
>>
>> Nginx config:
>>
>>
>> server {
>>  listen 80;
>> server_name demo.ivinh.com www.demo.ivinh.com;
>>  include deny_admin.txt;
>> access_log logs/demo.ivinh.com.access.log;
>>  error_log logs/demo.ivinh.com.error.log;
>> location / {
>> proxy_pass http://127.0.0.1:86;
>>  proxy_set_header Host demo.ivinh.com;
>> include proxy.conf;
>>  }}
>>  server {
>> listen 80;
>>  server_name demo1.ivinh.com www.demo1.ivinh.com;
>>  include deny_admin.txt;
>> access_log logs/demo1.ivinh.com.access.log;
>>  error_log logs/demo1.ivinh.com.error.log;
>> location / {
>> proxy_pass http://127.0.0.1:86;
>>  proxy_set_header Host demo1.ivinh.com;
>> include proxy.conf;
>>  }}
>>
>>
>> Web2py routes.py run at 127.0.0.1 port 86:
>>
>>
>> routes_in = ((
>> (('.*http://demo.ivinh.com.* /*', '/demo')),
>>  (('.*http://demo1.ivinh.com.* /*', '/demo1'))
>> ))
>>
>>
>>
>>
>>
>> Vào 06:43:07 UTC+7 Thứ bảy, ngày 05 tháng mười năm 2013, Tito Garrido đã
>> viết:
>>
>>> Hi Folks,
>>>
>>> I am using the default setup from the book for nginx:
>>>
>>> scripts/setup-web2py-nginx-**uwsgi-ubuntu.sh
>>>
>>> And my routes are using *pattern-based* system.
>>>
>>> The question is, how can I route www.domain1.com to app1 and
>>> www.domain2.com to app2?
>>>
>>> nginx config in sites-enabled:
>>>
>>> *server {
>>> listen  80;
>>> server_name $hostname;
>>> ###to enable correct use of response.static_version
>>> location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
>>> alias /home/www-data/web2py/applications/$1/static/$2;
>>> expires max;
>>> }
>>> ###
>>>
>>> ###if you use something like myapp = dict(languages=[en, it,
>>> jp], default_language=en) in your routes.py
>>> #location ~* ^/(\w+)/(en|it|jp)/static/(.*)$ {
>>> #alias /home/www-data/web2py/applications/$1/;
>>> #try_files static/$2/$3 static/$3 =404;
>>> #}
>>> ###
>>> location ~* ^/(\w+)/static/ {
>>> root /home/www-data/web2py/applications/;
>>> #remove next comment on production
>>> expires max;
>>> ### if you want to use pre-gzipped static files (recommended)
>>> ### check scripts/zip_static_files.py and remove the comments
>>> include /etc/nginx/conf.d/web2py/gzip_static.conf;
>>> ###
>>> }
>>> location / {
>>> #uwsgi_pass  127.0.0.1:9001;
>>> uwsgi_pass  unix:///tmp/web2py.socket;
>>> include uwsgi_params;
>>> uwsgi_param UWSGI_SCHEME $scheme;
>>> uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
>>>
>>> ###remove the comments to turn on if you want gzip
>>> compression of your pages
>>> include /etc/nginx/conf.d/web2py/gzip.conf;
>>> ### end gzip section
>>>
>>> ### remove the comments if you use uploads (max 10 MB)
>>> #client_max_body_size 10m;
>>> ###
>>> }
>>> }*
>>>
>>> Thanks in advance!
>>>
>>> Tito
>>> --
>>>
>>> Linux User #387870
>>> .
>>>  _/_õ|__|
>>> ..º[ .-.___.-._| . . . .
>>> .__( o)__( o).:___
>>>
>>  --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Re: How to serve multiple domains and multiple applications on nginx using pattern-based route

2013-10-05 Thread Tito Garrido
Thanks!!! I will try!


On Fri, Oct 4, 2013 at 11:32 PM, IVINH  wrote:

>
> Nginx config:
>
>
> server {
>  listen 80;
> server_name demo.ivinh.com www.demo.ivinh.com;
>  include deny_admin.txt;
> access_log logs/demo.ivinh.com.access.log;
>  error_log logs/demo.ivinh.com.error.log;
> location / {
> proxy_pass http://127.0.0.1:86;
>  proxy_set_header Host demo.ivinh.com;
> include proxy.conf;
>  }}
>  server {
> listen 80;
>  server_name demo1.ivinh.com www.demo1.ivinh.com;
>  include deny_admin.txt;
> access_log logs/demo1.ivinh.com.access.log;
>  error_log logs/demo1.ivinh.com.error.log;
> location / {
> proxy_pass http://127.0.0.1:86;
>  proxy_set_header Host demo1.ivinh.com;
> include proxy.conf;
>  }}
>
>
> Web2py routes.py run at 127.0.0.1 port 86:
>
>
> routes_in = ((
> (('.*http://demo.ivinh.com.* /*', '/demo')),
>  (('.*http://demo1.ivinh.com.* /*', '/demo1'))
> ))
>
>
>
>
>
> Vào 06:43:07 UTC+7 Thứ bảy, ngày 05 tháng mười năm 2013, Tito Garrido đã
> viết:
>
>> Hi Folks,
>>
>> I am using the default setup from the book for nginx:
>>
>> scripts/setup-web2py-nginx-**uwsgi-ubuntu.sh
>>
>> And my routes are using *pattern-based* system.
>>
>> The question is, how can I route www.domain1.com to app1 and
>> www.domain2.com to app2?
>>
>> nginx config in sites-enabled:
>>
>> *server {
>> listen  80;
>> server_name $hostname;
>> ###to enable correct use of response.static_version
>> location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
>> alias /home/www-data/web2py/applications/$1/static/$2;
>> expires max;
>> }
>> ###
>>
>> ###if you use something like myapp = dict(languages=[en, it, jp],
>> default_language=en) in your routes.py
>> #location ~* ^/(\w+)/(en|it|jp)/static/(.*)$ {
>> #alias /home/www-data/web2py/applications/$1/;
>> #try_files static/$2/$3 static/$3 =404;
>> #}
>> ###
>> location ~* ^/(\w+)/static/ {
>> root /home/www-data/web2py/applications/;
>> #remove next comment on production
>> expires max;
>> ### if you want to use pre-gzipped static files (recommended)
>> ### check scripts/zip_static_files.py and remove the comments
>> include /etc/nginx/conf.d/web2py/gzip_static.conf;
>> ###
>> }
>> location / {
>> #uwsgi_pass  127.0.0.1:9001;
>> uwsgi_pass  unix:///tmp/web2py.socket;
>> include uwsgi_params;
>> uwsgi_param UWSGI_SCHEME $scheme;
>> uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
>>
>> ###remove the comments to turn on if you want gzip
>> compression of your pages
>> include /etc/nginx/conf.d/web2py/gzip.conf;
>> ### end gzip section
>>
>> ### remove the comments if you use uploads (max 10 MB)
>> #client_max_body_size 10m;
>> ###
>> }
>> }*
>>
>> Thanks in advance!
>>
>> Tito
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


[web2py] How to serve multiple domains and multiple applications on nginx using pattern-based route

2013-10-04 Thread Tito Garrido
Hi Folks,

I am using the default setup from the book for nginx:

scripts/setup-web2py-nginx-uwsgi-ubuntu.sh

And my routes are using *pattern-based* system.

The question is, how can I route www.domain1.com to app1 and
www.domain2.comto app2?

nginx config in sites-enabled:

*server {
listen  80;
server_name $hostname;
###to enable correct use of response.static_version
location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
alias /home/www-data/web2py/applications/$1/static/$2;
expires max;
}
###

###if you use something like myapp = dict(languages=[en, it, jp],
default_language=en) in your routes.py
#location ~* ^/(\w+)/(en|it|jp)/static/(.*)$ {
#alias /home/www-data/web2py/applications/$1/;
#try_files static/$2/$3 static/$3 =404;
#}
###
location ~* ^/(\w+)/static/ {
root /home/www-data/web2py/applications/;
#remove next comment on production
expires max;
### if you want to use pre-gzipped static files (recommended)
### check scripts/zip_static_files.py and remove the comments
include /etc/nginx/conf.d/web2py/gzip_static.conf;
###
}
location / {
#uwsgi_pass  127.0.0.1:9001;
uwsgi_pass  unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;

###remove the comments to turn on if you want gzip compression
of your pages
include /etc/nginx/conf.d/web2py/gzip.conf;
### end gzip section

### remove the comments if you use uploads (max 10 MB)
#client_max_body_size 10m;
###
}
}*

Thanks in advance!

Tito
-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

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


Re: [web2py] Re: need help to improve download of dynamic images (nginx)

2013-09-25 Thread Tito Garrido
I just got it to work checking the error log from nginx:
location /home/www-data/web2py/applications/YOURAPP/uploads {
internal;
expires max;
include /etc/nginx/conf.d/web2py/gzip.conf;
alias /home/www-data/web2py/applications/YOURAPP/uploads;
}

Cool!

Thanks!

Tito


On Wed, Sep 25, 2013 at 7:15 PM, Niphlod  wrote:

> did you enable it in nginx with the configurations explained in their wiki
> ?
>
>
> On Wednesday, September 25, 2013 5:53:05 PM UTC+2, Tito Garrido wrote:
>
>> Hi Niphlod!
>>
>> I am using nginx as server and when I tried to use:
>>
>> response.headers['X-Accel-**Redirect'] = os.path.join(request.folder,
>> 'uploads', document.file)
>> return ''
>> mine is:
>>
>> *...
>> path = splits[0] + '.' + splits[1] + '/' + splits[2][:2] + '/'
>> global_path = path + image
>> filename = os.path.join(request.folder,'uploads',global_path)
>> response.headers['X-Accel-Redirect'] = filename
>> *
>> *return ''*
>>
>> *filename is returning: "/home/www-data/web2py/
>> applications/indiana/uploads/site.logo_montadora/b6/site.logo_montadora.
>> b67dbafcc4aa040e.666f72642e6a7067.jpg"*
>>
>> It raises error 404. I have checked the path:
>> www-data@li69-46:/$ ls -alh /home/www-data/web2py/**
>> applications/indiana/uploads/**site.logo_montadora/b6/site.**
>> logo_montadora.**b67dbafcc4aa040e.**666f72642e6a7067.jpg
>> -rw-r--r-- 1 www-data www-data 31K Aug 16 11:04 /home/www-data/web2py/**
>> applications/indiana/uploads/**site.logo_montadora/b6/site.**
>> logo_montadora.**b67dbafcc4aa040e.**666f72642e6a7067.jpg
>>
>> And www-data user is able to read it... Am I doing something wrong?
>>
>> Do I need to enable anything on nginx side?
>> 2.5.1-stable+timestamp.2013.**06.06.15.39.19
>> (Running on nginx/1.1.19)
>>
>> Thanks in advance!
>>
>> Tito
>>
>>
>>
>> On Thu, Aug 22, 2013 at 5:31 PM, Niphlod  wrote:
>>
>>> uhm. download() lets web2py stream the file instead of nginx.
>>> fast_download() too, it just skips the part that handles the authorization
>>> logic and adds correct cache headers, but this will lead to faster loading
>>> of pages from the 2nd time the user accesses the page: it won't change a
>>> thing in the 1st request.
>>>
>>> Why don't you just put those images in "static/something" ?
>>>
>>> The other very smart thing to do is using http://wiki.nginx.org/X-accel. 
>>> This basically enables nginx to "intercept" an empty page with some
>>> special headers (so web2py does it without even accessing the file) and
>>> take care of serving the file instead of your application. This will
>>> probably speed up your 1st request (and releaves some pressure from the
>>> web2py process), but the hard-limit of bandwith will of course remain
>>> there, no matter what.
>>>
>>> Your fast download will then kinda look like
>>> def fast_download():
>>> 
>>>
>>> filename = os.path.join(request.folder,'**uploads',request.args(0))
>>>
>>> response.headers['X-Accel-**Redirect'] = os.path.join(request.folder
>>> , 'uploads', document.file)
>>>  return ''
>>>
>>>
>>>
>>> On Thursday, August 22, 2013 10:06:34 PM UTC+2, Adi wrote:
>>>>
>>>>
>>>>
>>>> Hello everyone.
>>>>
>>>> Am trying to populate a page with around 20 dynamic images from the
>>>> upload folder, but they get rendered extremely slow, even as thumbnails.
>>>> Tried using a suggest approach from the forum "fast_download()", but
>>>> without luck in my case.
>>>>
>>>> Anyone has a suggestion, what should I be looking at, and how to
>>>> improve the speed of loading dynamic images?
>>>>
>>>> Platform: clean ubuntu node with web2py and nginx (no caching setup,
>>>> 1Gb of ram). Nothing else is running on it.
>>>>
>>>> Performed following three tests:
>>>>
>>>> Regular download():
>>>> Compressed images (through PIL, with extension .thumbnail):
>>>> http://www.webpagetest.org/**res**ult/130822_1F_WAD/<http://www.webpagetest.org/result/130822_1F_WAD/>(500Kb
>>>>  in 25 sec)
>>>> Regul

Re: [web2py] Re: need help to improve download of dynamic images (nginx)

2013-09-25 Thread Tito Garrido
Hi Niphlod!

I am using nginx as server and when I tried to use:

response.headers['X-Accel-Redirect'] = os.path.join(request.folder,
'uploads', document.file)
return ''
mine is:

*...
path = splits[0] + '.' + splits[1] + '/' + splits[2][:2] + '/'
global_path = path + image
filename = os.path.join(request.folder,'uploads',global_path)
response.headers['X-Accel-Redirect'] = filename
*
*return ''*

*filename is returning:
"/home/www-data/web2py/applications/indiana/uploads/site.logo_montadora/b6/site.logo_montadora.b67dbafcc4aa040e.666f72642e6a7067.jpg"
*

It raises error 404. I have checked the path:
www-data@li69-46:/$ ls -alh
/home/www-data/web2py/applications/indiana/uploads/site.logo_montadora/b6/site.logo_montadora.b67dbafcc4aa040e.666f72642e6a7067.jpg
-rw-r--r-- 1 www-data www-data 31K Aug 16 11:04
/home/www-data/web2py/applications/indiana/uploads/site.logo_montadora/b6/site.logo_montadora.b67dbafcc4aa040e.666f72642e6a7067.jpg

And www-data user is able to read it... Am I doing something wrong?

Do I need to enable anything on nginx side?
2.5.1-stable+timestamp.2013.06.06.15.39.19
(Running on nginx/1.1.19)

Thanks in advance!

Tito



On Thu, Aug 22, 2013 at 5:31 PM, Niphlod  wrote:

> uhm. download() lets web2py stream the file instead of nginx.
> fast_download() too, it just skips the part that handles the authorization
> logic and adds correct cache headers, but this will lead to faster loading
> of pages from the 2nd time the user accesses the page: it won't change a
> thing in the 1st request.
>
> Why don't you just put those images in "static/something" ?
>
> The other very smart thing to do is using http://wiki.nginx.org/X-accel .
> This basically enables nginx to "intercept" an empty page with some special
> headers (so web2py does it without even accessing the file) and take care
> of serving the file instead of your application. This will probably speed
> up your 1st request (and releaves some pressure from the web2py process),
> but the hard-limit of bandwith will of course remain there, no matter what.
>
> Your fast download will then kinda look like
> def fast_download():
> 
>
> filename = os.path.join(request.folder,'uploads',request.args(0))
>
> response.headers['X-Accel-Redirect'] = os.path.join(request.folder,
> 'uploads', document.file)
>  return ''
>
>
>
> On Thursday, August 22, 2013 10:06:34 PM UTC+2, Adi wrote:
>>
>>
>>
>> Hello everyone.
>>
>> Am trying to populate a page with around 20 dynamic images from the
>> upload folder, but they get rendered extremely slow, even as thumbnails.
>> Tried using a suggest approach from the forum "fast_download()", but
>> without luck in my case.
>>
>> Anyone has a suggestion, what should I be looking at, and how to improve
>> the speed of loading dynamic images?
>>
>> Platform: clean ubuntu node with web2py and nginx (no caching setup, 1Gb
>> of ram). Nothing else is running on it.
>>
>> Performed following three tests:
>>
>> Regular download():
>> Compressed images (through PIL, with extension .thumbnail):
>> http://www.webpagetest.org/**result/130822_1F_WAD/(500Kb
>>  in 25 sec)
>> Regular size images: 
>> http://www.webpagetest.org/**result/130822_5K_ZSX/(3Mb
>>  in 26 sec)
>>
>> Fast_Download() with regular size images:
>> http://www.webpagetest.org/**result/130822_C3_1008/(3Mb
>>  in 28 sec)
>>
>> Tried to implement caching in nginx site config, but that disabled images
>> completely, and I couldn't get it to work:
>>
>> #location ~* ^.+\.(jpg|jpeg|gif)$ {
>> #   root /home/www-data/web2py/**applications/;
>> #   access_log   off;
>> #   expires  30d;
>> #}
>>
>> or
>>
>> #location ~* \.(jpg|jpeg|gif|png|css|js|**ico|xml)$ {
>>  #access_log off;
>>  #log_not_found off;
>>  #expires 180d;
>>  #}
>>
>> Fast download used:
>> def fast_download():
>> session.forget(response)
>> cache.action(time_expire=60480**0)(lambda: 0)()
>>
>> # very basic security (only allow fast_download on
>> your_table.upload_field):
>> if not request.args(0).startswith("**product.image"):
>> return download()
>>
>> filename = os.path.join(request.folder,'**uploads',request.args(0))
>>
>> return response.stream(open(filename,**'rb'))
>>
>>
>> Segment of the code that displays the images:
>>
>> 
>> {{if p.image:}}
>> 
>> {{
>> #big_regex = re.compile('|'.join(map(re.**escape,
>> IMAGE_EXTENSIONS)))
>> #tmb_image = big_regex.sub(INDEX_TMB, p.image)
>> }}
>> > alt="{{=product_name}}" href="{{=product_link}}"
>> height="180px" width="160px"/>
>> 
>> 
>> {{pass}}

Re: [web2py] Re: Nice change to admin interface for editing files, what about static files?

2013-08-08 Thread Tito Garrido
Is there a way to collapse this left menu or just remove it? It is now
worse to see the code, we lost a lot of edit area for a menu, I personally
didn't like it. Changes on the interface should be optional, it changes the
way that you use the admin...


On Tue, Aug 6, 2013 at 9:08 AM, Rob_McC  wrote:

>
> I just discovered, it wasn't obvious to me, that the headings will *
> COLLAPSE* the file list.
>
> I also like to
> Cmd- Click
> on a file to open in a NEW tab in my Browser.
>
>
>
> Collapse Feature Example:
> While editing a file, like db.py,
> the menu is:
>
> models
> db.py
> menu.py
>
> controllers
> appadmin.py
> default.py
> views
> __init__.py
> appadmin.html
> default/index.ht
> etc..
>
> Then, click on controllers, the controller files collapse
> models
> db.py
> menu.py
>
> controllers
>
> views
> __init__.py
> appadmin.html
> default/index.ht
> etc.
>
> A very nice improvement to UI. I spend a lot of time playing around with
> web2py, and the ability to edit files quickly in admin is helpful,
> lately, I use Sublime Text 2 as my primary editor, but still play with the
> editing feature inside of web2py.
> http://www.sublimetext.com/
> but, it took me a long time to understand how powerful it is, and that
> installing plugins is essential to productivity,
> it's great for Python, with the correct plugins, and changes the way I
> code.
> https://tutsplus.com/course/improve-workflow-in-sublime-text-2/
>
> Sublime will open up the web2py.app package on my mac, and I see all the
> files there.
>
> R
>
>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] LOAD inside a form

2013-08-08 Thread Tito Garrido
Hi Folks,

I am using a LOAD function to put a ajax form inside of a form. This is to
add videos to a content without need to reload the page...

It works perfectly on firefox but on chrome, IE or Safari none of the forms
works... It seems to ignore the ajax, reloads the pages and no validation
is trigged. I have ser formname on both forms but it doesn't work.

I will try to create a sample app to illustrate the problem, but in
advance, does anybody know what am I doing wrong?

Thanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Fields.Virtual says that the column does not exist in 2.5.1 during record edit

2013-06-26 Thread Tito Garrido
Hi Folks,

After update to 2.5.1 I got this message when I try to update a form with
SQLFORM:
 'Row' object has no attribute 'bom'

db.define_table('video',
Field('titulo', requires=IS_NOT_EMPTY(), unique=True),
Field('tag', 'list:reference tag'),
Field('slug', requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,
'video.slug'),IS_NOT_IN_DB(db,'tag.nome'),IS_SLUG(maxlen=80, check=True,
error_message='Isso não é um SLUG')], unique=True),
Field('duracao', requires=IS_NOT_EMPTY()),
Field('thumb', requires=IS_NOT_EMPTY(), represent = lambda value, row:
XML('')),
Field('bom', 'integer', default=1, writable=False, readable=False),
Field('ruim', 'integer', default=1, writable=False, readable=False),
Field('true_views', 'integer', default=0, writable=False,
readable=False),
Field('postar_em', 'datetime', default=request.now),
Field.Virtual('qualidade', lambda row: "%.0f"
%(float(row.video.bom)/(row.video.bom+row.video.ruim)*100)),
Field('ativo', 'boolean', default=True,),
)

 Function argument list

(row=)

But using video.qualidade on views works... it raises the exception during
form edit...

video=db.video(video_id)
form=SQLFORM(db.video,video,submit_button='Salvar')

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Is there a way to hide a directory from appadmin?

2013-06-06 Thread Tito Garrido
Thanks!
Issue opened:
http://code.google.com/p/web2py/issues/detail?id=1517


On Thu, Jun 6, 2013 at 12:13 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> No but please open a ticket. There should be a cap and eventually it
> should stop listing the files.
>
>
> On Thursday, 6 June 2013 09:51:44 UTC-5, Tito Garrido wrote:
>>
>> Hey Folks,
>>
>> My System has been creating some static files on /myapp/static/afolder/
>>
>> There is more than 1000 directories inside of this folder that is
>> preventing app admin from loading... is there a way to ask appadmin to do
>> not scan this folder?
>>
>> Regards,
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Is there a way to hide a directory from appadmin?

2013-06-06 Thread Tito Garrido
Hey Folks,

My System has been creating some static files on /myapp/static/afolder/

There is more than 1000 directories inside of this folder that is
preventing app admin from loading... is there a way to ask appadmin to do
not scan this folder?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to add class to the TABLE in SQLFORM.grid

2013-05-08 Thread Tito Garrido
Hi Folks,

I could see that all style related variables of SQLFORM.grid applies to the
outside div. How can I style the table element of the SQLFORM.grid?

THanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How can I run multiple applications with multiple domains on nginx?

2013-05-08 Thread Tito Garrido
Hi Peter! It helps a lot! I didn't know that we could have another
routes.py inside the application folder, is it described anywhere in the
book? Thanks!

Tito


On Sat, Mar 23, 2013 at 7:01 AM, peter  wrote:

> Sorry about replying late Tito. I struggled with your problem for quite a
> while, and here is a solution.
>
> In the web2py folder have a routes.py like this
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
> routes_app=[
>  ('.*://www.site1.com:\w* /$anything','app1'),
>  ('.*://site1.com:\w* /$anything','app1'),
>  ('.*://www.site2.com:\w* /$anything','app2'),
>  ('.*://site2.com:\w* /$anything','app2')
> ]
>
> Then in the application folder for app1 have something like
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
> routes_in = ((r'.*://site1.com:\w* /static/$anything',
> r'/app1/static/$anything'),
> (r'.*://site1.com:\w* /$anything', r'/app1/default/$anything'),
> (r'.*://www.site1.com:\w* /static/$anything', r'/app1/static/$anything'),
> (r'.*://www.site1.com:\w* /$anything', r'/app1/default/$anything'),)
> routes_out = (('/app1/default/(?P.*)', '/\g'),)
>
>
> and similarly for app2
>
> I hope this helps
>
> Peter
>
>
> On Thursday, 21 March 2013 16:06:46 UTC, Massimo Di Pierro wrote:
>>
>> Yes you can. From the point of nginx treat all domains as one. the use
>> web2py routes.py to map different domains to different apps.
>>
>> On Monday, 18 March 2013 15:21:25 UTC-5, Tito Garrido wrote:
>>>
>>> Hi Folks,
>>>
>>> I am reading the book section: http://web2py.com/books/**
>>> default/chapter/29/13#Nginx<http://web2py.com/books/default/chapter/29/13#Nginx>
>>>
>>> But I couldn't figure out how could I setup nginx to serve multiple
>>> domains pointing to a different application on the same web2py instance.
>>>
>>> Do you have any example?
>>>
>>> like:
>>> mydomain1 -> /home/www-data/web2py/**applications/myapp1
>>>
>>> mydomain2 -> /home/www-data/web2py/**applications/myapp2
>>>
>>>
>>> Thanks,
>>>
>>> Tito
>>>
>>>
>>> --
>>>
>>> Linux User #387870
>>> .
>>>  _/_õ|__|
>>> ..º[ .-.___.-._| . . . .
>>> .__( o)__( o).:___
>>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to add class to a checkbox?

2013-04-24 Thread Tito Garrido
Hi Folks,

I was reading:
http://web2py.com/books/default/chapter/29/07?search=checkboxes#Widgets

I am trying to implement some checkboxes with a specific class using DIVs:
db.anuncio.equipamento.widget=lambda field,value:
SQLFORM.widgets.checkboxes.widget(field,value,_class="span2",style='divs')

The style parameter works but the _class does not, how can I add class to
my divs?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: IS_IN_DB(...,multiple=True) allowing empty values?

2013-04-23 Thread Tito Garrido
Thanks!


On Tue, Apr 23, 2013 at 1:35 PM, Anthony  wrote:

> IS_IN_DB(..., multiple=(1, 1000))
>
> The multiple argument can be a list/tuple specifying the minimum and
> maximum number of items that can be selected.
>
> Anthony
>
>
> On Tuesday, April 23, 2013 11:24:47 AM UTC-4, Tito Garrido wrote:
>>
>> Hi Folks,
>>
>> I am implementing a list:reference table but it should not allow empty
>> values. How can I do that? I have tried using a list [ ] but I lost my
>> multiselect box, I don't want that, and then I have tried to use _and= but
>> I got
>> 
>>
>> Doesn't allow an empty value shouldn't be default in IS_IN_DB?
>>
>> db.define_table('site',
>> Field('name'),
>> format='%(name)s')
>>
>> db.define_table('another_**table',
>> Field('site', 'list:reference site', requires=IS_IN_DB(db,'site.id'**
>> ,'%(name)s',multiple=True,_**and=IS_NOT_EMPTY())),
>> )
>>
>> Thanks in advance,
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] IS_IN_DB(...,multiple=True) allowing empty values?

2013-04-23 Thread Tito Garrido
Hi Folks,

I am implementing a list:reference table but it should not allow empty
values. How can I do that? I have tried using a list [ ] but I lost my
multiselect box, I don't want that, and then I have tried to use _and= but
I got


Doesn't allow an empty value shouldn't be default in IS_IN_DB?

db.define_table('site',
Field('name'),
format='%(name)s')

db.define_table('another_table',
Field('site', 'list:reference site', requires=IS_IN_DB(db,'site.id
','%(name)s',multiple=True,_and=IS_NOT_EMPTY())),
)

Thanks in advance,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How to use custom forms + SQLFORM.grid?

2013-04-23 Thread Tito Garrido
Hi Jim,

I just figure out that in my form_grid.html I forgot to add a required
field, that was preventing the form submit.

this file has only {{=form.custom.begin}} etc.., just form stuff.

It is working now.

Thanks!


On Tue, Apr 23, 2013 at 12:01 PM, Jim S  wrote:

> Also, what does form_grid.html look like?
>
> -Jim
>
> On Tuesday, April 23, 2013 9:31:07 AM UTC-5, Tito Garrido wrote:
>
>> Hi Folks!
>>
>> I am trying to use a custom form layout when I click on "Add" in a
>> SQLFORM.grid...
>>
>> I could customize it but when I try to create a record nothing happens...
>>
>> What am I doing wrong?
>>
>> def mygrid():
>> form=None
>> grid=SQLFORM.grid(db.mytable,**csv=False,deletable=False,**
>> details=False,user_signature=**False,formname='grid_anuncio')
>> if request.args(0) in ['new']:
>> response.view = 'painel/form_grid.html'
>> form = grid.create_form
>> if request.args(1) in ['edit']:
>> response.view = 'painel/form_grid.html'
>> form = grid.update_form
>>
>> return dict(form=form,grid=grid)
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to use custom forms + SQLFORM.grid?

2013-04-23 Thread Tito Garrido
Hi Folks!

I am trying to use a custom form layout when I click on "Add" in a
SQLFORM.grid...

I could customize it but when I try to create a record nothing happens...

What am I doing wrong?

def mygrid():
form=None

grid=SQLFORM.grid(db.mytable,csv=False,deletable=False,details=False,user_signature=False,formname='grid_anuncio')
if request.args(0) in ['new']:
response.view = 'painel/form_grid.html'
form = grid.create_form
if request.args(1) in ['edit']:
response.view = 'painel/form_grid.html'
form = grid.update_form

return dict(form=form,grid=grid)

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] THUMB function in contrib - bug

2013-04-21 Thread Tito Garrido
I have fixed it adding '/uploads/', this way also works, but it needs to be
fixed in contrib, I guess Massimo can do that.

Regards,

Tito


On Sun, Apr 21, 2013 at 6:45 PM, Ricardo Pedroso wrote:

> On Sun, Apr 21, 2013 at 10:35 PM, Tito Garrido 
> wrote:
> > Hi Folks,
> >
> > I was trying to use THUMB function following Bruno's tutorial for python
> RQ
> > and I got:
> >
> >   File "/root/web2py/gluon/contrib/imageutils.py", line 54, in THUMB
> > img = Image.open(request.folder + 'uploads/' + image)
> >   File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1952, in
> open
> > fp = __builtin__.open(fp, "rb")
> > IOError: [Errno 2] No such file or directory:
> >
> 'applications/rqtestuploads/pictures.picture.b59ca62e585e24c3.31326d702e6a7067.jpg'
> >
> >
> > I am pretty sure that there is a missing "/" on img =
> > Image.open(request.folder + 'uploads/' + image)
>
> try:
> img = Image.open(os.path.join(request.folder, 'uploads', image))
>
>
> Ricardo
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] THUMB function in contrib - bug

2013-04-21 Thread Tito Garrido
Hi Folks,

I was trying to use THUMB function following Bruno's tutorial for python RQ
and I got:

  File "/root/web2py/gluon/contrib/imageutils.py", line 54, in THUMB
img = Image.open(request.folder + 'uploads/' + image)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1952, in open
fp = __builtin__.open(fp, "rb")
IOError: [Errno 2] No such file or directory:
'applications/rqtestuploads/pictures.picture.b59ca62e585e24c3.31326d702e6a7067.jpg'


I am pretty sure that there is a missing "/" on img =
Image.open(request.folder + 'uploads/' + image)

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Export not working on filtered table?

2013-04-15 Thread Tito Garrido
Hi Folks,

When I use the search field to filter the results and click on csv to
export the result I get a 0 byte file... is it happening there?

2.4.6-stable+timestamp.2013.04.06.17.37.38
(Running on Rocket 1.2.6)

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Python Redis Queue

2013-04-15 Thread Tito Garrido
 Nice! Is it working? Is there an example of application?

Thanks!

Tito


On Mon, Dec 31, 2012 at 3:21 AM, Alec Taylor  wrote:

> On Mon, Dec 31, 2012 at 11:37 AM, Bruno Rocha 
> wrote:
> > DONE!!!
> >
> > 1. create a file called web2py-rq.py
> >
> > #!/usr/bin/env python
> > import sys
> > from rq import Queue, Connection, Worker
> >
> > # Preload libraries
> > #import library_that_you_want_preloaded
> >
> > # Provide queue names to listen to as arguments to this script,
> > # similar to rqworker
> > with Connection():
> > qs = map(Queue, sys.argv[1:]) or [Queue()]
> > w = Worker(qs)
> > w.work()
> >
> > 2. start the worker in web2py context
> > python web2py.py -S yourapp -M -R /path/to/web2py-rq.py
> >
> >
> > Now it is easiest to send delayed messages!
> >
> > I will create a slice and will send the script to be included in contrib.
>
> Awesome; can hardly wait :D
>
> --
>
>
>
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] web2py.com down for me...

2013-04-13 Thread Tito Garrido
-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How to create a "doesn't belong" query, is it possible?

2013-04-12 Thread Tito Garrido
Yes Anthony


On Fri, Apr 12, 2013 at 11:33 AM, Anthony  wrote:

> Alan was referring to the placement of the ~ operator -- it prepends the
> Query, not the Set. You probably submitted the following to the grid, right?
>
> SQLFORM.grid(~db.log.severity.belongs((1, 2)), ...)
>
>
> Anthony
>
> On Friday, April 12, 2013 9:51:38 AM UTC-4, Tito Garrido wrote:
>
>> It works here... at least for a SQLFORM.grid
>>
>>
>> On Thu, Apr 11, 2013 at 10:26 PM, Alan Etkin  wrote:
>>
>>> Is that the correct syntax?
>>>
>>> select() returns a Rows object, and I'm not sure that operation is
>>> supported, I tried it in a shell and it throws:
>>>
>>> TypeError: bad operand type for unary ~: 'Rows'
>>>
>>> This instead returns the complement of the record set:
>>>
>>>
>>> >>> db(~db.log.severity.belongs((**1**, 2))).select()
>>>
>>>
>>> I suppose it's a mistyped command.
>>>
>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How to create a "doesn't belong" query, is it possible?

2013-04-12 Thread Tito Garrido
It works here... at least for a SQLFORM.grid


On Thu, Apr 11, 2013 at 10:26 PM, Alan Etkin  wrote:

> Is that the correct syntax?
>
> select() returns a Rows object, and I'm not sure that operation is
> supported, I tried it in a shell and it throws:
>
> TypeError: bad operand type for unary ~: 'Rows'
>
> This instead returns the complement of the record set:
>
>
> >>> db(~db.log.severity.belongs((**1, 2))).select()
>
>
> I suppose it's a mistyped command.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to create a "doesn't belong" query, is it possible?

2013-04-10 Thread Tito Garrido
Just figured out:

~db(db.log.severity.belongs((1, 2))).select()

Thanks!


On Wed, Apr 10, 2013 at 10:11 PM, Tito Garrido wrote:

> Hi Folks,
>
> How can I negate:
>
> db(db.log.severity.belongs((1, 2))).select()
>
>
> I'd like to create a grid with records that does not belong to a specific
> list...
>
> Regards,
>
> Tito
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to create a "doesn't belong" query, is it possible?

2013-04-10 Thread Tito Garrido
Hi Folks,

How can I negate:

db(db.log.severity.belongs((1, 2))).select()


I'd like to create a grid with records that does not belong to a specific
list...

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How to benchmark my web2py website? I have got scary results :-/

2013-04-07 Thread Tito Garrido
Thanks Ales!




On Sun, Apr 7, 2013 at 2:22 AM, LightDot  wrote:

> Well, It seems that terra.com.br's firewall and/or web server's security
> mechanisms got you... You can't blame them, they likely have reasonably
> good protections against DOS attacks and you probably forgot to tell them
> to turn these off so you could "test" their site... LOL... Seriously,  I
> hope you at least limited the ab to a *very* small number of attempts and
> minimal bandwidth...
>
> For testing your own site, this is exactly what you don't want to happen.
> You want load testing programs to see as much content as possible and you
> want them to mimic the live traffic as realistically as possible. Sadly,
> this is pretty hard to achieve. When testing web2py apps, I've had better
> results from siege than ab.
>
> Regards,
> Ales
>
>
>
> On Saturday, April 6, 2013 11:40:12 PM UTC+2, Tito Garrido wrote:
>
>> Got it... I have noticed that some big websites like terra.com.br when I
>> run ab against their "home line" returns just some kbytes causing a very
>> fast response, How could I do that?
>>
>>
>> On Sat, Apr 6, 2013 at 4:46 PM, Brian M  wrote:
>>
>>>  +1 on the quality/speed of the connection you test from making a big
>>> difference. I was testing a new server last week and got vastly different
>>> results from office #1 vs office #2 because one had a much lower bandwidth
>>> and made the server being tested look pathetic.
>>>
>>> On Saturday, April 6, 2013 8:13:44 AM UTC-5, Niphlod wrote:
>>>>
>>>> wait a sec. you're launching ab from your "home line" to a server
>>>> hosted somewhere ?
>>>> Launch it from the server itself, or another server in the same
>>>> facility !
>>>> You're reading back results that are dependant on all the loops of the
>>>> net wired from your "home" to the server :D
>>>>
>>>> These is my benchmark from Italy to a linode 512 in london, web2py +
>>>> postgresql + nginx 1.2.3.
>>>> Sadly, my home connection goes as far as 300 KB/sec
>>>>
>>>> Concurrency Level:  20
>>>> Time taken for tests:   25.609 seconds
>>>> Complete requests:  500
>>>> Failed requests:0
>>>> Write errors:   0
>>>> Total transferred:  6635000 bytes
>>>> HTML transferred:   6431000 bytes
>>>> Requests per second:19.52 [#/sec] (mean)
>>>> Time per request:   1024.363 [ms] (mean)
>>>> Time per request:   51.218 [ms] (mean, across all concurrent
>>>> requests)
>>>> Transfer rate:  253.02 [Kbytes/sec] received
>>>>
>>>> Connection Times (ms)
>>>>   min  mean[+/-sd] median   max
>>>> Connect:  292  597 460.64447359
>>>> Processing:   226  405 177.83491432
>>>> Waiting:  226  405 177.83491432
>>>> Total:606 1002 507.78077666
>>>>
>>>> Percentage of the requests served within a certain time (ms)
>>>>   50%807
>>>>   66%904
>>>>   75%   1103
>>>>   80%   1213
>>>>   90%   1721
>>>>   95%   2001
>>>>   98%   2308
>>>>   99%   2403
>>>>  100%   7666 (longest request)
>>>>
>>>>
>>>>
>>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How to benchmark my web2py website? I have got scary results :-/

2013-04-06 Thread Tito Garrido
Got it... I have noticed that some big websites like terra.com.br when I
run ab against their "home line" returns just some kbytes causing a very
fast response, How could I do that?


On Sat, Apr 6, 2013 at 4:46 PM, Brian M  wrote:

> +1 on the quality/speed of the connection you test from making a big
> difference. I was testing a new server last week and got vastly different
> results from office #1 vs office #2 because one had a much lower bandwidth
> and made the server being tested look pathetic.
>
> On Saturday, April 6, 2013 8:13:44 AM UTC-5, Niphlod wrote:
>>
>> wait a sec. you're launching ab from your "home line" to a server hosted
>> somewhere ?
>> Launch it from the server itself, or another server in the same facility
>> !
>> You're reading back results that are dependant on all the loops of the
>> net wired from your "home" to the server :D
>>
>> These is my benchmark from Italy to a linode 512 in london, web2py +
>> postgresql + nginx 1.2.3.
>> Sadly, my home connection goes as far as 300 KB/sec
>>
>> Concurrency Level:  20
>> Time taken for tests:   25.609 seconds
>> Complete requests:  500
>> Failed requests:0
>> Write errors:   0
>> Total transferred:  6635000 bytes
>> HTML transferred:   6431000 bytes
>> Requests per second:19.52 [#/sec] (mean)
>> Time per request:   1024.363 [ms] (mean)
>> Time per request:   51.218 [ms] (mean, across all concurrent requests)
>> Transfer rate:  253.02 [Kbytes/sec] received
>>
>> Connection Times (ms)
>>   min  mean[+/-sd] median   max
>> Connect:  292  597 460.64447359
>> Processing:   226  405 177.83491432
>> Waiting:  226  405 177.83491432
>> Total:606 1002 507.78077666
>>
>> Percentage of the requests served within a certain time (ms)
>>   50%807
>>   66%904
>>   75%   1103
>>   80%   1213
>>   90%   1721
>>   95%   2001
>>   98%   2308
>>   99%   2403
>>  100%   7666 (longest request)
>>
>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Is there a way to cache images from "download" function?

2013-04-06 Thread Tito Garrido
Now it works! I just changed the return function to return
response.stream(open(filename,'rb')) :D

Thanks folks!

PS: How to use @client-cache? :)

Regards,

Tito


On Sat, Apr 6, 2013 at 1:36 PM, Tito Garrido  wrote:

> Hi Folks!
>
> Thanks for your answers but my implementation is a little bit different so
> none of the solutions above worked, I have tried to adapt the slice
> solution but it didn't work also, here is my "download" function, I am
> using the name of the files instead of the hash name (I am also using
> upload separated = True:
>
> def images():
> ''' get the image using its name
> param1 = table
> param2 = type (image,thumb,minithumb,logo,banner)
> param3 = name '''
> import os,time
> tabela =  request.args(0)
> tipo = request.args(1)
> nome_imagem = request.args(2)
> if tabela == 'artista':
> row = db.artista(image_filename=nome_imagem)
> image=row[tipo]
> elif tabela == 'personagem':
> row = db.personagem(image_filename=nome_imagem)
> image=row[tipo]
> elif tabela == 'novela':
> if tipo == 'logo':
> row = db.novela(logo_filename=nome_imagem)
> elif tipo == 'banner':
> row = db.novela(banner_filename=nome_imagem)
> image=row[tipo]
> if not image:
> raise HTTP(404)
> else:
> request.args.append(image)
> response.headers['Cache-Control'] = "max-age=604800" *# it is still
> showing Cache-Control=0*
> #del response.headers['Pragma'] *# error, Pragma key not available*
> #del response.headers['Expires'] *# error, Expires key not available*
> splits = image.split('.')
> path = splits[0] + '.' + splits[1] + '/' + splits[2][:2] + '/'
> global_path = path + image
> filename = os.path.join(request.folder,'uploads',global_path)
> # send last modified date/time so client browser can enable
> client-side caching
> response.headers['Last-Modified'] = time.strftime("%a, %d %b %Y
> %H:%M:%S +", time.localtime(os.path.getmtime(filename)))
> return response.download(request,db)
>
> I am pretty syre that  I am missing something here... using @cache-client
> raised an "argument missing error", 0 given 1 expected...
>
> How can I change my function to works with cache?
>
> Thanks!
>
> Tito
>
>
>
> On Sat, Apr 6, 2013 at 11:19 AM, Niphlod  wrote:
>
>> cache.client (when no cache_model is passed) just sets headers (that's
>> the idea at the bottom).
>> When you pass a cache_model, it sets headers AND cache the results (and
>> that's the "idea at the top").
>>
>> cache.client was created in the first place to avoid having to set
>> headers repeatedly.
>>
>> There's no "improvement" to look for caching the results of a download()
>> ^_^
>>
>>
>> On Saturday, April 6, 2013 3:23:22 PM UTC+2, Massimo Di Pierro wrote:
>>>
>>> Does that work for download? Download returns a stream not a string.
>>>
>>> On Saturday, 6 April 2013 06:48:55 UTC-5, Niphlod wrote:
>>>>
>>>> there's a new @cache.client decorator to set expire headers in an easy
>>>> way 
>>>> as soon as the book gets updated the docs will be here
>>>> http://web2py.com/books/**default/chapter/29/04#cache<http://web2py.com/books/default/chapter/29/04#cache>
>>>>
>>>> On Saturday, April 6, 2013 11:58:17 AM UTC+2, BlueShadow wrote:
>>>>>
>>>>> There supposedly is a way the fast download function(web2pyslices)
>>>>> def fast_download():
>>>>># very basic security (only allow fast_download on
>>>>> your_table.upload_field):
>>>>>if not request.args(0).startswith("**db.your_table.your_field"):
>>>>>return download()
>>>>># remove/add headers that prevent/favors client-side caching
>>>>>    #7days
>>>>>response.headers['Cache-**Control'] = "max-age=604800"
>>>>>del response.headers['Pragma']
>>>>>del response.headers['Expires']
>>>>>filename = os.path.join(request.folder,'**uploads',request.args(0))
>>>>># send last modified date/time so client browser can enable
>>>>> client-side caching
>>>>

Re: [web2py] Re: Is there a way to cache images from "download" function?

2013-04-06 Thread Tito Garrido
Hi Folks!

Thanks for your answers but my implementation is a little bit different so
none of the solutions above worked, I have tried to adapt the slice
solution but it didn't work also, here is my "download" function, I am
using the name of the files instead of the hash name (I am also using
upload separated = True:

def images():
''' get the image using its name
param1 = table
param2 = type (image,thumb,minithumb,logo,banner)
param3 = name '''
import os,time
tabela =  request.args(0)
tipo = request.args(1)
nome_imagem = request.args(2)
if tabela == 'artista':
row = db.artista(image_filename=nome_imagem)
image=row[tipo]
elif tabela == 'personagem':
row = db.personagem(image_filename=nome_imagem)
image=row[tipo]
elif tabela == 'novela':
if tipo == 'logo':
row = db.novela(logo_filename=nome_imagem)
elif tipo == 'banner':
row = db.novela(banner_filename=nome_imagem)
image=row[tipo]
if not image:
raise HTTP(404)
else:
request.args.append(image)
response.headers['Cache-Control'] = "max-age=604800" *# it is still
showing Cache-Control=0*
#del response.headers['Pragma'] *# error, Pragma key not available*
#del response.headers['Expires'] *# error, Expires key not available*
splits = image.split('.')
path = splits[0] + '.' + splits[1] + '/' + splits[2][:2] + '/'
global_path = path + image
filename = os.path.join(request.folder,'uploads',global_path)
# send last modified date/time so client browser can enable client-side
caching
response.headers['Last-Modified'] = time.strftime("%a, %d %b %Y
%H:%M:%S +", time.localtime(os.path.getmtime(filename)))
return response.download(request,db)

I am pretty syre that  I am missing something here... using @cache-client
raised an "argument missing error", 0 given 1 expected...

How can I change my function to works with cache?

Thanks!

Tito



On Sat, Apr 6, 2013 at 11:19 AM, Niphlod  wrote:

> cache.client (when no cache_model is passed) just sets headers (that's the
> idea at the bottom).
> When you pass a cache_model, it sets headers AND cache the results (and
> that's the "idea at the top").
>
> cache.client was created in the first place to avoid having to set headers
> repeatedly.
>
> There's no "improvement" to look for caching the results of a download()
> ^_^
>
>
> On Saturday, April 6, 2013 3:23:22 PM UTC+2, Massimo Di Pierro wrote:
>>
>> Does that work for download? Download returns a stream not a string.
>>
>> On Saturday, 6 April 2013 06:48:55 UTC-5, Niphlod wrote:
>>>
>>> there's a new @cache.client decorator to set expire headers in an easy
>>> way 
>>> as soon as the book gets updated the docs will be here
>>> http://web2py.com/books/**default/chapter/29/04#cache<http://web2py.com/books/default/chapter/29/04#cache>
>>>
>>> On Saturday, April 6, 2013 11:58:17 AM UTC+2, BlueShadow wrote:
>>>>
>>>> There supposedly is a way the fast download function(web2pyslices)
>>>> def fast_download():
>>>># very basic security (only allow fast_download on
>>>> your_table.upload_field):
>>>>if not request.args(0).startswith("**db.your_table.your_field"):
>>>>return download()
>>>># remove/add headers that prevent/favors client-side caching
>>>>#7days
>>>>response.headers['Cache-**Control'] = "max-age=604800"
>>>>del response.headers['Pragma']
>>>>del response.headers['Expires']
>>>>filename = os.path.join(request.folder,'**uploads',request.args(0))
>>>># send last modified date/time so client browser can enable
>>>> client-side caching
>>>>response.headers['Last-**Modified'] = time.strftime("%a, %d %b %Y
>>>> %H:%M:%S +", time.localtime(os.path.getmtim**e(filename)))
>>>>
>>>>return response.stream(open(filename,**'rb'))
>>>>
>>>> this is the version I'm experimenting with. the original had a del
>>>> Cache Control instead of the max age. but google pagespeed still tells me
>>>> that no expiration date is set.
>>>>
>>>>
>>>> On Saturday, April 6, 2013 4:42:45 AM UTC+2, Tito Garrido wrote:
>>>>>
>>>>> Hi!
>>>

[web2py] Is there a way to cache images from "download" function?

2013-04-05 Thread Tito Garrido
Hi!

I was running page speed on my website and all image files from the
database (upload folder) are not cached...
Is there a way to enable cache for them?

Thanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to benchmark my web2py website? I have got scary results :-/

2013-04-05 Thread Tito Garrido
Hi Folks!

I am trying to use ab to benchmark my website that is hosted on linode
(512MB RAM) using nginx + mysql + web2py, installed via the install script
provided in the book.

Should I point ab to my index? I have been running some tests and the
results are scary...

Server Software:nginx/1.1.19
Server Port:80

Document Path:  /
Document Length:385313 bytes

Concurrency Level:  20
Time taken for tests:   329.128 seconds
Complete requests:  1000
Failed requests:980
   (Connect: 0, Receive: 0, Length: 980, Exceptions: 0)
Write errors:   0
Total transferred:  385586379 bytes
HTML transferred:   385290379 bytes
Requests per second:3.04 [#/sec] (mean)
Time per request:   6582.563 [ms] (mean)
Time per request:   329.128 [ms] (mean, across all concurrent requests)
Transfer rate:  1144.08 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:  172  216  58.52131423
Processing:  3037 6337 1605.4   6233   13805
Waiting:  305  387 132.03692046
Total:   3270 6553 1609.1   6438   14012

Percentage of the requests served within a certain time (ms)
  50%   6438
  66%   7089
  75%   7516
  80%   7776
  90%   8652
  95%   9288
  98%  10138
  99%  11540
 100%  14012 (longest request)

I know that it is a complex question, but what can I do to improve the
performance of my website? I have followed the recommendations from the
but, I have put migration=False etc...

Thanks in advance,

Tito


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Help on fake_migration

2013-04-05 Thread Tito Garrido
Hi Folks!

I am trying to migrate my web2py application from one server to another.

I have pack my application and restored the MYSQL database but when I tried
to run it there I got:
InternalError: (1050, u"Table 'auth_user' already
exists")
I have followed
http://web2py.com/books/default/chapter/29/06?search=fake_#Fixing-broken-migrations

but when I try to use fake_migration I got
504 Gateway Time-out
--
nginx/1.1.19


How can I fix it?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Why compute does not work to get image filename?

2013-03-27 Thread Tito Garrido
It would work, but if I delete a record and then add a new one it would get
the wrong id :-/


On Wed, Mar 27, 2013 at 6:40 PM, Niphlod  wrote:

> when dealing with first() or last(), remember that those come AFTER the
> select() ... when you do select().first() you're really fetching all from
> the db and discarding all but one row.
>
> The time difference may be negligible with a few records, but if you have
> lots of them, stick with limitby=(0,1) and orderby=field or orderby=~field
>
>
> On Wednesday, March 27, 2013 10:34:25 PM UTC+1, Roberto Perdomo wrote:
>
>> Sorry, the function must be return a string in order to concatenate with
>> the  filename
>> El mar 27, 2013 4:59 PM, "Roberto Perdomo"  escribió:
>>
>>>  And what about something like this:
>>>
>>> Field('image_filename', readable=False, writable=False, compute = lambda
>>> row: request.post_vars.image.**filename + next_id())
>>>
>>> def next_id():
>>> last_row = db().select(db.table.id).last(**)
>>> last_id = int(last_row[`table.id`])
>>> return last_id + 1
>>>
>>> This was written from my cel phone and dont test it but  hope that helps
>>> ;-)
>>>  El mar 27, 2013 3:25 PM, "Roberto Perdomo" 
>>> escribió:
>>>
>>>>  :-S
>>>> I was thinking on represent attribute from fields, not compute.
>>>> El mar 27, 2013 3:07 PM, "Niphlod"  escribió:
>>>>
>>>> boys . how can the id be present if what you're trying to insert is
>>>>> not yet a row in a table 
>>>>>
>>>>> On Wednesday, March 27, 2013 8:18:38 PM UTC+1, Roberto Perdomo wrote:
>>>>>>
>>>>>> Ummm, the id is readable?
>>>>>>
>>>>>> db.table.id.readable = True
>>>>>> El mar 27, 2013 12:55 PM, "Tito Garrido" 
>>>>>> escribió:
>>>>>>
>>>>>>> I just checked... id is not present:
>>>>>>> ">>>>>> b2754a53c6cd**cc7e.**69626d2d4c6f676f2e6a7067.**jpg', 'novela':
>>>>>>> '9', 'slug': '', 'descricao': ''}>"
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Mar 27, 2013 at 2:24 PM, Roberto Perdomo >>>>>> > wrote:
>>>>>>>
>>>>>>>> Try:
>>>>>>>>
>>>>>>>> Field('image_filename', readable=False, writable=False, compute =
>>>>>>>> lambda row: request.post_vars.image.**filena**me + row.id),
>>>>>>>> El mar 27, 2013 12:39 PM, "Tito Garrido" 
>>>>>>>> escribió:
>>>>>>>>
>>>>>>>> How could I also append the id of the row in image_filename?
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>>
>>>>>>>>> Tito
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, Mar 25, 2013 at 4:58 PM, Tito Garrido 
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Worked! It should go to the book :) http://web2py.com/books/**
>>>>>>>>>> defaul**t/chapter/29/07#Storing-**the-**original-filename<http://web2py.com/books/default/chapter/29/07#Storing-the-original-filename>
>>>>>>>>>>
>>>>>>>>>> Thanks!
>>>>>>>>>>
>>>>>>>>>> Tito
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, Mar 25, 2013 at 4:53 PM, Massimo Di Pierro <
>>>>>>>>>> massimo@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> You can use this:
>>>>>>>>>>>  Field('image_filename', readable=False, writable=False, compute
>>>>>>>>>>> = lambda row: request.post_vars.image.**filena**me),
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Monday, 25 March 2013 13:28:19 UTC-5, Tito Garrido wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi!
>>>>&g

Re: [web2py] Re: Why compute does not work to get image filename?

2013-03-27 Thread Tito Garrido
I just checked... id is not present:
""


On Wed, Mar 27, 2013 at 2:24 PM, Roberto Perdomo wrote:

> Try:
>
> Field('image_filename', readable=False, writable=False, compute = lambda
> row: request.post_vars.image.filename + row.id),
> El mar 27, 2013 12:39 PM, "Tito Garrido"  escribió:
>
> How could I also append the id of the row in image_filename?
>>
>> Thanks!
>>
>> Tito
>>
>>
>> On Mon, Mar 25, 2013 at 4:58 PM, Tito Garrido wrote:
>>
>>> Worked! It should go to the book :)
>>> http://web2py.com/books/default/chapter/29/07#Storing-the-original-filename
>>>
>>> Thanks!
>>>
>>> Tito
>>>
>>>
>>> On Mon, Mar 25, 2013 at 4:53 PM, Massimo Di Pierro <
>>> massimo.dipie...@gmail.com> wrote:
>>>
>>>> You can use this:
>>>>  Field('image_filename', readable=False, writable=False, compute =
>>>> lambda row: request.post_vars.image.filename),
>>>>
>>>>
>>>> On Monday, 25 March 2013 13:28:19 UTC-5, Tito Garrido wrote:
>>>>>
>>>>> Hi!
>>>>>
>>>>> Why this does not work:
>>>>> Field('image', 'upload', requires=IS_NOT_EMPTY(), uploadseparate=True,
>>>>> autodelete=True,),
>>>>> Field('image_filename', readable=False, writable=False, compute =
>>>>> lambda row: row.image.filename),
>>>>>
>>>>> Using a form I can follow the book and fill the image filename:
>>>>> if request.vars.image!=None:
>>>>> try:
>>>>> form.vars.image_filename = request.vars.image.filename
>>>>> except:
>>>>> form.vars.image_filename = request.vars.image
>>>>>
>>>>> How can I do the same using SQLFORM.grid?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Tito
>>>>>
>>>>> --
>>>>>
>>>>> Linux User #387870
>>>>> .
>>>>>  _/_õ|__|
>>>>> ..º[ .-.___.-._| . . . .
>>>>> .__( o)__( o).:___
>>>>>
>>>>  --
>>>>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "web2py-users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to web2py+unsubscr...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> Linux User #387870
>>> .
>>>  _/_õ|__|
>>> ..º[ .-.___.-._| . . . .
>>> .__( o)__( o).:___
>>>
>>
>>
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Why compute does not work to get image filename?

2013-03-27 Thread Tito Garrido
How could I also append the id of the row in image_filename?

Thanks!

Tito


On Mon, Mar 25, 2013 at 4:58 PM, Tito Garrido  wrote:

> Worked! It should go to the book :)
> http://web2py.com/books/default/chapter/29/07#Storing-the-original-filename
>
> Thanks!
>
> Tito
>
>
> On Mon, Mar 25, 2013 at 4:53 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> You can use this:
>>  Field('image_filename', readable=False, writable=False, compute = lambda
>> row: request.post_vars.image.filename),
>>
>>
>> On Monday, 25 March 2013 13:28:19 UTC-5, Tito Garrido wrote:
>>>
>>> Hi!
>>>
>>> Why this does not work:
>>> Field('image', 'upload', requires=IS_NOT_EMPTY(), uploadseparate=True,
>>> autodelete=True,),
>>> Field('image_filename', readable=False, writable=False, compute =
>>> lambda row: row.image.filename),
>>>
>>> Using a form I can follow the book and fill the image filename:
>>> if request.vars.image!=None:
>>> try:
>>> form.vars.image_filename = request.vars.image.filename
>>> except:
>>> form.vars.image_filename = request.vars.image
>>>
>>> How can I do the same using SQLFORM.grid?
>>>
>>> Regards,
>>>
>>> Tito
>>>
>>> --
>>>
>>> Linux User #387870
>>> .
>>>  _/_õ|__|
>>> ..º[ .-.___.-._| . . . .
>>> .__( o)__( o).:___
>>>
>>  --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Why compute does not work to get image filename?

2013-03-25 Thread Tito Garrido
Worked! It should go to the book :)
http://web2py.com/books/default/chapter/29/07#Storing-the-original-filename

Thanks!

Tito


On Mon, Mar 25, 2013 at 4:53 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> You can use this:
>  Field('image_filename', readable=False, writable=False, compute = lambda
> row: request.post_vars.image.filename),
>
>
> On Monday, 25 March 2013 13:28:19 UTC-5, Tito Garrido wrote:
>>
>> Hi!
>>
>> Why this does not work:
>> Field('image', 'upload', requires=IS_NOT_EMPTY(), uploadseparate=True,
>> autodelete=True,),
>> Field('image_filename', readable=False, writable=False, compute =
>> lambda row: row.image.filename),
>>
>> Using a form I can follow the book and fill the image filename:
>> if request.vars.image!=None:
>> try:
>> form.vars.image_filename = request.vars.image.filename
>> except:
>> form.vars.image_filename = request.vars.image
>>
>> How can I do the same using SQLFORM.grid?
>>
>> Regards,
>>
>> Tito
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Why compute does not work to get image filename?

2013-03-25 Thread Tito Garrido
Hi!

Why this does not work:
Field('image', 'upload', requires=IS_NOT_EMPTY(), uploadseparate=True,
autodelete=True,),
Field('image_filename', readable=False, writable=False, compute =
lambda row: row.image.filename),

Using a form I can follow the book and fill the image filename:
if request.vars.image!=None:
try:
form.vars.image_filename = request.vars.image.filename
except:
form.vars.image_filename = request.vars.image

How can I do the same using SQLFORM.grid?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Help on a web2py query

2013-03-23 Thread Tito Garrido
Yes, you got it...


On Sat, Mar 23, 2013 at 9:33 AM, Niphlod  wrote:

> so, you want the last 3 capitulo rows, for each novela, and for each row
> you want to retrieve also all the data from the novela "attached" to each
> capitulo.all in a single select ?
>
>
> On Friday, March 22, 2013 11:41:06 PM UTC+1, Tito Garrido wrote:
>
>> db.define_table('novela',
>> Field('nome', requires=IS_NOT_EMPTY()),
>> Field('emissora', 'reference emissora', requires = IS_IN_DB(db,
>> db.emissora.id,'%(**nome)s')),
>> Field('encerrada', 'boolean', default=False),
>> Field('slug', requires=IS_SLUG()),
>> Field('logo', 'upload', uploadseparate=True, autodelete=True),
>> Field('banner', 'upload', uploadseparate=True, autodelete=True),
>> Field('sinopse', 'text', requires=IS_NOT_EMPTY()),
>> Field('data_de_inicio', 'date', requires =
>> IS_DATE(format=T('%d/%m/%Y'), error_message='must be DD/MM/!')),
>> Field('data_de_fim', 'date', requires = IS_DATE(format=T('%d/%m/%Y'),
>> error_message='must be DD/MM/!')),
>> )
>>
>>
>> db.define_table('capitulo',
>> Field('novela', 'reference novela', requires = IS_IN_DB(db,
>> db.novela.id,'%(**nome)s')),
>> Field('data_de_exibicao', 'date', default=datetime.date.today(),
>> requires = IS_DATE(format=T('%d/%m/%Y'), error_message='must be
>> DD/MM/!')),
>> Field('titulo', requires=IS_NOT_EMPTY()),
>> Field('resumo', 'text'),
>> )
>>
>> I would like to select the 3 last "capitulos" ordered by
>> "data_de_exibicao", but it must be from different "novela"
>>
>>  This works:
>> db.executesql("SELECT * FROM (SELECT * FROM capitulo WHERE
>> data_de_exibicao >= CURDATE() ORDER BY data_de_exibicao) AS c INNER JOIN
>> novela n ON c.novela = n.id WHERE encerrada = false GROUP BY c.novela
>> limit 0,3;",as_dict=True)
>>
>> But I would lose the ability to get something like:
>>
>> capitulo.novela.logo
>>
>> Is there a way to execute the query above using DAL?
>>
>> Regards,
>>
>> Tito
>>
>>
>>
>>
>> On Fri, Mar 22, 2013 at 7:19 PM, Niphlod  wrote:
>>
>>> written as it is, in a view :P
>>>
>>> we need models, test data and the resultset you want returned, plase
>>> ^_^
>>>
>>>
>>> On Friday, March 22, 2013 11:00:12 PM UTC+1, Tito Garrido wrote:
>>>>
>>>> Folks,
>>>>
>>>> How could I implement:
>>>>
>>>> SELECT * FROM (SELECT * FROM capitulo WHERE data >= CURDATE() ORDER BY
>>>> data) WHERE encerrada = false GROUP BY c.cod_anothertable
>>>>
>>>> Regards,
>>>>
>>>> Tito
>>>> --
>>>>
>>>> Linux User #387870
>>>> .
>>>>  _/_õ|__|
>>>> ..º[ .-.___.-._| . . . .
>>>> .__( o)__( o).:___
>>>>
>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Help on a web2py query

2013-03-22 Thread Tito Garrido
db.define_table('novela',
Field('nome', requires=IS_NOT_EMPTY()),
Field('emissora', 'reference emissora', requires = IS_IN_DB(db,
db.emissora.id,'%(nome)s')),
Field('encerrada', 'boolean', default=False),
Field('slug', requires=IS_SLUG()),
Field('logo', 'upload', uploadseparate=True, autodelete=True),
Field('banner', 'upload', uploadseparate=True, autodelete=True),
Field('sinopse', 'text', requires=IS_NOT_EMPTY()),
Field('data_de_inicio', 'date', requires =
IS_DATE(format=T('%d/%m/%Y'), error_message='must be DD/MM/!')),
Field('data_de_fim', 'date', requires = IS_DATE(format=T('%d/%m/%Y'),
error_message='must be DD/MM/!')),
)


db.define_table('capitulo',
Field('novela', 'reference novela', requires = IS_IN_DB(db,db.novela.id
,'%(nome)s')),
Field('data_de_exibicao', 'date', default=datetime.date.today(),
requires = IS_DATE(format=T('%d/%m/%Y'), error_message='must be
DD/MM/!')),
Field('titulo', requires=IS_NOT_EMPTY()),
Field('resumo', 'text'),
)

I would like to select the 3 last "capitulos" ordered by
"data_de_exibicao", but it must be from different "novela"

This works:
db.executesql("SELECT * FROM (SELECT * FROM capitulo WHERE data_de_exibicao
>= CURDATE() ORDER BY data_de_exibicao) AS c INNER JOIN novela n ON
c.novela = n.id WHERE encerrada = false GROUP BY c.novela limit
0,3;",as_dict=True)

But I would lose the ability to get something like:

capitulo.novela.logo

Is there a way to execute the query above using DAL?

Regards,

Tito




On Fri, Mar 22, 2013 at 7:19 PM, Niphlod  wrote:

> written as it is, in a view :P
>
> we need models, test data and the resultset you want returned, plase
> ^_^
>
>
> On Friday, March 22, 2013 11:00:12 PM UTC+1, Tito Garrido wrote:
>>
>> Folks,
>>
>> How could I implement:
>>
>> SELECT * FROM (SELECT * FROM capitulo WHERE data >= CURDATE() ORDER BY
>> data) WHERE encerrada = false GROUP BY c.cod_anothertable
>>
>> Regards,
>>
>> Tito
>> --
>>
>> Linux User #387870
>> .
>>  _/_õ|__|
>> ..º[ .-.___.-._| . . . .
>> .__( o)__( o).:___
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Help on a web2py query

2013-03-22 Thread Tito Garrido
Folks,

How could I implement:

SELECT * FROM (SELECT * FROM capitulo WHERE data >= CURDATE() ORDER BY
data) WHERE encerrada = false GROUP BY c.cod_anothertable

Regards,

Tito
-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Webfaction out of memory? Hardly seems possible

2013-03-21 Thread Tito Garrido
I am also having memory issues on dreamhost VPS... only 3 people accessing
it...


On Thu, Mar 21, 2013 at 4:46 PM, Cliff Kachinske  wrote:

> Can anyone shed light on this?
>
> Webfaction shut me down this morning at a very inconvenient time, claiming
> that I had exceeded my 256 Meg of memory.
>
> The had an output from ps -u ... that supposedly showed my 5 Apache
> workers had consumed ~ 50 meg each.
>
> I don't see how this is possible.  The site has been in operation one
> week.  I'm the only one who has used it for testing.
>
> I know Apache child processes grow with each request, but they start out
> at 4096 bytes and there were fewer than 3000 lines in all the log files
> added together.
>
> That averages out to an average growth of 85 kB per request.
>
> Thanks,
> Cliff Kachinske
>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How can I run multiple applications with multiple domains on nginx?

2013-03-18 Thread Tito Garrido
Hi Folks,

I am reading the book section:
http://web2py.com/books/default/chapter/29/13#Nginx

But I couldn't figure out how could I setup nginx to serve multiple domains
pointing to a different application on the same web2py instance.

Do you have any example?

like:
mydomain1 -> /home/www-data/web2py/applications/myapp1

mydomain2 -> /home/www-data/web2py/applications/myapp2


Thanks,

Tito


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Is Dreamhost passenger a good option for production?

2013-03-15 Thread Tito Garrido
Hi Folks!

I used to have a shared host on dreamhost using passenger wsgi but I got
some memory issue and transferred my website to their VPS.

What is the best option for production on a VPS? We are using 300MB RAM
account, all select are cached using cache mem...

I can see some spikes and the website is not even in production yet, I am
worried if we had about 500 people online at the same time would be an
issue...

Any tip is appreciated!

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to hide the controller from the url using URL() function

2013-03-07 Thread Tito Garrido
Hi folks,

I have put some info on my routes.py:
default_application = 'myapp'# ordinarily set in base routes.py
default_controller = 'default'  # ordinarily set in app-specific routes.py
default_function = 'index'  # ordinarily set in app-specific routes.py

I can see that the URL function does not use the application name anymore,
but it is still showing the controller name... how can I hide it too?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] How can I avoid 2 different users to run the same function at the same time?

2013-03-04 Thread Tito Garrido
Hi Ron,

Thanks for you response, I need this because I have a function that clear a
table, read a bunch of local files and import it into the database. I just
want to avoid 2 people cleaning the table or maybe people querying the
table while it is being updated...


On Mon, Mar 4, 2013 at 10:10 PM, Ron McOuat  wrote:

> One possibility is to use a lock file. Look for portalocker.py in the
> gluon directory and the Session class which uses portalocker.py for use.
> Needing this functionality should be rare, multiple requests run on
> different threads so no collisions in the controller should occur. The
> database should keep multiple requests separated. If I could ask what
> requires this maybe there is a better way than a lock file or a way to
> avoid the problem. Using a lock file can lead to serious contention
> depending on how many users and the duration of the lock.
>
> Ron
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How can I avoid 2 different users to run the same function at the same time?

2013-03-04 Thread Tito Garrido
Hi Folks,

I would like to avoid 2 different users to run the same function while the
it is already running.

Example:
User 1 is running my_function, while it is running, if User 2 tries to run
it the application should warn that it is already in execution

Thanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: web2py 2.4.2 is OUT

2013-03-04 Thread Tito Garrido
Is SQLFORM.grid translatable now? :)

Thanks!

Tito


On Mon, Mar 4, 2013 at 5:07 PM, Niphlod  wrote:

> ps: version check fails because it expects
>
> version (date) stable/dev
>
> instead of the current format
>
> Version 2.4.2 (stable) 2013-03-04 03:26:21
>
>
> On Monday, March 4, 2013 5:13:34 PM UTC+1, Niphlod wrote:
>>
>> git tags are not published 
>> https://github.com/web2py/**web2py/tags.
>>  did you issue git push --tags ?
>>
>> On Monday, March 4, 2013 5:11:27 PM UTC+1, Massimo Di Pierro wrote:
>>>
>>> we are using hg tags, git tags, and semantic versioning.
>>>
>>> On Monday, 4 March 2013 01:50:31 UTC-6, Paolo valleri wrote:

 Good works, I will try it later today.
 I don't know if you have already discussed about that, just in case, I
 would suggest to start the use of git tags so it will be easier to update
 web2py and keep track of the different releases.

 Paolo

 On Monday, March 4, 2013 7:58:19 AM UTC+1, Massimo Di Pierro wrote:
>
> That is not the expected behavior.
> I will check what is going on but the more info you can provide the
> better.
>
>
> On Sunday, 3 March 2013 23:09:22 UTC-6, Monte Milanuk wrote:
>>
>> So... running 2.3.2 on Windows 7 and Ubuntu 12.10... on both when I
>> click the 'Check for Upgrades' button in the admin dashboard, I get a
>> message 'Unable to check for upgrades' that replaces the button, and is a
>> link to web2py.com.
>>
>> Is that the expected behavior?
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to set the form id on a custom form?

2013-02-16 Thread Tito Garrido
Hi Folks!

I am trying to set an id on a custom form but it does not work, I have
tryed:
form['_id']='myform'
form.custom['id'] = 'myform'
form.custom['_id'] = 'myform'
form.custom.id = 'myform'
form.custom._id = 'myform'

The first one works if I do not use custom forms... So how can I set it to
a custom form?

Thanks!

Tito
-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Trying to use dropdown plugin but it does not work

2013-02-13 Thread Tito Garrido
Hi Folks,

I am trying to use the dropdown plugin from:
http://web2py.com/plugins/default/dropdown

And I am getting
 name 'PluginDropdown' is not defined

Is it still supported? Is there any other better alternative?


Thanks!


Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] How to clear just some fields on keepvalues=True?

2013-02-13 Thread Tito Garrido
How to clear just some fields on keepvalues=True?

Thanks!

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Custom form does not show the extra field of a SQLFORM

2013-02-13 Thread Tito Garrido
Hi Folks,

I am trying to add a hidden field on a SQLFORM like this:
*form=SQLFORM(db.produto)
tags = TR(INPUT(_name='tags_hidden',value=True,_type='hidden'))
form[0].insert(-1,tags)*

{{=form.custom.widget}} it does not show this extra field:
,
'preco_custo': , 'tipo':
, 'tags': , 'preco_venda': ,
'observacao': , 'estoque_max':
, 'fornecedor': , 'unidade': ,
'codigo': , 'ativo':
, 'id': '', 'descricao':
}>

Is it expected?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: how to support video in an app

2013-02-07 Thread Tito Garrido
How to set the width and height of the embed video using expand_one?


On Sat, Feb 2, 2013 at 12:00 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Sorry my bad:
>
> {{=XML(expand_one('http://www.**youtube.com/watch?v=**
> 7yvt2Pt6LRA',cache.ram('**mycache',lambda:dict(),3600))
> )}**}
>
> expand one converts to HTML but then is must be wrapped into XML else it
> gets escaped.
>
>
> On Friday, 1 February 2013 19:10:12 UTC-6, sasogeek wrote:
>>
>> when the page loads and i click on view page source, here's what's
>> there...
>>
>>