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 :
>> "'/Users/z/dev/w

[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:
- http://w

[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] Re: Not my type

2019-04-01 Thread Al Hart
Hi Joe (sorry for delay, I took the weekend off. BTW, on a totally 
different note, why is the date showing March 29 on last reply??),

Yes, you're absolutely right, it's a Python version thing. I started my 
session in Python 3.x and so the examples in the web2py book weren't 
working as it seems they're based off Python 2.x 
(I was getting: 

> SyntaxError: invalid syntax. 


My question is how to update the book so that super noobs like me won't 
trip over the same thing. It would just need a line mentioning that in 
Python 3, you'd have to do it 'X' way (and how to check which version 
you're using). Or something like that. Would we try a pull request to try 
an update or just mention in this space and someone will attend to it?

 

On Friday, March 29, 2019 at 8:39:02 PM UTC-4, Joe Barnhart wrote:
>
> I suspect you were actually running Python 3.x in which case "print xxx" 
> doesn't work because print has been mad into a function (requiring 
> parentheses).  When I start each on my Mac, this is the display I get:
>
> Python 2.7:
>
> ssmain:~ jbarnhart$ python
>
> Python 2.7.10 (default, Feb 22 2019, 21:17:52)
>
> [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> 
>
>
> Python 3.7:
>
> ssmain:~ jbarnhart$ 
>
> ssmain:~ jbarnhart$ python3
>
> Python 3.7.2 (default, Feb 12 2019, 08:15:36) 
>
> [Clang 10.0.0 (clang-1000.11.45.5)] on darwin
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> 
>
> You should be able to tell the version by the startup message.  If you are 
> actually running Python 2 and the code fails, copy and paste the actual 
> error message you get and we'll puzzle it out.
>
> Warm regards,
> Joe
>
>
>
>
> On Friday, March 29, 2019 at 7:32:52 AM UTC-7, Al Hart wrote:
>>
>> Hi Joe,
>>
>> Thanks so much for responding. Let me be more specific. I was referring 
>> to a section in the book, chapter two, on types 
>> <http://web2py.com/books/default/chapter/29/02/the-python-language#Types>
>> .
>> In there it suggests
>>
>> >>> a = 3>>> print type(a)
>>>
>>> But that didn't work for me, I got error messages (don't recall what 
>> they were at this moment).
>> However, when I tried it using two other methods...
>> 1.
>>
>>> >>> a = 3 
>>
>> >>> type(a)
>>
>> or
>> 2.
>>
>>> >>> a = 3 
>>
>> >>> print(type(a))
>>
>>
>> Both of those worked for me. Kind of weird because when I checked which 
>> version of python I had running  it said 2.7 but perhaps I installed w2p 
>> with python3.
>>
>> Anyway, at the end I was suggesting that maybe we could update the book 
>> some making reference to how things might look with python3. I wasn't sure 
>> if that sort of thing is just done here, by mentioning it in the forum and 
>> someone will get to it, or if it might be done by pull request.
>>
>> Best,
>>
>> Al
>>
>> On Thu, Mar 28, 2019 at 9:30 PM Joe Barnhart  wrote:
>>
>>> Hi Al --
>>>
>>> First off, welcome to the web2py group.  Next, it's not clear from your 
>>> message just what the question is.  If you can elaborate on (a) what you 
>>> did, (b) what you expected, and (c) what you got, I'm sure someone here can 
>>> help
>>>
>>> Warm regards,
>>>
>>> Joe B.
>>>
>>> On Thursday, March 28, 2019 at 2:10:50 AM UTC-7, Al Hart wrote:
>>>>
>>>> Hi folks, if you'll pardon the corny title, I am brand new to web2py 
>>>> (so excited to discover it) and I'm just working may way through the book. 
>>>> In Chapter two, the section on types, I tried to run the examples, but I 
>>>> got error messages. Googling around it seemed to work better if I went one 
>>>> of two ways:
>>>>
>>>>
>>>>1. a = 3
>>>>type(a)
>>>>2. a = 4 
>>>>print(type(a))
>>>>
>>>>
>>>> I'm on Ubuntu 18.04. Not sure if the example is based on python 3? If 
>>>> not, is this the best way to suggest updates to the book or should we just 
>>>> try a pull request? 
>>>>
>>> -- 
>>> Resources:
>>>

[web2py] Not my type

2019-03-28 Thread Al Hart
Hi folks, if you'll pardon the corny title, I am brand new to web2py (so 
excited to discover it) and I'm just working may way through the book. In 
Chapter two, the section on types, I tried to run the examples, but I got 
error messages. Googling around it seemed to work better if I went one of 
two ways:


   1. a = 3
   type(a)
   2. a = 4 
   print(type(a))


I'm on Ubuntu 18.04. Not sure if the example is based on python 3? If not, 
is this the best way to suggest updates to the book or should we just try a 
pull request? 

-- 
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] 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  
Reply: web2py@googlegroups.com 

Date: June 17, 2016 at 10:28:39 PM
To: web2py-users  
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.


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.


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

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

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

It works if instead of

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

I use:

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

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

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


[web2py] Re: Multiple uploads in single form?

2011-06-18 Thread Al Velin
Thank you, I know about him. But I could not get it to work.


[web2py] Re: Multiple uploads in single form?

2011-06-18 Thread Al Velin
I was hoping to find some recipe like django tabularinline or other
ready-made widgets...


[web2py] Multiple uploads in single form?

2011-06-18 Thread Al Velin
Hello, I'm new to web2py, and I do not know how to do multiple file
uploads in a single form. For example, the loading of multiple images.
If a simple model of the following fields:

db.define_table ('img',
Field ('title'),
Field ('img', 'upload'),
)

What exactly should I write in the controller and in view? ..
Sorry for the stupid question, and for my ugly English.


[web2py] Re: Many To Many Select

2010-06-29 Thread Al
Ah, belongs() + a clever select SQL.

Thanks.
Al

On Jun 29, 7:04 pm, mdipierro  wrote:
> If I understand:
>
> for row in db(db.link_table.table1==r.id)
> (db.table2.id==db.linked_table.table2).select(db.table2.id,db.table2.other)­:
>     print row.id, row.other
>
> if no double links else
>
> sub=db(db.link_table.table1==r.id)._select(db.linked_table.table2)
> for row in
> db(db.table2.id.belongs(sub)).select(db.table2.id,db.table2.other):
>     print row.id, row.other
>
> linked_view = db(db.table1.id == db.link_table.table1) & (db.table2.id
>
> > == db.linked_table.table2))
>
> > for row in linked_view(db.table1.id == r.id).select([fields from
> > table2 I want])
>
> On 29 Giu, 17:54, Al  wrote:
>
>
>
> > Given a many-to-many relationship between table1 and table2 and a row
> > in table1, I am trying to figure out the fastest way to select all the
> > rows in table2 that are associated with the row. (I'm still trying to
> > pick up web2py, so thanks for everyone's patience if I've missed the
> > blatently obvious.)
>
> > From the web2py book documentation, the best I can figure out is
> > something like this:
> > db.define_table('link_table',
> >   Field('table1', db.table1),
> >   Field('table2', db.table2)
> >   )
>
> > # Pick the row from table 1
> > r = db(db.table1.name == "Example").select()[0]
>
> > linked_view = db(db.table1.id == db.link_table.table1) & (db.table2.id
> > == db.linked_table.table2))
>
> > for row in linked_view(db.table1.id == r.id).select([fields from
> > table2 I want])
> >   # Do something clever for the matching rows I've found
> >   pass
>
> > But I keep thinking there ought to be something cleverer that I can
> > do, especially given that r has a set containing the rows of
> > link_table that contain the entries of table2 that I want. But I can't
> > figure out how to leverage that set into a shorter query.
>
> > Thanks,
> > Al- Hide quoted text -
>
> - Show quoted text -


[web2py] Many To Many Select

2010-06-29 Thread Al
Given a many-to-many relationship between table1 and table2 and a row
in table1, I am trying to figure out the fastest way to select all the
rows in table2 that are associated with the row. (I'm still trying to
pick up web2py, so thanks for everyone's patience if I've missed the
blatently obvious.)

>From the web2py book documentation, the best I can figure out is
something like this:
db.define_table('link_table',
  Field('table1', db.table1),
  Field('table2', db.table2)
  )

# Pick the row from table 1
r = db(db.table1.name == "Example").select()[0]

linked_view = db(db.table1.id == db.link_table.table1) & (db.table2.id
== db.linked_table.table2))

for row in linked_view(db.table1.id == r.id).select([fields from
table2 I want])
  # Do something clever for the matching rows I've found
  pass

But I keep thinking there ought to be something cleverer that I can
do, especially given that r has a set containing the rows of
link_table that contain the entries of table2 that I want. But I can't
figure out how to leverage that set into a shorter query.

Thanks,
Al




[web2py] Re: SEO

2010-04-26 Thread Al
Thank you for all the comments...
The web site is just a few hundreds of SCANNED image of verd old
medical papers which can be searched by two database fields - Title
and Keywords, so essentially it is just one web page with not much to
be indexed on. There is also 'comments' people can add to each
article, but these comments are also stored in the DB. So I must find
a way to persist the data in these 3 searchable fields so that they
can be crawled by the search engine, I am not sure if
"response.meta.keyword=" can do such job. The keyword field will
be continuously updated - not static - so I cannot put all the
keywords into the meta descriptions beforehand.

Al


-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] SEO

2010-04-25 Thread Al
Hi,

I have built my web site, now how does web2py enable people be able to
find it? is there any helper function or built-in variables which I
can use? Also in my SQLite database, there is a column called keywords
which I like to be indexed, is there any simple SEO techniques I can
follow?

Al


-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] Re: Displaying Foreign Key

2010-03-23 Thread Al
Would this work in GAE which does not handle table join? or the DAL
automatically handle this for you?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Joomla Templates

2010-03-20 Thread Al
I have tried to beautify my application with some standard template. I
cannot get the "Joomla Template" appliance to work, nor does the
instructions in the following seem to work:

http://www.web2py.com/AlterEgo/default/show/167

I was testing the a Joomla 1.5 template from here:
http://joomportal.com/download-2069.html

Could  anyone share how they incorporate such templates or any other
compatible ones into web2py?

Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Migrating web2py to GAE

2010-03-19 Thread Al
Thanks mdipierro. It is indeed the URL causing the problem, as it
defaults to "localhost" rather than "127.0.0.1" when I click the
Browse button after Run. I did not realise the code inside appadmin.py
actually checks for "127.0.0.1". Now I can really troubleshoot
myownapp to make it work on GAE

Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Relase of the first HL7 based on web2py framework

2010-03-19 Thread Al
Is there a data model of this demo?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Migrating web2py to GAE

2010-03-18 Thread Al
Sorry I forgot to post the console error for the previous message:

*** Running dev_appserver with the following flags:
--admin_console_server= --port=8012
Python command: /usr/bin/python2.5
INFO 2010-03-18 13:30:11,558 dev_appserver_main.py:399] Running
application myownapp on port 8012: http://localhost:8012
WARNING  2010-03-18 13:30:13,749 py_zipimport.py:103] Can't open
zipfile /Library/Python/2.5/site-packages/setuptools-0.6c9-py2.5.egg:
IOError: [Errno 13] file not accessible: '/Library/Python/2.5/site-
packages/setuptools-0.6c9-py2.5.egg'
WARNING  2010-03-18 13:30:13,774 py_zipimport.py:103] Can't open
zipfile /Library/Python/2.5/site-packages/hl7-0.1.0-py2.5.egg:
IOError: [Errno 13] file not accessible: '/Library/Python/2.5/site-
packages/hl7-0.1.0-py2.5.egg'
WARNING  2010-03-18 13:30:14,192 portalocker.py:91] no file locking
WARNING  2010-03-18 13:30:15,415 main.py:50] unable to import
wsgiserver
INFO 2010-03-18 13:30:15,454 gaehandler.py:55]  Request:
1.83ms/1.83ms (real time/cpu time)
INFO 2010-03-18 13:30:15,502 dev_appserver.py:3246] "GET / HTTP/
1.1" 303 -
INFO 2010-03-18 13:30:15,550 dev_appserver_index.py:205] Updating /
Users/albertc/Documents/GAEapp/web2py/index.yaml
WARNING  2010-03-18 13:30:15,623 py_zipimport.py:103] Can't open
zipfile /Library/Python/2.5/site-packages/setuptools-0.6c9-py2.5.egg:
IOError: [Errno 13] file not accessible: '/Library/Python/2.5/site-
packages/setuptools-0.6c9-py2.5.egg'
WARNING  2010-03-18 13:30:15,649 py_zipimport.py:103] Can't open
zipfile /Library/Python/2.5/site-packages/hl7-0.1.0-py2.5.egg:
IOError: [Errno 13] file not accessible: '/Library/Python/2.5/site-
packages/hl7-0.1.0-py2.5.egg'
INFO 2010-03-18 13:30:15,970 gaehandler.py:55]  Request:
368.73ms/295.66ms (real time/cpu time)
INFO 2010-03-18 13:30:16,032 dev_appserver.py:3246] "GET /welcome/
default/index HTTP/1.1" 200 -
WARNING  2010-03-18 13:30:20,357 py_zipimport.py:103] Can't open
zipfile /Library/Python/2.5/site-packages/setuptools-0.6c9-py2.5.egg:
IOError: [Errno 13] file not accessible: '/Library/Python/2.5/site-
packages/setuptools-0.6c9-py2.5.egg'
WARNING  2010-03-18 13:30:20,414 py_zipimport.py:103] Can't open
zipfile /Library/Python/2.5/site-packages/hl7-0.1.0-py2.5.egg:
IOError: [Errno 13] file not accessible: '/Library/Python/2.5/site-
packages/hl7-0.1.0-py2.5.egg'
INFO 2010-03-18 13:30:20,814 gaehandler.py:55]  Request:
477.67ms/333.69ms (real time/cpu time)
INFO 2010-03-18 13:30:20,859 dev_appserver.py:3246] "GET /admin/
default/index HTTP/1.1" 200 -
ERROR2010-03-18 13:30:30,333 dev_appserver.py:3242] code 400,
message Bad request syntax ("\x16\x03\x01\x00\x9b
\x01\x00\x00\x97\x03\x01K\xa2*\xf6\xc4\x9e9>QaC\xcc\xd8Uk\xe6y
\x87\xf1\x9c\xff\xe6\xab'")

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Migrating web2py to GAE

2010-03-18 Thread Al
Change the port does get me to the welcome screen on the local GAE,
click into admin interface gives "admin is disabled because insecure
channel"; if I change http to https then it gives me "Secure
Connection Failed: SSL received a record that exceed the max possible
length:

Could some one share what they put in the app.yaml please 

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: custom validation problem

2010-03-18 Thread mohammed al-moustady
thank you all

I will try me best
I hope I can fix it

Kind Regards

On Mar 17, 2:52 pm, Mengu  wrote:
> to your console.
>
> On 17 Mart, 13:41, mohammed al-moustady 
> wrote:
>
>
>
> > thank you hamdy but it is irrelevant to the code.
>
> > BTW
> > mdipierro
>
> > do you mean print statement in the code itself? I thought it was s
> > special function..
> > ok even If I do these print statements were would it print to?
>
> > On Mar 17, 10:16 am, "hamdy.a.farag"  wrote:
>
> > > Hi Mohammed,
>
> > > I faced a problem like this one b4 and simply as mdipierro said it was
> > > a logic problem
> > > try the validation function with the minimal code that works then add
> > > line by line and check whether it works or not
> > > then you'll detect when it fails
>
> > > Oh BTW
>
> > > if form.accepts(request.vars,session, onvalidation=validation):
> > >         response.flash='new record inserted'
> > >  records=SQLTABLE(db().select(db.reservation.ALL))
> > >  dt=db(db.reservation.Date==form.vars.Date).select()
> > >   return dict(form=form,records=records,dt=dt)
>
> > > as you see the line :
> > > dt=db(db.reservation.Date==form.vars.Date).select()     is out of the
> > > scope of the if statement and thus form.vars has no values
> > > this may be your problem
>
> > > Regards,
> > > Hamdy

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Migrating web2py to GAE

2010-03-17 Thread Al
The appadmin can be run on GAE, but it cannot run on local GAE SDK.
(note: I have been thinking it might due to some basic settings, not
just my code, which I have overlooked, as running T3 and C.R.M
appliances have the same problem). I have customised myapp according
to the web2py manual to suit GAE deployment. Also I always got the
same result on both my mac and windows machines

Here is the log on the console:


*** Running dev_appserver with the following flags:
--admin_console_server= --port=8009 --clear_datastore
Python command: /usr/bin/python2.5
WARNING  2010-03-17 13:45:04,091 datastore_file_stub.py:623] Could not
read datastore data from /var/folders/fd/fdhbJFB5Hj8Bou9ORL02zE+++TM/-
Tmp-/dev_appserver.datastore
Traceback (most recent call last):
  File "/Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
Resources/GoogleAppEngine-default.bundle/Contents/Resources/
google_appengine/dev_appserver.py", line 68, in 
run_file(__file__, globals())
  File "/Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
Resources/GoogleAppEngine-default.bundle/Contents/Resources/
google_appengine/dev_appserver.py", line 64, in run_file
execfile(script_path, globals_)
  File "/Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
Resources/GoogleAppEngine-default.bundle/Contents/Resources/
google_appengine/google/appengine/tools/dev_appserver_main.py", line
417, in 
sys.exit(main(sys.argv))
  File "/Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
Resources/GoogleAppEngine-default.bundle/Contents/Resources/
google_appengine/google/appengine/tools/dev_appserver_main.py", line
394, in main
static_caching=static_caching)
  File "/Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
Resources/GoogleAppEngine-default.bundle/Contents/Resources/
google_appengine/google/appengine/tools/dev_appserver.py", line 3727,
in CreateServer
return HTTPServerWithScheduler((serve_address, port),
handler_class)
  File "/Users/albertc/Desktop/GoogleAppEngineLauncher.app/Contents/
Resources/GoogleAppEngine-default.bundle/Contents/Resources/
google_appengine/google/appengine/tools/dev_appserver.py", line 3741,
in __init__
request_handler_class)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/SocketServer.py", line 330, in __init__
self.server_bind()
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/BaseHTTPServer.py", line 101, in server_bind
SocketServer.TCPServer.server_bind(self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/SocketServer.py", line 341, in server_bind
self.socket.bind(self.server_address)
  File "", line 1, in bind
socket.error: (48, 'Address already in use')

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: custom validation problem

2010-03-17 Thread mohammed al-moustady
thank you hamdy but it is irrelevant to the code.

BTW
mdipierro

do you mean print statement in the code itself? I thought it was s
special function..
ok even If I do these print statements were would it print to?

On Mar 17, 10:16 am, "hamdy.a.farag"  wrote:
> Hi Mohammed,
>
> I faced a problem like this one b4 and simply as mdipierro said it was
> a logic problem
> try the validation function with the minimal code that works then add
> line by line and check whether it works or not
> then you'll detect when it fails
>
> Oh BTW
>
> if form.accepts(request.vars,session, onvalidation=validation):
>         response.flash='new record inserted'
>  records=SQLTABLE(db().select(db.reservation.ALL))
>  dt=db(db.reservation.Date==form.vars.Date).select()
>   return dict(form=form,records=records,dt=dt)
>
> as you see the line :
> dt=db(db.reservation.Date==form.vars.Date).select()     is out of the
> scope of the if statement and thus form.vars has no values
> this may be your problem
>
> Regards,
> Hamdy

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: gae appadmin

2010-03-17 Thread Al
Matt,

I have the exactly opposite problem, my appadmin (latest version) runs
on GAE but it does not run locally, it has a yellow triangle with a !
sign in it. Have you modified the app.yaml - please see my other post:

http://groups.google.com/group/web2py/browse_thread/thread/3c6041a6b4e019c0/af65b49a747bfd38?lnk=gst&q=gae+migrate#af65b49a747bfd38

Al

On Mar 17, 12:16 pm, mattynoce  wrote:
> hi, i've looked at some posts but can't seem to make this work. i can
> get appadmin to work on my local version of gae launcher (on a mac),
> but when i upload it, i can't get it to work on app engine even over
> https.
>
> i tried to migrate from 1.74.11 to 1.76.5 but when i did that, i
> couldn't get the gae launcher to show my site. i just kept getting a
> ticket error about wsgiserver. so i eventually rolled back to 1.74.11.
>
> what do i need to do to be able to look at appadmin online? i just get
> "400 Bad Request."
>
> i apologize if i'm missing something. any thoughts?
>
> matt

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: custom validation problem

2010-03-16 Thread mohammed al-moustady
could you please tell me how to do/find a print statement?
or direct me to a chapter in the documentation or something?


On Mar 16, 4:07 pm, mdipierro  wrote:
> can you add some print statements to determine which lines are
> executed and which not? I suspect a logic problem.
>
> On Mar 16, 3:39 am, mohammed al-moustady 
> wrote:
>
>
>
> > here is my db.py
>
> > db.define_table('time_table',
> >     Field('time_in','time'),
> >     Field('time_out','time')
> > )
>
> > db.define_table('years',
> >     Field('year_number','string')
> > )
>
> > db.define_table('buildings',
> >     Field('b_number','string')
> > )
>
> > db.define_table('levels',
> >     Field('l_number','string')
> > )
>
> > db.define_table('room',
> >     Field('building_number',db.buildings),
> >     Field('level','string'),
> >     Field('room_number','string'),
> >     Field('area','string')
> > )
>
> > db.define_table('module',
> >     Field('name','string'),
> >     Field('module_number','string'),
> >     Field('year',db.years)
> > )
>
> > db.define_table('reservation',
> >     Field('room',db.room),
> >     Field('module',db.module),
> >     Field('Time_IN',db.time_table),
> >     Field('Time_OUT',db.time_table),
> >     Field('Date','date')
> >     )
>
> > db.module.year.requires=IS_IN_DB(db,'years.id','years.year_number')
> > db.room.building_number.requires=IS_IN_DB(db,'buildings.id','buildings.b_nu 
> > mber')
> > db.room.level.requires=IS_IN_DB(db,'levels.id','levels.l_number')
> > db.reservation.room.requires=IS_IN_DB(db,'room.id','room.room_number')
> > db.reservation.module.requires=IS_IN_DB(db,'module.id','module.name')
> > db.reservation.Time_IN.requires=IS_IN_DB(db,'time_table.id','time_table.tim 
> > e_in')
> > db.reservation.Time_OUT.requires=IS_IN_DB(db,'time_table.id','time_table.ti 
> > me_out')
>
> > and here is my default.py in controler:
> > def index():
>
> >     return dict(message="")
>
> > def room_reg():
> >     form=SQLFORM(db.room)
> >     if form.accepts(request.vars,session):
> >         response.flash='new record inserted'
> >     records=SQLTABLE(db().select(db.room.ALL))
>
> >     return dict(form=form,records=records)
>
> > def module_reg():
> >     form=SQLFORM(db.module)
> >     if form.accepts(request.vars,session):
> >         response.flash='new record inserted'
> >     records=SQLTABLE(db().select(db.module.ALL))
>
> >     return dict(form=form,records=records)
>
> > def validation(form):
>
> >     st1=form.vars.Time_IN
> >     en1=form.vars.Time_OUT
> >     dbselect=db(db.reservation.Date==form.vars.Date).select()
>
> >     if en1 >         form.errors.Time_OUT='ÇáÑÌÇÁ ÊÚÏíá ÇáæÞÊ'
>
> >     for i in dbselect:
> >         st2=i.Time_IN
> >         en2=i.Time_OUT
> >         if st1==st2 or en1==en2:
> >             form.errors.Time_OUT='ÇáÑÌÇÁ ÊÚÏíá ÇáæÞÊ'
> >         elif st2>st1 and en2>en1:
> >             if st2>en1:
> >                 pass
> >             else:
> >                 form.errors.Time_OUT='ÇáÑÌÇÁ ÊÚÏíá ÇáæÞÊ'
> >         elif st2 >             if en2 >                 pass
> >             else:
> >                 form.errors.Time_OUT='ÇáÑÌÇÁ ÊÚÏíá ÇáæÞÊ'
> >         elif st2>st1 and en2 >             form.errors.Time_OUT='ÇáÑÌÇÁ ÊÚÏíá ÇáæÞÊ'
> >         else:
> >             pass
>
> > def reservation():
> >     form=SQLFORM(db.reservation)
> >     if form.accepts(request.vars,session, onvalidation=validation):
> >         response.flash='new record inserted'
> >     records=SQLTABLE(db().select(db.reservation.ALL))
> >     dt=db(db.reservation.Date==form.vars.Date).select()
> >     return dict(form=form,records=records,dt=dt)
>
> > My issue is in the Validation function for the form processing in the
> > function reservation()
> > first I am validating if the user has input a time in

[web2py] custom validation problem

2010-03-16 Thread mohammed al-moustady
here is my db.py

db.define_table('time_table',
Field('time_in','time'),
Field('time_out','time')
)

db.define_table('years',
Field('year_number','string')
)

db.define_table('buildings',
Field('b_number','string')
)

db.define_table('levels',
Field('l_number','string')
)

db.define_table('room',
Field('building_number',db.buildings),
Field('level','string'),
Field('room_number','string'),
Field('area','string')
)

db.define_table('module',
Field('name','string'),
Field('module_number','string'),
Field('year',db.years)
)

db.define_table('reservation',
Field('room',db.room),
Field('module',db.module),
Field('Time_IN',db.time_table),
Field('Time_OUT',db.time_table),
Field('Date','date')
)

db.module.year.requires=IS_IN_DB(db,'years.id','years.year_number')
db.room.building_number.requires=IS_IN_DB(db,'buildings.id','buildings.b_number')
db.room.level.requires=IS_IN_DB(db,'levels.id','levels.l_number')
db.reservation.room.requires=IS_IN_DB(db,'room.id','room.room_number')
db.reservation.module.requires=IS_IN_DB(db,'module.id','module.name')
db.reservation.Time_IN.requires=IS_IN_DB(db,'time_table.id','time_table.time_in')
db.reservation.Time_OUT.requires=IS_IN_DB(db,'time_table.id','time_table.time_out')

and here is my default.py in controler:
def index():

return dict(message="")

def room_reg():
form=SQLFORM(db.room)
if form.accepts(request.vars,session):
response.flash='new record inserted'
records=SQLTABLE(db().select(db.room.ALL))

return dict(form=form,records=records)

def module_reg():
form=SQLFORM(db.module)
if form.accepts(request.vars,session):
response.flash='new record inserted'
records=SQLTABLE(db().select(db.module.ALL))

return dict(form=form,records=records)

def validation(form):

st1=form.vars.Time_IN
en1=form.vars.Time_OUT
dbselect=db(db.reservation.Date==form.vars.Date).select()

if en1st1 and en2>en1:
if st2>en1:
pass
else:
form.errors.Time_OUT='الرجاء تعديل الوقت'
elif st2st1 and en2st1 and en2>en1:
if st2>en1:
pass
else:
form.errors.Time_OUT='الرجاء تعديل الوقت'
elif st2st1 and en2http://groups.google.com/group/web2py?hl=en.



[web2py] Migrating web2py to GAE

2010-03-16 Thread Al
Hi,

I have been trying to move myapp from web2py app to GAE without
success. I can manage to deploy web2py to GAE with the three built in
apps (admin, welcome and examples) where I can login to admin and
navigate to each of the three apps, but if I incorporate myapp, when I
navigate to myapp thru the admin interface after deployment, it
generate internal error. (though editing myapp thru admin still OK).
It is not just myapp which has this problem, but when I tried the T3
and C.R.M appliance, it also has similar error. Note: I have changed
the app.yaml in the web2py source to the following:

application: myfirstapp
version: 1
api_version: 1
runtime: python

handlers:
- url: /.*
  script: gaehandler.py
  secure: always

Further, if I use the original app.yaml in the web2py src, then when
try to go into the admin interface, it will give "invalid request"
error.

Could anyone share how they deploy T3 or CRM into GAE, what changes in
the app.yaml or any other setting is required.

Cheers
Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Setting up Apache with SSL

2010-03-02 Thread Al
Hi,

Has anyone deploy apache with SSL for web2py successfully? All the
scripts available seems to be linux oriented.

Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Deploy web2py on Mac

2010-03-02 Thread Al
Hi,

Can anyone advise how I can setup web2py to start automatically when
the machine is turned on? i.e the services should all be started
without having to login.
How can that be done with plist and startup items?

Cheers
Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: How to deploy my first app

2010-02-25 Thread Al
Brian,

Finally I found the mistakes which causes all the troubles of
accessing the non-admin pages:

return dict(form=form, images=images, admin = admin)

I have the above line in the default.py controller, that why it keeps
asking for admin authentication even I tried to navigate the default
home page of myapp.

As for the Mac, what you mentioned was correct, I installed the
stunnel 4.27_0 package using macports, but the executables are in the /
opt/local/bin are called stunnel and stunnel3. Haven't got time to
solve this yet...

Cheers
Al

On Feb 22, 6:11 am, Brian M  wrote:
> Al,
>
> I setup a stunnel server on Win7 which also had web2py's native server
> running on it. Then I setup a stunnel client on a Linux VM.
>
> In Stunnel Server's stunnel.conf:
> [web2py]
> accept = 8443
> connect = localhost:8000
>
> In Stunnel Client's stunnel.conf:
> ; Use it for client mode
> client = yes
> [web2py]
> accept = 8443
> connect = server_ip:8443
>
> Visitinghttp://server_ip:8443/myappbrought up the web2py application
> as expected, no prompts for the admin password - same as if I'd
> visitedhttp://server_ip:8000. Attempting to access the admin pages or
> to view a ticket brought up the admin password prompt (as it should)
> and I was able to use web2py's admin from the remote computer just
> fine without https (because web2py thought I was on localhost thanks
> to stunnel).
>
> I think the problem you're having on the Mac with "inetd mode must
> define a remote host or an executable " is due to trying to use the
> "stunnel" command (which is likely really stunnel3) instead of
> "stunnel4" at the command line. I found that I got the same error on
> linux.
>
> ~Brian
>
> On Feb 20, 11:31 pm, Brian M  wrote:
>
> > Al,
>
> > Yes, stunnel needs both a client and a server. The general public
> > should not need to use a stunnel connection to access your web2py
> > application though - they should just be using good 
> > oldhttp://your_server.com.
> > My suggestion was that *you* could use stunnel when you need to get
> > remote access to the web2py admin screens.
>
> > Port redirection/forwarding ofhttp://server_ip:8443tohttp://server_ip:8000
> > (or 80 whatever port web2py is actually listening on) from the outside
> > probably wouldn't accomplish the goal of being able to access web2py's
> > admin without SSL - web2py will only allow non-SSL admin if the
> > connection comes from localhost and even with port redirection you
> > would not be connection from localhost.
>
> > So you can't accesshttp://server_ip/myfirstappoverstunnel without
> > getting the prompt for the admin password? That doesn't make sense.
> > Web2py should be behaving exactly the same whether or not you're using
> > stunnel. What do you get when you do put in the admin password? Do you
> > get your app or do you get the admin screen?
>
> > Sorry, can't help with the Mac thing - don't have a Mac.
>
> > ~Brian
>
> > On Feb 18, 11:09 am, Al  wrote:
>
> > > Brian,
>
> > > Thank you for your detailed instructions. I managed to get stunnel
> > > working, though it is a lot more complicated than I thought
> > > originally. On the windows server, the stunnel.conf file is setup as
> > > server mode and redirect port 8443 to 8000. On the client side, I also
> > > have to set up another stunnel as client mode and redirect
> > > 127.0.0.1:80 to 192.168.1.11 - server's IP address. As this server
> > > will be facing public, I cannot expect people to set up stunnel in
> > > their machine in order to access my website. I was expecting a tool
> > > which runs on the server side to do port redirection, and then when I
> > > type inhttp://server_ip:8443fromanothermachine, it will route me
> > > to my target app. (note: I did NOT set up any SSL certificate to get
> > > stunnel working)
>
> > > Also with stunnel, I still cannot access the target app without
> > > entering the admin password, I cannot find any response.menu_auth to
> > > remove.
>
> > > I also have another mac which I tried to set up stunnel, but when I
> > > run sudo stunnel3 I got the following error:
> > > anyone familiar with mac can give some tips on how to solve this:
>
> > > inetd mode must define a remote host or an executable
>
> > > Cheers
> > > Al
> > > On Feb 12, 8:09 am, Brian M  wrote:
>
> > > > Al,
>
> > > > You'd want to get rid of the "edit" " menu wh

[web2py] Re: How to deploy my first app

2010-02-25 Thread Al
Brian,

Finally I found the mistake which causes all this trouble in accessing
the non-admin pages, I had the following line in the default.py in
myapp:
return dict(form=form, images=images, admin = admin)


On Feb 22, 6:11 am, Brian M  wrote:
> Al,
>
> I setup a stunnel server on Win7 which also had web2py's native server
> running on it. Then I setup a stunnel client on a Linux VM.
>
> In Stunnel Server's stunnel.conf:
> [web2py]
> accept = 8443
> connect = localhost:8000
>
> In Stunnel Client's stunnel.conf:
> ; Use it for client mode
> client = yes
> [web2py]
> accept = 8443
> connect = server_ip:8443
>
> Visitinghttp://server_ip:8443/myappbrought up the web2py application
> as expected, no prompts for the admin password - same as if I'd
> visitedhttp://server_ip:8000. Attempting to access the admin pages or
> to view a ticket brought up the admin password prompt (as it should)
> and I was able to use web2py's admin from the remote computer just
> fine without https (because web2py thought I was on localhost thanks
> to stunnel).
>
> I think the problem you're having on theMacwith "inetd mode must
> define a remote host or an executable " is due to trying to use the
> "stunnel" command (which is likely really stunnel3) instead of
> "stunnel4" at the command line. I found that I got the same error on
> linux.
>
> ~Brian
>
> On Feb 20, 11:31 pm, Brian M  wrote:
>
> > Al,
>
> > Yes, stunnel needs both a client and a server. The general public
> > should not need to use a stunnel connection to access your web2py
> > application though - they should just be using good 
> > oldhttp://your_server.com.
> > My suggestion was that *you* could use stunnel when you need to get
> > remote access to the web2py admin screens.
>
> > Port redirection/forwarding ofhttp://server_ip:8443tohttp://server_ip:8000
> > (or 80 whatever port web2py is actually listening on) from the outside
> > probably wouldn't accomplish the goal of being able to access web2py's
> > admin withoutSSL- web2py will only allow non-SSLadmin if the
> > connection comes from localhost and even with port redirection you
> > would not be connection from localhost.
>
> > So you can't accesshttp://server_ip/myfirstappoverstunnel without
> > getting the prompt for the admin password? That doesn't make sense.
> > Web2py should be behaving exactly the same whether or not you're using
> > stunnel. What do you get when you do put in the admin password? Do you
> > get your app or do you get the admin screen?
>
> > Sorry, can't help with theMacthing - don't have aMac.
>
> > ~Brian
>
> > On Feb 18, 11:09 am, Al  wrote:
>
> > > Brian,
>
> > > Thank you for your detailed instructions. I managed to get stunnel
> > > working, though it is a lot more complicated than I thought
> > > originally. On the windows server, the stunnel.conf file is setup as
> > > server mode and redirect port 8443 to 8000. On the client side, I also
> > > have to set up another stunnel as client mode and redirect
> > > 127.0.0.1:80 to 192.168.1.11 - server's IP address. As this server
> > > will be facing public, I cannot expect people to set up stunnel in
> > > their machine in order to access my website. I was expecting a tool
> > > which runs on the server side to do port redirection, and then when I
> > > type inhttp://server_ip:8443fromanothermachine, it will route me
> > > to my target app. (note: I did NOT set up anySSLcertificate to get
> > > stunnel working)
>
> > > Also with stunnel, I still cannot access the target app without
> > > entering the admin password, I cannot find any response.menu_auth to
> > > remove.
>
> > > I also have anothermacwhich I tried to set up stunnel, but when I
> > > run sudo stunnel3 I got the following error:
> > > anyone familiar withmaccan give some tips on how to solve this:
>
> > > inetd mode must define a remote host or an executable
>
> > > Cheers
> > > Al
> > > On Feb 12, 8:09 am, Brian M  wrote:
>
> > > > Al,
>
> > > > You'd want to get rid of the "edit" " menu when you "Go Live" that's
> > > > just there as a convenience while you're creating things.  Just use
> > > > this (or remove response.menu_edit from menu.py which does it once &
> > > > for all):
> > > >     response.menu_edit = None
> > > > If you don't want auth menu either d

[web2py] Not sure how stunnel works with web2py

2010-02-20 Thread Al
I managed to get stunnel working, though it is a lot more complicated
than I thought
originally. On the windows server, the stunnel.conf file is setup as
server mode and redirect port 8443 to 8000. On the client side, I also
have to set up another stunnel as client mode and redirect
127.0.0.1:80 to 192.168.1.11 - server's IP address. As this server
will be facing public, I cannot expect people to set up stunnel in
their machine in order to access my website. I was expecting a tool
which runs on the server side to do port redirection, and then when I
type in http://server_ip:8443 from another machine, it will route me
to my target app. (note: I did NOT set up any SSL certificate to get
stunnel working)

Also with stunnel, I still cannot access the target app without
entering the admin password, I cannot find any response.menu_auth to
remove.

I also have another mac which I tried to set up stunnel, but when I
run sudo stunnel3 I got the following error:

"inetd mode must define a remote host or an executable"

Anyone familiar with mac can give some tips on how to solve this

Cheers
Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: How to deploy my first app

2010-02-18 Thread Al
Brian,

Thank you for your detailed instructions. I managed to get stunnel
working, though it is a lot more complicated than I thought
originally. On the windows server, the stunnel.conf file is setup as
server mode and redirect port 8443 to 8000. On the client side, I also
have to set up another stunnel as client mode and redirect
127.0.0.1:80 to 192.168.1.11 - server's IP address. As this server
will be facing public, I cannot expect people to set up stunnel in
their machine in order to access my website. I was expecting a tool
which runs on the server side to do port redirection, and then when I
type in http://server_ip:8443 from another machine, it will route me
to my target app. (note: I did NOT set up any SSL certificate to get
stunnel working)

Also with stunnel, I still cannot access the target app without
entering the admin password, I cannot find any response.menu_auth to
remove.

I also have another mac which I tried to set up stunnel, but when I
run sudo stunnel3 I got the following error:
anyone familiar with mac can give some tips on how to solve this:

inetd mode must define a remote host or an executable



Cheers
Al
On Feb 12, 8:09 am, Brian M  wrote:
> Al,
>
> You'd want to get rid of the "edit" " menu when you "Go Live" that's
> just there as a convenience while you're creating things.  Just use
> this (or remove response.menu_edit from menu.py which does it once &
> for all):
>     response.menu_edit = None
> If you don't want auth menu either do
>     response.menu_auth = None
>
> If you want to use the built-in server and be able to access on both
> port 80 and port 443 (SSL) without running two web2py server instances
> you could perhaps use a tunnel program likestunnel(www.stunnel.org).
> Set it up to listen on port 443 (or really any port) and re-direct to
> localhost:80. This way you should be able to get at admin and tickets
> - as far as web2py is concerned you're accessing from the local
> machine so tickets should work, but because it's tunneled it's also
> secured as it goes to your remote computer.
>
> To get the general user to automatically go tohttp://myserver/myfirstapp
> when they type inhttp://myserver/you can either work with routes or
> just take the lazy route and replace the welcome app's default/index
> with a redirect to whatever the home page of myfirstapp is. Of course
> this will break the welcome app, but do you really want/need it when
> deployed anyway?
>
> #in the Welcome application's default.py controller
> def index():
>     redirect(URL(a='myfirstapp', c='default', f='index'))
>
> Setting up web2py as a Windows Service is easy 
> enough:http://www.web2py.com/AlterEgo/default/show/77
>
> ~Brian
>
> On Feb 11, 9:54 am, Al  wrote:
>
> > Thank you for your input. I am using Windows server so I cannot use
> > the ubuntu scripts you mentioned. How about my second part of the
> > question? I understand why web2py is designed in such a "secure"
> > fashion. I am just trying to find a way around it so that I can deploy
> > my first app. I theory I should be able to type from any 
> > machinehttp://myserver/myfirstapp, but it gives me an internal error - 
> > Ticket
> > issues. When I click the ticket link, it gives "Admin is disabled
> > because insecure channel". I have two instances of web2py running. I
> > can runhttp://myserver/exampleorhttps://myserver/myfirstappwithout
> > any issues. What's so special about the built-in examples app? Do I
> > have to cut out some code from my app to get rid of all the admin menu
> > and authentication for a general users?
>
> > On Feb 10, 11:38 pm, mdipierro  wrote:
>
> > > It depends. For development if you use the built in web server you
> > > need to start it twice for http and https. This is in general a
> > > security measure. You do not want the same process to listen to two
> > > sockets else if something happens (like a memory leak) you may get
> > > locked out.
>
> > > In deployment you should be using apache+mod_wsgi
>
> > > just download and run 
> > > this:http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
>
> > > It will setup everything for you behind a single apache server.
> > > I think this easier than rails actually.
>
> > > Massimo
>
> > > On Feb 10, 9:27 am, Al  wrote:
>
> > > > Hi,
>
> > > > Now that I get my secure channel (using self-signed certificate)
> > > > working, I can remotely login from another computer to access the
> > > > admin interface thru https. Todeploythis app for g

[web2py] Re: How to deploy my first app

2010-02-11 Thread Al
Thank you for your input. I am using Windows server so I cannot use
the ubuntu scripts you mentioned. How about my second part of the
question? I understand why web2py is designed in such a "secure"
fashion. I am just trying to find a way around it so that I can deploy
my first app. I theory I should be able to type from any machine
http://myserver/myfirstapp, but it gives me an internal error - Ticket
issues. When I click the ticket link, it gives "Admin is disabled
because insecure channel". I have two instances of web2py running. I
can run http://myserver/example or https://myserver/myfirstapp without
any issues. What's so special about the built-in examples app? Do I
have to cut out some code from my app to get rid of all the admin menu
and authentication for a general users?

On Feb 10, 11:38 pm, mdipierro  wrote:
> It depends. For development if you use the built in web server you
> need to start it twice for http and https. This is in general a
> security measure. You do not want the same process to listen to two
> sockets else if something happens (like a memory leak) you may get
> locked out.
>
> In deployment you should be using apache+mod_wsgi
>
> just download and run 
> this:http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
>
> It will setup everything for you behind a single apache server.
> I think this easier than rails actually.
>
> Massimo
>
> On Feb 10, 9:27 am, Al  wrote:
>
> > Hi,
>
> > Now that I get my secure channel (using self-signed certificate)
> > working, I can remotely login from another computer to access the
> > admin interface thru https. Todeploythis app for general users for
> > http access, do I have to run another instance of web2py on another
> > port - say port 80? Also how do I make these 2  instances to run as a
> > service in windows 2003 server? Also do I have to change the code so
> > that the general user just get directly to that single app? This whole
> > thing seems a lot more complicated than ruby on rails. I would
> > appreciate if people can explain this in more detail to me or point me
> > to the right documentations. Thanks.
>
> > Cheers
> > Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] How to deploy my first app

2010-02-10 Thread Al
Hi,

Now that I get my secure channel (using self-signed certificate)
working, I can remotely login from another computer to access the
admin interface thru https. To deploy this app for general users for
http access, do I have to run another instance of web2py on another
port - say port 80? Also how do I make these 2  instances to run as a
service in windows 2003 server? Also do I have to change the code so
that the general user just get directly to that single app? This whole
thing seems a lot more complicated than ruby on rails. I would
appreciate if people can explain this in more detail to me or point me
to the right documentations. Thanks.

Cheers
Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: admin access from remote machine

2010-02-04 Thread Al
I tried to follow the instructions on 
http://www.web2py.com/AlterEgo/default/show/140,
but on the second step I get an error: "Unable to load config info
from /usr/local/ssl/openssl.cnf" when creating the certificate

Was the instruction meant for linux/Mac OS X? Any advise?

Al

On Feb 2, 11:37 pm, Drapko Nitzhonot  wrote:
> I use HTTPS and I can access from any LAN machine without any problem.
> Followhttp://www.web2py.com/AlterEgo/default/show/140steps
>
> I start the server with: python web2py.py --nogui -c server.crt -k
> server.key -i 192.168.1.1 -p  -a myserverpassword
>
> On Tue, Feb 2, 2010 at 4:27 PM, Timothy Farrell  wrote:
> > Al,
>
> > I run a similar setup.  But it matters which webserver you're using.  If
> > you don't know, then you're using the built-in webserver.
>
> > If you can access the website from the server itself there are two things
> > to check (this assumes the built-in webserver):
> > 1) Did you configure web2py to serve on the '0.0.0.0' interface instead of
> > '127.0.0.1'?
> > 2) Could your firewall on Server 2003 (or otherwise) be blocking the ports?
>
> > Other than that, we need more details in order to help you.
>
> > Thanks,
> > -tim
>
> > On 2/2/2010 4:00 AM, Al wrote:
>
> >> Hi,
>
> >> I have just started to learn web2py recently. I have installed web2py
> >> in a windows 2003 server and it runs OK, but I cannot access it from
> >> any other machine. I have looked thru a few discussions which
> >> described using tunneling and proxy stuff, is there a simple way to
> >> disable such security - e.g, commenting a few lines of codes. As the
> >> person who will be doing some data entry into my application cannot
> >> sit close to the windows server, so I am kind of stuck.
>
> >> Al
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "web2py-users" group.> To post to this group, send email 
> > toweb...@googlegroups.com.
> > To unsubscribe from this group, send email 
> > to>web2py+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: admin access from remote machine

2010-02-04 Thread Al
Thank you for all the help...

The firewall service was never started so it was not an issue -
otherwise portqry would show "filtered" rather than "not listening".
One of the mistakes I made was that the cherrypy server was started
with 127.0.0.1 instead of 0.0.0.0.

Now I can assess the machine and see the admin interface, but when I
get "Admin is disabled because insecure channel" after I login with my
admin password. I guess I have to set up the SSL certificate  -
quite daunting - will give it a try.

I also try to delete code from access.py and appadmin.py but never
quite successful, as I kept getting some tickets, I must have deleted
more than what is required.

Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: admin access from remote machine

2010-02-02 Thread Al
I did try https but also with no success. Also querying the port of
this server (using portqry) gives NOT LISTENING. If the web2py built-
in server is running on port 8000, why does it say not listening?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: admin access from remote machine

2010-02-02 Thread Al
I have not "integrate" it with the w2k3 server, I just click the
web2py.exe and run the built-in server. Do I need to start the server
in a special way so that I can use https to gain admin access? Any
setting I have to twist in this Cherry web server?

Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Search function

2010-02-02 Thread Al
I am trying to incorporate a "Search" function into my web2py
application. I have found similar thing in the sample appliance such
as the KPAX and the C.R.M application, could someone detail how I
could copy code from these apps. Is there a way to trace the relevant
section of code for the search function (ajax, controllers, views,
etc), I have spent the whole day and can't get it to work. I just want
to search on two fields - Title and Keywords of a table - a generic
search would also be good if the performance is not too bad

Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] admin access from remote machine

2010-02-02 Thread Al
Hi,

I have just started to learn web2py recently. I have installed web2py
in a windows 2003 server and it runs OK, but I cannot access it from
any other machine. I have looked thru a few discussions which
described using tunneling and proxy stuff, is there a simple way to
disable such security - e.g, commenting a few lines of codes. As the
person who will be doing some data entry into my application cannot
sit close to the windows server, so I am kind of stuck.

Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Reading JSON file every minute

2010-02-01 Thread Al
Hi,

I am using web2py to build an application to read a few  .JSON files
which are updated periodically (every 300s), the information within
the files will be decoded and used to update a database as well update
some screens. As I am new to all web2py and python, could anyone tell
me  how I can load each json file and assigned it to an array or some
appropriate data structure. Also in order to detect if the json file
was updated, are there some built in functions which can detect such a
change or I have to write code to check after loading it into the
database. It seems that web2py has a lot of magic functions which can
be used to make things a lot simpler than other framework or
languages.

Cheers
Al

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.