Re: [web2py] Embed Plotly Express in Web2PY

2024-01-25 Thread Al Ex
in controller
```
import plotly.express as px

def my_view():
# Assuming df_dataframe is your Pandas DataFrame
fig = px.line(df_dataframe, x="datetime", y="load_avg_fifteen")

# Convert the figure to HTML
plotly_chart = fig.to_html(full_html=False, include_plotlyjs='cdn')

return dict(plotly_chart=plotly_chart)
```

in view


{{extend 'layout.html'}}


{{=XML(plotly_chart)}}



It should work


On January 26, 2024 at 13:01:01, Jitun John (jitun.j...@gmail.com) wrote:

I would like to embed something on the following lines  import
plotly.express as px fig = px.line(df_dataframe, x="datetime",
y="load_avg_fifteen") show it in html page similar to
At present I am using HighCharts js, but as I totally work on pandas
dataframes.. I imagine it is far more efficient and easier using plotly. I
am trying to avoid a heck lot of Javascript code that I am not good with.
Chart should still be interactive.

-- 
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/CAKC%3DaX6ftbRtjx%3Dc5sewSRpZ7n7kHESFJJfNmAxsGPZfYP3y%2BQ%40mail.gmail.com.


Re: [web2py] Re: app not loading external python library

2023-10-27 Thread Al Ex
pip install urllib3_secure_extra

in my virtual env solved the problem.

Thank you Tom for pointing to the solution, I had missed that thread.


On October 27, 2023 at 16:59:18, Tom Clerckx (tcler...@gmail.com) wrote:

I think this is the same issue as was discussed a few months ago:
See this thread:
https://groups.google.com/g/web2py/c/xYVWpDGLuzY/m/t9sBabWOAgAJ

Seems some issue between the custom importer and the urllib3 module.
Can you  try once more, but also explicitly pip install *urllib3_secure_extra
*in your virtual env?




On Thursday, October 26, 2023 at 7:33:25 AM UTC+2 Massimo Di Pierro wrote:

> Hello Alex,
>
> thank for reporting this problem. Is it only occurring with web2py 2.25.1?
>
> On Monday, 23 October 2023 at 14:05:15 UTC-7 alex wrote:
>
>> Hi,
>>
>> I am running web2py Version 2.25.1-stable in virtualenv (python 3.9.5, it
>> happens also in python 3.10.10)
>>
>> After activating the virtualenv, I installed requests
>>
>> $ pip install request
>> $ pip show requests
>> Name: requests
>> Version: 2.31.0
>> Summary: Python HTTP for Humans.
>> Home-page: https://requests.readthedocs.io
>> Author: Kenneth Reitz
>> Author-email: m...@kennethreitz.org
>> License: Apache 2.0
>> Location:
>> /Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages
>> Requires: certifi, charset-normalizer, idna, urllib3
>> Required-by:
>>
>> Importing requests from bpython gives no errors.
>>
>> Importing requests in myapp gives an error.
>> I also tried with other external libraries, some of them do work, some
>> others cannot be imported.
>>
>> About this case, I have tried the following:
>>
>> In "web2py/applications/myapp/models/0.py":
>>
>> # - - - - - - - - - - - - - - -
>>
>> # added the virtualenv path to sys.path
>>
>> site_package_path =
>> "/Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages"
>>
>> if site_package_path not in sys.path:
>> sys.path.append(site_package_path)
>>
>> try:
>> import requests
>> except:
>> raise Exception('import error: "requests" not found')
>>
>>
>> # - - - - - - - - - - - - - - -
>>
>> I am running web2py with:
>>
>> $python web2py.py -a 'pwd'
>>
>> Error log:
>>
>> # - - - - - - - - - - - - - - -
>> Ticket ID
>> 127.0.0.1.2023-10-24.05-48-51.a557dcfb-55a3-4063-ac27-879cad8fe799
>>
>>  import error: "requests" not found
>> Version
>> web2py™ Version 2.25.1-stable+timestamp.2023.10.08.18.44.43
>> Python Python 3.9.5: /Users/z/dev/web2py/.direnv/python-3.9/bin/python
>> (prefix: /Users/z/dev/web2py/.direnv/python-3.9)
>>
>> ...
>>
>> Traceback (most recent call last):
>>   File "/Users/z/dev/web2py/gluon/custom_import.py", line 78, in
>> custom_importer
>> result = sys.modules[modules_prefix]
>> KeyError: 'applications.wh.modules.requests'
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "/Users/z/dev/web2py/applications/wh/models/0.py", line 29, in
>> 
>> import requests
>>   File "/Users/z/dev/web2py/gluon/custom_import.py", line 80, in
>> custom_importer
>> raise ImportError("No module named %s" % modules_prefix)
>> ImportError: No module named applications.wh.modules.requests
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "/Users/z/dev/web2py/gluon/restricted.py", line 219, in restricted
>> exec(ccode, environment)
>>   File "/Users/z/dev/web2py/applications/wh/models/0.py", line 31, in
>> 
>> raise Exception('import error: "requests" not found')
>> Exception: import error: "requests" not found
>> Error snapshot help
>> Exception(import error: "requests" not found)
>>
>> inspect attributes
>>
>> Exception instance attributes
>> __cause__ None
>> __class__ 
>> __context__ ImportError('No module named
>> applications.wh.modules.requests')
>> __delattr__ 
>> __dict__ {}
>> __dir__ 
>> __doc__ 'Common base class for all non-exit exceptions.'
>> __eq__ 
>> __format__ 
>> __ge__ 
>> __getattribute__ 
>> __gt__ 
>> __hash__ 
>> __init__ 
>> __init_subclass__ 
>> __le__ 
>> __lt__ 
>> __ne__ 
>> __new__ 
>> __reduce__ 
>> __reduce_ex__ 
>> __repr__ 
>> __setattr__ 
>> __setstate__ 
>> __sizeof__ 
>> __str__ 
>> __subclasshook__ 
>> __suppress_context__ False
>> __traceback__ 
>> args ('import error: "requests" not found',)
>> with_traceback 
>> Frames
>> File /Users/z/dev/web2py/gluon/restricted.py in restricted at line 219
>> code arguments variables
>>
>> File /Users/z/dev/web2py/applications/wh/models/0.py in  at line
>> 31 code arguments variables
>>
>> Function argument list
>> ()
>>
>> Context locals
>>
>> ...
>>
>>
>> 
>> iteritems :
>> >
>> local_import :
>> .>
>> myconf :
>> {'app': {'name': 'WH', 'author': 'Your Name > 'bootstrap3_inline', 'separator': ''}}
>> redirect :
>> 
>> reduce :
>> 
>> request :
>> ,
>> '_custom_import_track_changes': True}>
>> response :
>> > 'view': 'default/index.html'}>
>> session :
>> 
>> site_package_path :
>> 

[web2py] test message

2023-10-24 Thread Al Ex
Hi Jim, this is a test message

-- 
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/CAKC%3DaX6pLTQqpWJGG-b%2Bd3tHRQn5qOQHRabMAmKbDAvT4LMGdw%40mail.gmail.com.


[web2py] app not loading external python library

2023-10-23 Thread Al Ex
Hi,

I am running web2py Version 2.25.1-stable in virtualenv (python 3.9.5, it
happens also in python 3.10.10)

After activating the virtualenv, I installed requests

$ pip install request
$ pip show requests
Name: requests
Version: 2.31.0
Summary: Python HTTP for Humans.
Home-page: https://requests.readthedocs.io
Author: Kenneth Reitz
Author-email: m...@kennethreitz.org
License: Apache 2.0
Location: /Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages
Requires: certifi, charset-normalizer, idna, urllib3
Required-by:

Importing requests from bpython gives no errors.

Importing requests in myapp gives an error.
I also tried with other external libraries, some of them do work, some
others cannot be imported.

About this case, I have tried the following:

In "web2py/applications/myapp/models/0.py":

# - - - - - - - - - - - - - - -

# added the virtualenv path to sys.path

site_package_path =
"/Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages"

if site_package_path not in sys.path:
sys.path.append(site_package_path)

try:
import requests
except:
raise Exception('import error: "requests" not found')


# - - - - - - - - - - - - - - -

I am running web2py with:

$python web2py.py -a 'pwd'

Error log:

# - - - - - - - - - - - - - - -
Ticket ID
127.0.0.1.2023-10-24.05-48-51.a557dcfb-55a3-4063-ac27-879cad8fe799

 import error: "requests" not found
Version
web2py™ Version 2.25.1-stable+timestamp.2023.10.08.18.44.43
Python Python 3.9.5: /Users/z/dev/web2py/.direnv/python-3.9/bin/python
(prefix: /Users/z/dev/web2py/.direnv/python-3.9)

...

Traceback (most recent call last):
  File "/Users/z/dev/web2py/gluon/custom_import.py", line 78, in
custom_importer
result = sys.modules[modules_prefix]
KeyError: 'applications.wh.modules.requests'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/z/dev/web2py/applications/wh/models/0.py", line 29, in

import requests
  File "/Users/z/dev/web2py/gluon/custom_import.py", line 80, in
custom_importer
raise ImportError("No module named %s" % modules_prefix)
ImportError: No module named applications.wh.modules.requests

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/z/dev/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File "/Users/z/dev/web2py/applications/wh/models/0.py", line 31, in

raise Exception('import error: "requests" not found')
Exception: import error: "requests" not found
Error snapshot help
Exception(import error: "requests" not found)

inspect attributes

Exception instance attributes
__cause__ None
__class__ 
__context__ ImportError('No module named applications.wh.modules.requests')
__delattr__ 
__dict__ {}
__dir__ 
__doc__ 'Common base class for all non-exit exceptions.'
__eq__ 
__format__ 
__ge__ 
__getattribute__ 
__gt__ 
__hash__ 
__init__ 
__init_subclass__ 
__le__ 
__lt__ 
__ne__ 
__new__ 
__reduce__ 
__reduce_ex__ 
__repr__ 
__setattr__ 
__setstate__ 
__sizeof__ 
__str__ 
__subclasshook__ 
__suppress_context__ False
__traceback__ 
args ('import error: "requests" not found',)
with_traceback 
Frames
File /Users/z/dev/web2py/gluon/restricted.py in restricted at line 219 code
arguments variables

File /Users/z/dev/web2py/applications/wh/models/0.py in  at line 31
code arguments variables

Function argument list
()

Context locals

...



iteritems :
>
local_import :
.>
myconf :
{'app': {'name': 'WH', 'author': 'Your Name 
reduce :

request :
,
'_custom_import_track_changes': True}>
response :

session :

site_package_path :
"'/Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages'"
sys :

to_bytes :

to_native :

track_changes :

xmlescape :

xrange :

session
response
body :
<_io.StringIO object at 0x10509de50>
cookies :
session_id_wh :
127.0.0.1-3599de20-98fe-4a6f-a572-aa7d12f28231
comment :
domain :
expires :
httponly :
max-age :
path :
/
samesite :
secure :
version :
delimiters :
{{
}}
files :
flash :
form_label_separator :
:
formstyle :
table3cols
generic_patterns :
*
headers :
X-Powered-By :
web2py
menu :
meta :
models_to_run :
^\w+\.py$
^default/\w+\.py$
^default/index/\w+\.py$
postprocessing :
session_client :
127.0.0.1
session_cookie_compression_level :
None
session_cookie_expires :
None
session_data_name :
session_data_wh
session_file :
None
session_filename :
/Users/z/dev/web2py/applications/wh/sessions/127.0.0.1-3599de20-98fe-4a6f-a572-aa7d12f28231
session_hash :
af8c96c5e9a768088deb3555c108286d
session_id :
127.0.0.1-3599de20-98fe-4a6f-a572-aa7d12f28231
session_id_name :
session_id_wh
session_masterapp :
wh
session_new :
True
session_storage_type :
file
status :
200
view :
default/index.html
In file: /Users/z/dev/web2py/applications/wh/models/0.py
1.
 at 0x103f03a80, file
"/Users/z/dev/web2py/applications/wh/models/0.py", line 1>

# - - - - - - - - - - - - - - -

Any hints?

Thank you

-- 
Resources:
- 

[web2py] AssertionError: Header names/values must be of type str

2023-10-23 Thread Al Ex
Hi, Running web2py in virtualenviroment (python 3.9.5, it happens also in
python 3.10.10)



ERROR:Rocket.Errors.Thread-3:Traceback (most recent call last):

  File "/Users/z/dev/web2py/gluon/rocket.py", line 1294, in run
self.run_app(conn)

  File "/Users/z/dev/web2py/gluon/rocket.py", line 1796, in run_app
output = self.app(environ, self.start_response)

  File "/Users/z/dev/web2py/gluon/main.py", line 648, in app_with_logging
ret[0] = wsgiapp(environ, responder2)

  File "/Users/z/dev/web2py/gluon/main.py", line 562, in wsgibase
return http_response.to(responder, env=env)

  File "/Users/z/dev/web2py/gluon/http.py", line 129, in to
responder(status, rheaders)

  File "/Users/z/dev/web2py/gluon/main.py", line 643, in responder2
return responder(s, h)

  File "/Users/z/dev/web2py/gluon/rocket.py", line 1759, in start_response
self.header_set = Headers(response_headers)

  File "/Users/z/.pyenv/versions/3.9.5/lib/python3.9/wsgiref/headers.py",
line 39, in __init__
self._convert_string_type(v)

  File "/Users/z/.pyenv/versions/3.9.5/lib/python3.9/wsgiref/headers.py",
line 45, in _convert_string_type
raise AssertionError("Header names/values must be"

AssertionError: Header names/values must be of type str (got 50)


Any hints?
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAKC%3DaX5qpHSYoGerKL_MMtB1ihrhrf%3Dmt8ftduMUVTZkHOHbrw%40mail.gmail.com.


Re: [web2py] Re: left outer join

2022-02-20 Thread Al Ex
Thank you

But what if the left join is made on an arbitrary select, not an already
defined table?
Maybe I am missing something evident




On February 20, 2022 at 18:15:50, jonatha...@whatho.net (
jonathan.cl...@whatho.net) wrote:

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Left-outer-join

On Saturday, 19 February 2022 at 02:48:35 UTC alex wrote:

> Hi,
>
> How can I reproduce this LEFT OUTER JOIN in PyDAL ?
>
>
> SELECT name
> FROM doc
>
> LEFT JOIN (
>
> SELECT name
> FROM X
> INNER JOIN ...
> WHERE ...
> ) T ON ( T.name = name)
>
> WHERE
> T.name IS NULL
>
>
> --
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/3e47a5ea-6048-4ea6-a376-b150083a7c31n%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/CAKC%3DaX7WPgAYJdcdU9CaJvQfRWCRgutWzezW8gFh32xkjGAGkQ%40mail.gmail.com.


[web2py] left outer join

2022-02-18 Thread Al Ex
Hi,

How can I reproduce this LEFT OUTER JOIN in PyDAL ?


SELECT name
FROM doc

LEFT JOIN (

SELECT name
FROM X
INNER JOIN ...
WHERE ...
) T ON ( T.name = name)

WHERE
T.name IS NULL

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAKC%3DaX7kOjs%2Bjk6bCgG7rQ64%3D-vZmFvSiVZHbm9Y6FG3rQCGBw%40mail.gmail.com.


Re: [web2py] Autocomplete widget match middle of word

2018-09-17 Thread Al Ex
SQLFORM.widgets.autocomplete has the parameter: at_beginning that you can
set to False


https://web2py.readthedocs.io/en/latest/_modules/gluon/sqlhtml.html#AutocompleteWidget

widget = SQLFORM.widgets.autocomplete(request, ..., at_beginning=False,
)




On September 15, 2018 at 10:15:25 PM, Anders Meyer (meyer.and...@gmail.com)
wrote:

Hello- I'm using the autocomplete widget to make sure that the user chooses
among names in a database (containing about 300 entries). Right now, the
autocomplete only matches from the beginning of the word, but I need it to
be able to match from any position in the word, similar to what jquery
allows. Any suggestions for how to do this? Many thanks!
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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


[web2py] Fwd: multiple SUM IF in a single DAL

2018-06-27 Thread Al Ex
It seems it did not show up in the list yet.


On June 22, 2018 at 16:46:48, Al Ex (a22...@gmail.com) wrote:

Is there a way to translate into a single DAL this sql query?


SELECT

SUM(IF(is_a = 'T',1,0)) as a,

SUM(IF(is_b = 'T',1,0)) as b

FROM table;


It counts the times is_a and is_b are True.
Fields 'is_a' and 'is_b’ have been declared in DAL as boolean.

Thank you

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


[web2py] multiple SUM IF in a single DAL

2018-06-22 Thread Al Ex
Is there a way to translate into a single DAL this sql query?


SELECT

SUM(IF(is_a = 'T',1,0)) as a,

SUM(IF(is_b = 'T',1,0)) as b

FROM table;


It counts the times is_a and is_b are True.
Fields 'is_a' and 'is_b' are declared in DAL as boolean.

Thank you

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


Re: [web2py] auth.settings.actions_disabled.append('register')

2018-03-10 Thread Al Ex
What about removing this:

{{=T('Sign up')}}

from layout.html?


On March 11, 2018 at 4:42:52, Andrea Fae' (and...@gmail.com) wrote:

Sometimes problems arises. I need to eliminate "sign up" menu item from
LOGIN but nevertheless I inserted this line

auth.settings.actions_disabled.append('register')

or this

auth.settings.actions_disabled = ['register']

in the db.py I can see the item in the menu, and when I click I see "404
NOT FOUND" page.

One time only this line could delete this menu item.

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

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


Re: [web2py] new style of welcome app

2018-03-09 Thread Al Ex
Probably, you also need to add "dropdown-menu-right" to this:




Final:




For explanations see:
https://v4-alpha.getbootstrap.com/components/dropdowns/#menu-alignment


On March 5, 2018 at 2:12:54, Andrea Fae' (and...@gmail.com) wrote:

I have different apps in my web2py environments. Web2py apps built before a
certain date have a stile with "login" link in the right upper side of the
web page, while the new apps, for example welcome app are with another
style with login link anchor in the left side, just after the menus, and
after a "search" box. Why?
How to delete the search box and have the login in the right part of the
page?
Thanks
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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


Re: [web2py] Re: new style of welcome app

2018-03-09 Thread Al Ex
In layout.html, instead of



you can try:






On March 9, 2018 at 05:12:50, Andrea Fae' (and...@gmail.com) wrote:

Yes, I clear the cache

Look attached file. Thanks

Il giorno giovedì 8 marzo 2018 03:00:53 UTC+1, Anthony ha scritto:
>
>
>
> On Wednesday, March 7, 2018 at 2:40:02 PM UTC-5, Andrea Fae' wrote:
>>
>> Thanks Anthony, but LOGIN is still in the left side...
>>
>>
>> 
>>
>
> It's on the right for me:
>
>
> 
> What does the HTML for the login dropdown look like in the rendered page?
>
> Anthony
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 many concurrent requests can a web2py instance handle?

2018-03-06 Thread Al Ex
On Mar 6, 2018 09:02,  wrote:

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

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


Re: [web2py] Re: pdf output of web2py-book app

2017-04-17 Thread Al Ex
Yes, I saw them.

At the end I am trying to get along with convert_book.py (which is in
web2py_book/private).

Thank you



From: Marlysson Silva  
Reply: web2py@googlegroups.com 

Date: April 10, 2017 at 22:57:04
To: web2py-users  
Subject:  [web2py] Re: pdf output of web2py-book app

Here have some files to do that

https://github.com/web2py/web2py/tree/master/gluon/contrib/markmin

Do you tried use them ?

Em sábado, 8 de abril de 2017 11:49:11 UTC-3, alex escreveu:
>
> I have downloaded and used the book app https://github.com/web2py/
> web2py-book to write some documentation.
>
> The document's markmins and images are in the folder /sources/xx-doc-lang,
> together with updated chapters.txt, info.txt and latex_template.tex
> mimicking the original web2py documentations folders.
>
> Now, which command should I use to create the pdf version of this
> documentation, including content and indexes?
>
> --
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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


[web2py] pdf output of web2py-book app

2017-04-08 Thread Al Ex
I have downloaded and used the book app
https://github.com/web2py/web2py-book to write some documentation.

The document's markmins and images are in the folder /sources/xx-doc-lang,
together with updated chapters.txt, info.txt and latex_template.tex
mimicking the original web2py documentations folders.

Now, which command should I use to create the pdf version of this
documentation, including content and indexes?

-- 
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: search results returned by SQLFORM.grid in loaded component {{=LOAD( ....

2016-06-17 Thread Al Ex
Thank you. Formname was already assigned.
Yes I need to show the code, I will simplify it a little, at the moment it
does not look so nice to read, maybe during this process the bug will also
show up ;-)

-- 
Al Ex

From: Anthony <abasta...@gmail.com> <abasta...@gmail.com>
Reply: web2py@googlegroups.com <web2py@googlegroups.com>
<web2py@googlegroups.com>
Date: June 17, 2016 at 10:28:39 PM
To: web2py-users <web2py@googlegroups.com> <web2py@googlegroups.com>
Subject:  [web2py] Re: search results returned by SQLFORM.grid in loaded
component {{=LOAD( 

The first place I would look is your code, which you have not shown. ;-)

On Friday, June 17, 2016 at 4:02:59 PM UTC-4, alex wrote:
>
> In a index.html view I load a component "test.load" containing an
> SQLFORM.grid with searchable=True.
> When I perform a search, the results do not appear inside the index.html
> any more.
> A new page "test.load” opens with the results.
>
> For sure I am doing something wrong, or I am missing something, because if
> I reproduce the above in an fresh app generated with the admin app wizard,
> the results are correctly found in the component "test.load" in index.html.
>
> I cannot find the bug though. Is there any place you would look for it at
> first?
>
> Thank you
>
> --
> Alex
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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] search results returned by SQLFORM.grid in loaded component {{=LOAD( ....

2016-06-17 Thread Al Ex
In a index.html view I load a component "test.load" containing an
SQLFORM.grid with searchable=True.
When I perform a search, the results do not appear inside the index.html
any more.
A new page "test.load” opens with the results.

For sure I am doing something wrong, or I am missing something, because if
I reproduce the above in an fresh app generated with the admin app wizard,
the results are correctly found in the component "test.load" in index.html.

I cannot find the bug though. Is there any place you would look for it at
first?

Thank you

-- 
Alex

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


Re: [web2py] Re: how to generate PDF documents in web2py???

2016-03-13 Thread Al Ex
One alternative could be to

1) install princexml in your server (http://www.princexml.com), check the
licence for commercial use

2) in controller:
def print_pdf():
response.headers['Content-Type']='application/pdf'
from subprocess import Popen, PIPE

# on windows (full path of binary)
prince = "C:/Program Files (x86)/Prince/engine/bin/prince.exe"

# on linux, mac
prince = "prince"

p = Popen([prince,"-"], stdin=PIPE, stdout=PIPE)

# create an html page and add the relevant css for the pdf
style = STYLE()
style.append("@page {size: A4 ; margin: 120pt 0pt 60pt 50pt }")
style.append("@page {@top-right {content: 'TEST PAGE PDF';
margin-right: 30px;}}")

body = BODY()
body.append(XML(' pdf '))
body.append(XML('hello World  '))
body.append(TABLE(TR(TD('This is '), TD('a table')), _border="1"))

the_page_to_print_in_html = HTML(HEAD(style), BODY(body)).xml()

# see online documentation for other options to generate the pdf
p.stdin.write( the_page_to_print_in_html )
p.stdin.close()
pdf = p.stdout.read()

return pdf

On Sat, Mar 12, 2016 at 4:28 PM, prashant joshi 
wrote:

> thank u
>
> On Sat, Mar 12, 2016 at 11:52 AM, xmarx  wrote:
>
>> pyfpdf is installed on web2py.
>>
>> docs and tutorials can be found here:
>> http://pyfpdf.readthedocs.org/en/latest/Web2Py/index.html
>>
>> 11 Mart 2016 Cuma 21:36:41 UTC+2 tarihinde prashant joshi yazdı:
>>
>>> i want crete sql form if i click on print button then form printout in
>>> pdf format
>>> how it wiil done in web2py??
>>> how use ReportLab library??
>>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] internationalization of url

2015-02-14 Thread al ex
How can I make that when the accepted language is english the same
app/ctr/fnc returns the url as

domain/text-in-english

and when tha language is spanish, it returns the url as

domain/text-in-spanish

With pattern routes I can correctly route the incoming request from

domain/text-in-english
domain/text-in-spanish

to the same app/ctr/fnc

but what about the response after processing?

Is there a way to do it from the application?
Can you give me an example?

Thank you

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


Re: [web2py] internationalization of url

2015-02-14 Thread al ex
Thank you for pointing to the thread, I had missed it.

In fact I think not only controller and function names should be singularly
translatable, but also a whole URL (combination of controllers and
functions).

I saw that the assigned priority level to this enhancement request is low,
I hope it will increase soon.

By the time I will try with your method.

On Sun, Feb 15, 2015 at 11:21 AM, Kiran Subbaraman 
subbaraman.ki...@gmail.com wrote:

  This is similar to this enhancement request:
 https://github.com/web2py/web2py/issues/766

 
 Kiran Subbaramanhttp://subbaraman.wordpress.com/about/

 On Sun, 15-02-2015 4:58 AM, al ex wrote:

  How can I make that when the accepted language is english the same
 app/ctr/fnc returns the url as

 domain/text-in-english

 and when tha language is spanish, it returns the url as

 domain/text-in-spanish

 With pattern routes I can correctly route the incoming request from

 domain/text-in-english
 domain/text-in-spanish

 to the same app/ctr/fnc

 but what about the response after processing?

 Is there a way to do it from the application?
 Can you give me an example?

  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.


-- 
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 mimic routes.py with nginx

2015-02-03 Thread al ex
I have commented the following 4 directives in my server declaration, that
now looks like as below, and it seems to work better.

open_file_cache  max=1000 inactive=20s;
open_file_cache_valid30s;
open_file_cache_min_uses 2;
open_file_cache_errors   on;

-
in /etc/nginx/sites-available/mydomain


server {
  listen [::]:443 ssl spdy;
  listen 443 ssl spdy;
  server_name mydomain;

  charset utf-8;

# these includes are taken from https://github.com/h5bp/server-configs-nginx
include /etc/nginx/h5bp/directive-only/ssl.conf;
include /etc/nginx/h5bp/directive-only/spdy.conf;
include /etc/nginx/h5bp/directive-only/ssl-stapling.conf;
include /etc/nginx/h5bp/directive-only/x-ua-compatible.conf;
include /etc/nginx/h5bp/directive-only/extra-security.conf;
include /etc/nginx/h5bp/location/protect-system-files.conf;

# these 4 are now commented, it seems now to work better
# open_file_cache  max=1000 inactive=20s;
# open_file_cache_valid30s;
# open_file_cache_min_uses 2;
# open_file_cache_errors   on;


  location /nginx_status {
stub_status on;
access_log   off;
deny all;
  }

location / {
uwsgi_pass  unix:///tmp/web2py.sock;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
 include /etc/nginx/conf.d/web2py/gzip.conf;
}

  location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
  alias /home/www-data/web2py/applications/$1/static/$2;
  expires max;
  log_not_found off;
  include /etc/nginx/conf.d/web2py/gzip_static.conf;
  }
}


If you catch anything bad with this configuration, please let me know.
Thank you


On Tue, Feb 3, 2015 at 7:06 AM, Michele Comitini michele.comit...@gmail.com
 wrote:



 Il giorno lunedì 2 febbraio 2015 12:29:00 UTC+1, alex ha scritto:

 Michele,

 Thank you for quick answer!

 If I put in nginx server directive:

 location ~ ^/AAA(/.*)?$ { rewrite ^.*$ http://example.com/app/ctr/fnc
 break ; }

 and leave web2py/applications/app/routes.py with only

 routes_out = (
 ('/app/ctr/fnc', r'/AAA'),
 )

 everytime I call /AAA it gets rewritten to /app/ctr/fnc.
 Instead, I would like to see always /AAA



 I think you should post a minimal server directive to reproduce the
 problem.
 Don't use complete URI's (i.e. with https part) or you are likely to get
 an http redirection. This should get closer to you need:

 location /AAA { rewrite ^/AAA/.*$ /a/c/f last; }

 location / { uwsgi|scgi|fcgi handler section }


 On the other hand, if I remove the rewrite from nginx server directive,
 and I leave both routes_in and routes_out as described before in
 /app/routes.py, it works but randomly.

 Once every two or three times I refresh the page, I get:

 invalid request




 On Mon, Feb 2, 2015 at 7:50 PM, Michele Comitini michele@gmail.com
 wrote:

 you still need your routes.py in place:

 routes_out = (
 ('/app/ctr/fnc', r'/AAA'),

 )


 2015-02-02 11:23 GMT+01:00 al ex a22...@gmail.com:

 I have setup this route in /web2py/applications/app

 routes_in = (
 (r'/AAA/?', '/app/ctr/fnc'),
 )

 routes_out = (
 ('/app/ctr/fnc', r'/AAA'),

 )


 With rockets, on localhost, it works fine.

 On production server nginx 1.7.9, uwsgi 2.0.8, python 2.7.6, if I
 repeatedly refresh /AAA, sometimes it work, sometimes it gives: invalid
 request.

 This goes apparently randomly.

 How to isolate and solve this problem?
 I thought maybe trying to eliminate routes.py, and mimic the same rules
 on nginx, could give me a hint.

 routes_in would go to

 location ~ ^/AAA(/.*)?$ { rewrite ^.*$ http://example.com/app/ctr/fnc
 break ; }

 but how to write route_out in this case?


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

Re: [web2py] How to mimic routes.py with nginx

2015-02-02 Thread al ex
Michele,

Thank you for quick answer!

If I put in nginx server directive:

location ~ ^/AAA(/.*)?$ { rewrite ^.*$ http://example.com/app/ctr/fnc break
; }

and leave web2py/applications/app/routes.py with only

routes_out = (
('/app/ctr/fnc', r'/AAA'),
)

everytime I call /AAA it gets rewritten to /app/ctr/fnc.
Instead, I would like to see always /AAA


On the other hand, if I remove the rewrite from nginx server directive, and
I leave both routes_in and routes_out as described before in
/app/routes.py, it works but randomly.

Once every two or three times I refresh the page, I get:

invalid request




On Mon, Feb 2, 2015 at 7:50 PM, Michele Comitini michele.comit...@gmail.com
 wrote:

 you still need your routes.py in place:

 routes_out = (
 ('/app/ctr/fnc', r'/AAA'),

 )


 2015-02-02 11:23 GMT+01:00 al ex a22...@gmail.com:

 I have setup this route in /web2py/applications/app

 routes_in = (
 (r'/AAA/?', '/app/ctr/fnc'),
 )

 routes_out = (
 ('/app/ctr/fnc', r'/AAA'),

 )


 With rockets, on localhost, it works fine.

 On production server nginx 1.7.9, uwsgi 2.0.8, python 2.7.6, if I
 repeatedly refresh /AAA, sometimes it work, sometimes it gives: invalid
 request.

 This goes apparently randomly.

 How to isolate and solve this problem?
 I thought maybe trying to eliminate routes.py, and mimic the same rules
 on nginx, could give me a hint.

 routes_in would go to

 location ~ ^/AAA(/.*)?$ { rewrite ^.*$ http://example.com/app/ctr/fnc
 break ; }

 but how to write route_out in this case?


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


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


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


[web2py] How to mimic routes.py with nginx

2015-02-02 Thread al ex
I have setup this route in /web2py/applications/app

routes_in = (
(r'/AAA/?', '/app/ctr/fnc'),
)

routes_out = (
('/app/ctr/fnc', r'/AAA'),

)


With rockets, on localhost, it works fine.

On production server nginx 1.7.9, uwsgi 2.0.8, python 2.7.6, if I
repeatedly refresh /AAA, sometimes it work, sometimes it gives: invalid
request.

This goes apparently randomly.

How to isolate and solve this problem?
I thought maybe trying to eliminate routes.py, and mimic the same rules on
nginx, could give me a hint.

routes_in would go to

location ~ ^/AAA(/.*)?$ { rewrite ^.*$ http://example.com/app/ctr/fnc break
; }

but how to write route_out in this case?

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


[web2py] routes.py and current.T

2015-01-14 Thread al ex
Is it possible to use current.T in routes.py, to recognize an incoming
request based on current.T.current_language and reroute it to the correct
controller / function?

Can you give me an example using pattern-based routing?

-- 
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] https and rescr.it responsive image

2015-01-11 Thread al ex
I am trying resrc.it (http://www.resrc.it/tutorials/preview) to manage
responsive images.
I use the scheme they suggest, on img tag:

img src=
https://trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg;
/

where s=w300m is a paramter/value to get the image resized.


This works fine when I am on

http://mydomain

but when I switch to https://mydomain

the above link gets changed to the following, I think from web2py (adds
mydomain after the first https).

https://mydomain/trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg


This throws a GET 400 Error.

The link

https://trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg


works, if I paste it on a browser.


I am using web2py:  2.9.11-stable+timestamp.2014.09.15.23.35.11 (Running on
nginx/1.7.0, Python 2.7.6)


I am not using routes.py.


Is there a way to force web2py not to prepend https://mydomain; to the
link when on https?

-- 
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] Fwd: https and rescr.it responsive image

2015-01-11 Thread al ex
It seems I found the solution.

It works if instead of

img src=
https://trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg;
/

I use:

img src=
//trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg
https://trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg
/




-- Forwarded message --
From: al ex a22...@gmail.com
Date: Mon, Jan 12, 2015 at 5:11 AM
Subject: https and rescr.it responsive image
To: web2py@googlegroups.com


I am trying resrc.it (http://www.resrc.it/tutorials/preview) to manage
responsive images.
I use the scheme they suggest, on img tag:

img src=
https://trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg;
/

where s=w300m is a paramter/value to get the image resized.


This works fine when I am on

http://mydomain

but when I switch to https://mydomain

the above link gets changed to the following, I think from web2py (adds
mydomain after the first https).

https://mydomain/trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg


This throws a GET 400 Error.

The link

https://trial.resrc.it/s=w300m/https://mydomain/myapp/static/images/myimage.jpg


works, if I paste it on a browser.


I am using web2py:  2.9.11-stable+timestamp.2014.09.15.23.35.11 (Running on
nginx/1.7.0, Python 2.7.6)


I am not using routes.py.


Is there a way to force web2py not to prepend https://mydomain; to the
link when on https?

-- 
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: sublime text 3

2014-12-24 Thread al ex
I use Sublime Text 3 and installed

Pakage Manager, SublimeLinter and Pylint as indicated in

http://www.sublimelinter.com/en/latest/installation.html

Then, in Sublime Text | Preferences | Package Settings | SublimeLinter |
Settings - User

I have set linters / pylint / paths as follows

{
user: {
...

linters: {
pylint: {
...

paths: [
/path/to/web2py,
/path/to/web2py/applications/app/modules
],

...
}
...


At the beginning of my .py files I add something like:

# -*- coding: utf-8 -*-

if 0:
from gluon import response, T, ...


And this makes the syntax checker find the modules he needs for the class
and methods definitions.

Hope this helps.

On Wed, Jul 9, 2014 at 7:26 PM, eric cuver amihaconsult...@gmail.com
wrote:

 i add folder gluon in package directory et user directory with
 include  if 0: from gluon import * but doesnt work

 Le mercredi 9 juillet 2014 18:24:28 UTC+2, JorgeH a écrit :

 Thanks for the tip

 And yet...

 Could you post a fool-proof example?

 Thanks

 On Wednesday, July 9, 2014 10:31:36 AM UTC-5, Massimo Di Pierro wrote:

 I do know sublime text. I am assuming there is a way to tell it where to
 look for python modules for autocomplete.

 On Wednesday, 9 July 2014 10:06:25 UTC-5, JorgeH wrote:

 You mean in the OS dir path??

 On Wednesday, July 9, 2014 7:13:46 AM UTC-5, Massimo Di Pierro wrote:

 If your problem is the lack of autocompletion try add gluon to path
 and include if 0: from gluon import * on your files. Everything else
 should work out of the box.

 On Wednesday, 9 July 2014 04:29:49 UTC-5, eric cuver wrote:

 hello,

 how can we do to configure sublime text 3 to work web2py

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


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


Re: [web2py] Re: Formatting SQLFORM.factory

2011-06-25 Thread al ex
Thank you. It worked,


On Sun, Jun 26, 2011 at 11:22 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Try

 form=SQLFORM.factory( Field('address', label=T('Address')),
 formstyle='table2cols')




 On Jun 25, 11:59 pm, alex a22...@gmail.com wrote:
  Hi all,
 
  In a SQLFORM.factory generated form I want to have the labels on top
  of the fields.
 
  form=SQLFORM.factory( Field('address', label=T('Address')),)
 
  Any idea?
  Thank you