Re: [web2py] Re: ldap import problem

2015-08-26 Thread Johann Spies
Thanks Massimo.  After installing python-ldap the problem was solved.  I
did not realise that the package in gluon/contrib was dependent on external
stuff.

Regards
Johann

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

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


[web2py] Re: can't start git-based web2py on windows, pydal errors

2015-08-26 Thread Tim Richardson
Sorry, false alarm. Bad changes to routes.py 



On Thursday, 27 August 2015 10:35:34 UTC+10, Tim Richardson wrote:
>
> On Windows Server 2008R2 I have web2py git cloned. 
> at the moment 
> python web2py.py
>
> does not start. 
>
> Traceback (most recent call last):
>   File "web2py.py", line 18, in 
> import gluon.widget
>   File "c:\Users\tim\web2py_dev\gluon\widget.py", line 26, in 
> import gluon.main as main
>   File "c:\Users\tim\web2py_dev\gluon\main.py", line 129, in 
> load_routes()
>   File "c:\Users\tim\web2py_dev\gluon\rewrite.py", line 318, in load
> exec (data + '\n') in symbols
>   File "", line 25, in 
>   File "c:\Users\tim\web2py_dev\gluon\fileutils.py", line 460, in abspath
> path = os.path.join(*relpath)
>   File "e:\Python27_32\lib\ntpath.py", line 66, in join
> p_drive, p_path = splitdrive(p)
>   File "e:\Python27_32\lib\ntpath.py", line 114, in splitdrive
> if len(p) > 1:
> TypeError: object of type 'NoneType' has no len()
>
>
> This happens with trunk and if I checkout the latest tagged release, but I 
> suppose it has more to do with pydal
> git submodule status tells me  /dal (v15.07) 
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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] can't start git-based web2py on windows, pydal errors

2015-08-26 Thread Tim Richardson
On Windows Server 2008R2 I have web2py git cloned. 
at the moment 
python web2py.py

does not start. 

Traceback (most recent call last):
  File "web2py.py", line 18, in 
import gluon.widget
  File "c:\Users\tim\web2py_dev\gluon\widget.py", line 26, in 
import gluon.main as main
  File "c:\Users\tim\web2py_dev\gluon\main.py", line 129, in 
load_routes()
  File "c:\Users\tim\web2py_dev\gluon\rewrite.py", line 318, in load
exec (data + '\n') in symbols
  File "", line 25, in 
  File "c:\Users\tim\web2py_dev\gluon\fileutils.py", line 460, in abspath
path = os.path.join(*relpath)
  File "e:\Python27_32\lib\ntpath.py", line 66, in join
p_drive, p_path = splitdrive(p)
  File "e:\Python27_32\lib\ntpath.py", line 114, in splitdrive
if len(p) > 1:
TypeError: object of type 'NoneType' has no len()


This happens with trunk and if I checkout the latest tagged release, but I 
suppose it has more to do with pydal
git submodule status tells me  /dal (v15.07) 


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


[web2py] Re: Web2py Restfull API Token authentication

2015-08-26 Thread Matheus Cardoso
Stefan,

If I'm not wrong you can do the following with Angular:

.factory('API', ['$resource', function($resource){
return $resource("api/product/id/:id", {id: '@id'});
}]);

Am I right?

On Tuesday, August 25, 2015 at 10:37:15 AM UTC-3, Stefan van den Eertwegh 
wrote:
>
> Hi everyone,
>
> If i search on authentication for restfull API web2py i get basic auth as 
> a result in google and google groups.
> Does anyone know how to use a token authentication for the Restfull 
> service like db.auth_user.token ...?
>
> 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.


[web2py] Re: add icons to table

2015-08-26 Thread Dave S


On Wednesday, August 26, 2015 at 1:12:26 PM UTC-7, Dave S wrote:
>
>
>
> On Wednesday, August 26, 2015 at 6:03:04 AM UTC-7, Iancic Bogdan wrote:
>>
>> All the images will be saved in static
>>
>> On Wednesday, August 26, 2015 at 2:54:25 PM UTC+2, Iancic Bogdan wrote:
>>>
>>> I want to add a column to my table where will be displayed icons. Also, 
>>> when the user clicks on the icon I would like the icon to overlay.
>>>
>>> Can anyone help? I looked over the documentation but I didn't find 
>>> anything
>>>
>>  

>
> What do you mean by "overlay"?
>
> I do something like this in a view:
>
> 
> /* thead stuff */
>   {{if datalist[3] == 0:}}
>   {{errstat = IMG(_src=URL('static', "images/greenlite.png"), 
> _alt="Green Traffic Light Picture")}}
>   {{else:}}
>   {{errstat = IMG(_src=URL('static', "images/redlite.png"), 
> _alt="Red Traffic Light Picture")}}
>   {{pass}}
>   {{=TR(/* various fields */, TD( 
> A(errstat,_href=URL('detailinfo.html',
>   vars=dict(var1=datalist[1], var2=datalist[0]) 
>   }}
> 
>
> clicking on the image takes you to a page that gives you more detail.  You 
> could make that be an AJAX call if you wanted the details to be shown in a 
> DIV on the current page.
>
>
For HTML created in a controller, I do
  if ord(msg[1]) == 0:
display_str = CAT(display_str,
  "  ",
  IMG(_src=URL('static', "images/redlite.png"),
   _alt="Red Traffic Light Picture"),
  "\n")
  else:
display_str = CAT(display_str,
  "",
  IMG(_src=URL('static', "images/greenlite.png"),
   _alt="Green Traffic Light Picture"),
  "\n")
  display_str = display_str +  "   error flags:\n"


but that part isn't incorporated into a table (it's displayed in a PRE 
block).

/dps
 

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


[web2py] Re: add icons to table

2015-08-26 Thread Dave S


On Wednesday, August 26, 2015 at 6:03:04 AM UTC-7, Iancic Bogdan wrote:
>
> All the images will be saved in static
>
> On Wednesday, August 26, 2015 at 2:54:25 PM UTC+2, Iancic Bogdan wrote:
>>
>> I want to add a column to my table where will be displayed icons. Also, 
>> when the user clicks on the icon I would like the icon to overlay.
>>
>> Can anyone help? I looked over the documentation but I didn't find 
>> anything
>>
>
What do you mean by "overlay"?

I do something like this in a view:


/* thead stuff */
  {{if datalist[3] == 0:}}
  {{errstat = IMG(_src=URL('static', "images/greenlite.png"), 
_alt="Green Traffic Light Picture")}}
  {{else:}}
  {{errstat = IMG(_src=URL('static', "images/redlite.png"), 
_alt="Red Traffic Light Picture")}}
  {{pass}}
  {{=TR(/* various fields */, TD( 
A(errstat,_href=URL('detailinfo.html',
  vars=dict(var1=datalist[1], var2=datalist[0]) 
  }}


clicking on the image takes you to a page that gives you more detail.  You 
could make that be an AJAX call if you wanted the details to be shown in a 
DIV on the current page.


/dps

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


[web2py] Re: Embed all process in a LOAD

2015-08-26 Thread Jose


El miércoles, 26 de agosto de 2015, 13:33:06 (UTC-3), Leonel Câmara 
escribió:
>
> Just make sure all the links inside the LOAD have a cid with the same id 
> as the container where you're loading the component. A simple way is to 
> simply put cid=request.cid in them.
>
> Example:
>
> {{=A('click me', _href=URL_TO_LOAD_INPLACE, cid=request.cid)}}
>

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.


[web2py] Re: web2py is giving an inetrnal error

2015-08-26 Thread Leonel Câmara
Can you show us the error? We can't really follow a link to your loopback 
address.

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


[web2py] Re: Embed all process in a LOAD

2015-08-26 Thread Niphlod
technically all LOADed components exhibit this behaviour automatically.

On Wednesday, August 26, 2015 at 6:33:06 PM UTC+2, Leonel Câmara wrote:
>
> Just make sure all the links inside the LOAD have a cid with the same id 
> as the container where you're loading the component. A simple way is to 
> simply put cid=request.cid in them.
>
> Example:
>
> {{=A('click me', _href=URL_TO_LOAD_INPLACE, cid=request.cid)}}
>

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


[web2py] Re: Embed all process in a LOAD

2015-08-26 Thread Leonel Câmara
Just make sure all the links inside the LOAD have a cid with the same id as 
the container where you're loading the component. A simple way is to simply 
put cid=request.cid in them.

Example:

{{=A('click me', _href=URL_TO_LOAD_INPLACE, cid=request.cid)}}

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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] Embed all process in a LOAD

2015-08-26 Thread Jose
Hi,

I have in my view a LOAD showing some data. It also has some links that call
: a form and list.

What I want is for all calls and processes to run embedded inside my 
container, similar to what would make an iframe. I tried ajax_trap = True, 
but is only for forms.

Best regards,
Jose

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


[web2py] Re: Web2py Restfull API Token authentication

2015-08-26 Thread Stefan van den Eertwegh
Oke. If it works it's oke.

But lets say massimo, i want to communicate with the restful service from 
web2py from angularJS, i see 2 possible bottlenecks.
I cant use the $resource function because the web2py api is 
api/product/id/3 and not api/product/3 and there is no way to authenticate 
with web2py from angularJS using something other than plain text basic_auth.

Am i right?

Greetings,
Stefan

Op woensdag 26 augustus 2015 17:59:51 UTC+2 schreef Massimo Di Pierro:
>
> That logic was added and then removed from auth, under the assumption that 
> we would add support for JWT.
> This is open for discussion.
>
> On Tuesday, 25 August 2015 08:37:15 UTC-5, Stefan van den Eertwegh wrote:
>>
>> Hi everyone,
>>
>> If i search on authentication for restfull API web2py i get basic auth as 
>> a result in google and google groups.
>> Does anyone know how to use a token authentication for the Restfull 
>> service like db.auth_user.token ...?
>>
>> 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.


[web2py] Re: import_from_csv_file and id_map={}

2015-08-26 Thread Massimo Di Pierro
yes

On Tuesday, 25 August 2015 18:02:40 UTC-5, Mark Li wrote:
>
> Is id_map still necessary to preserver references when using 
> import_form_csv_file function?
>
> I read this in the docs (
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#CSV--all-tables-at-once-
> ):
>
> "When importing, the new records will be appended to the database if it is 
> not empty. In general the new imported records will not have the same 
> record id as the original (saved) records but web2py will restore 
> references so they are not broken, even if the id values may change."
>
> This does not have any explicit mention of using the id_map parameter, so 
> is it still necessary to preserve the references between tables?
>
> On Tuesday, March 17, 2015 at 7:33:21 AM UTC-7, Tom Clerckx wrote:
>>
>> Thanks.
>>
>> I will try to make some time and contribute in that way.
>>
>> Note:
>> You may want to update the link to your profile on 
>> http://web2py.com/init/default/who
>> --> it results in a page not found.
>>
>> Best regards,
>> Tom.
>>
>> On Wednesday, March 11, 2015 at 7:07:04 PM UTC+1, Tom Clerckx wrote:
>>>
>>> I recently learned (by searching through the google-group) the 
>>> usefulness of the id_map={} parameter in the db.import_from_csv_file 
>>> function.
>>> I was wondering why this is not included in the documentation of web2py?
>>>
>>> Is this on the 'todo' list or is there another reason why it is not 
>>> included?
>>>
>>> Best regards,
>>> Tom.
>>>
>>

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


[web2py] Re: Web2py Restfull API Token authentication

2015-08-26 Thread Massimo Di Pierro
That logic was added and then removed from auth, under the assumption that 
we would add support for JWT.
This is open for discussion.

On Tuesday, 25 August 2015 08:37:15 UTC-5, Stefan van den Eertwegh wrote:
>
> Hi everyone,
>
> If i search on authentication for restfull API web2py i get basic auth as 
> a result in google and google groups.
> Does anyone know how to use a token authentication for the Restfull 
> service like db.auth_user.token ...?
>
> 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.


Re: [web2py] Re: ldap import problem

2015-08-26 Thread Massimo Di Pierro
I understand that but that is not the problem. 

When you say import ldap, web2py tries to import it from various location. 
When it fails to import from all locations, it reports the error you see 
and the error include the path to the first location it tried. That does 
not mean that it did not try the other locations.

So, please try the regular python shell (not the web2py shell) and type 
there

import ldap

Massimo


On Tuesday, 25 August 2015 00:56:41 UTC-5, Johann Spies wrote:
>
>
>
> On 24 August 2015 at 16:20, Massimo Di Pierro  
> wrote:
>
> So the problem is that it cannot import ldal. Do you know it works from 
>> the normal python shell?
>>
>> >>> import ldap
>>
>> Does it work from the web2py shell?
>>
>
>
> No, I cannot import ldap. I also tried it from another app (welcome) this 
> time:
>
>
> In [1]: import ldap
> ---
> ImportError   Traceback (most recent call last)
> /home/js/web2py/applications/welcome/models/menu.py in ()
> > 1 import ldap
>
> /home/js/web2py/gluon/custom_import.pyc in custom_importer(name, globals, 
> locals, fromlist, level)
>  87 result = result or 
> sys.modules[modules_prefix+'.'+itemname]
>  88 except KeyError, e:
> ---> 89 raise ImportError, 'Cannot import 
> module %s' % str(e)
>  90 modules_prefix += "." + itemname
>  91 return result
>
> ImportError: Cannot import module 'applications.welcome.modules.ldap'
>
> and the same with ldap_auth:
>
> import ldap_auth
> ---
> ImportError   Traceback (most recent call last)
> /home/js/web2py/applications/welcome/models/menu.py in ()
> > 1 import ldap_auth
>
> /home/js/web2py/gluon/custom_import.pyc in custom_importer(name, globals, 
> locals, fromlist, level)
>  87 result = result or 
> sys.modules[modules_prefix+'.'+itemname]
>  88 except KeyError, e:
> ---> 89 raise ImportError, 'Cannot import 
> module %s' % str(e)
>  90 modules_prefix += "." + itemname
>  91 return result
>
> ImportError: Cannot import module 'applications.welcome.modules.ldap_auth'
>
>
>
> Regards
> Johann
>

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


[web2py] Re: Unable to install HandsOnTable plugin

2015-08-26 Thread Martti Lamberg


On Sunday, August 23, 2015 at 3:08:46 AM UTC+3, Massimo Di Pierro wrote:
>
> that plugin is a little old and hands on table is evolved since. Using 
> hands on table does not really require the plugin, it is very easy to use, 
> and it purely client side.
>
> On Friday, 21 August 2015 18:34:27 UTC-5, Dave S wrote:
>>
>>
>>
>> On Thursday, August 20, 2015 at 10:17:59 PM UTC-7, Martti Lamberg wrote:
>>>
>>> I can't install HandsOnTable plugin into my app. Tried the automatic 
>>> plugin installer in .../admin/default/plugins/"my_app" but it says:
>>>
>>> unable to install plugin 
 "web2py.plugin.HandsOnTable_plugin_for_a_spreadsheet.w2p"
>>>
>>>
>>> Tried manually installing it too. I downloaded the 
>>> "plugin_hotsheet-master-fe9652df3fa5968449ac445f406a0e6c473df37f.tar.gz" 
>>> and uploaded it to the app. This time it says:
>>>
>>> App does not exist or you are not authorized
>>>
>>>
>>> Niice. So what to do? Can I install it by manually dropping the files to 
>>> the app folder? Which files and where exactly?
>>>
>>
>> I'm also interested in the answer, but has anyone turned this into a 
>> Web2Py plug-in?
>>
>> I suspect that you need to unzip/tar the download file, and copy the 
>> javascript files to your app's static directory.
>> (Speaks the person who has never tried that with any javascript, not even 
>> an autocompleter)
>>
>> /dps
>>  
>>
>
Okay, I'll try it without the plugin. 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.


[web2py] web2py is giving an inetrnal error

2015-08-26 Thread Vineeta Jain
when i am opening web2py framework it is giving an internal error as:

Ticket issued: 
welcome/127.0.0.1.2015-08-24.14-15-43.bc2b872a-1f3a-4d23-9030-6eb6823ebdc3 

.

What is the issue and how can it be resolved?

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


[web2py] Re: routes.py causing loss of css

2015-08-26 Thread David Ripplinger
Thank you, Anthony. That helps. In my app, things will soon get complex 
enough that the pattern-based system will suit me best. With your help, I 
think I understand it a bit better now. I got it to work for what I need in 
this first test by simply removing '$anything'.

On Wednesday, August 26, 2015 at 11:45:42 AM UTC-4, Anthony wrote:
>
> Your routes.py maps literally *any *URL (including static URLs) to just 
> the single /myapp/default/index URL. When using $anything in the first item 
> of the tuple, you should also append it to the second so whatever arbitrary 
> part of the original URL was matched gets retained. In any case, you 
> probably don't want to match /$anything to a specific controller and 
> function (at least not as the first rule, as that will match all incoming 
> URLs).
>
> If you just want to eliminate the application name for URLs and specify a 
> default controller and function, the parameter-based rewrite system is a 
> better option.
>
> Anthony
>
> On Wednesday, August 26, 2015 at 11:33:53 AM UTC-4, David Ripplinger wrote:
>>
>> Hi everyone,
>>
>> I know I'm doing something wrong here. I'm trying out app-specific 
>> routes.py files. I have an app that currently has the default/index page 
>> unmodified, that is, it's equivalent to the welcome app.
>>
>> I have in the web2py base directory the following contents in my 
>> routes.py file:
>> routes_app = (
>>  ('/$anything', 'myapp'),
>>  )
>>
>> I have in the application directory myapp the following contents in my 
>> routes.py file:
>> routes_in = (
>>  ('/$anything', '/myapp/default/index'),
>>  )
>>
>> I just wanted to see if, with these initial rules, I could simply visit 
>> the url '/' and get to '/myapp/default/index'. More complex rules will be 
>> going in once I have this working. It loads the correct page, but it is 
>> entirely unformatted, making me think that somehow the css file didn't get 
>> through or something.
>>
>> I don't know if it's significant, but I'm running web2py on localhost 
>> with ssl using:
>> web2py.exe -c ssl/server.crt -k ssl/server.key
>>
>> I observed normal behavior with the ssl before introducing the routes.py 
>> files.
>>
>> Is there something I'm doing wrong?
>>
>

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


[web2py] Re: routes.py causing loss of css

2015-08-26 Thread Niphlod

ahem. you're rewriting ANYTHING to a single url. Can you see why 
there's something clearly wrong with your scheme ? :D

if you want MULTIPLE urls to work, you need to leave something on the left 
and the right side to be the "unique" parts of the urls.

if you want / to go to /app/default/index , the syntax is

'/', '/app/default/index'


'/$anything', '/app/default/index' 


is - correctly - collapsing all requests to that function

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


[web2py] Re: routes.py causing loss of css

2015-08-26 Thread Anthony
Your routes.py maps literally *any *URL (including static URLs) to just the 
single /myapp/default/index URL. When using $anything in the first item of 
the tuple, you should also append it to the second so whatever arbitrary 
part of the original URL was matched gets retained. In any case, you 
probably don't want to match /$anything to a specific controller and 
function (at least not as the first rule, as that will match all incoming 
URLs).

If you just want to eliminate the application name for URLs and specify a 
default controller and function, the parameter-based rewrite system is a 
better option.

Anthony

On Wednesday, August 26, 2015 at 11:33:53 AM UTC-4, David Ripplinger wrote:
>
> Hi everyone,
>
> I know I'm doing something wrong here. I'm trying out app-specific 
> routes.py files. I have an app that currently has the default/index page 
> unmodified, that is, it's equivalent to the welcome app.
>
> I have in the web2py base directory the following contents in my routes.py 
> file:
> routes_app = (
>  ('/$anything', 'myapp'),
>  )
>
> I have in the application directory myapp the following contents in my 
> routes.py file:
> routes_in = (
>  ('/$anything', '/myapp/default/index'),
>  )
>
> I just wanted to see if, with these initial rules, I could simply visit 
> the url '/' and get to '/myapp/default/index'. More complex rules will be 
> going in once I have this working. It loads the correct page, but it is 
> entirely unformatted, making me think that somehow the css file didn't get 
> through or something.
>
> I don't know if it's significant, but I'm running web2py on localhost with 
> ssl using:
> web2py.exe -c ssl/server.crt -k ssl/server.key
>
> I observed normal behavior with the ssl before introducing the routes.py 
> files.
>
> Is there something I'm doing wrong?
>

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


[web2py] Re: Is there any alternative to Pythonanywhere hosting?

2015-08-26 Thread Derek
You could open a connection to both databases then copy the data over that 
way. That's what my day job is, transferring data, ETL.

On Sunday, August 23, 2015 at 7:49:12 PM UTC-7, Joe wrote:
>
> Yes, now I can connect but I wasn't able to connect before. First, I 
> couldn't upload the packaged app using the admin interface because I didn't 
> know about PythonAnywhere's app size upload limit. Then, after I uploaded 
> the app using sftp I was getting the error messages every time I tried a 
> new code to connect to mysql. I don't have a lot of experience, I learn as 
> I go.
>
> Now, that I can connect to mysql, I tried a couple of different things to 
> transfer/migrate the data but I don't know enough to make it work. The data 
> is videos and images so I can't use a CSV file to transfer it and 
> migrating  the records one table at the time to rebuild meta data is way 
> over my head. However, now at least I can connect to the database so what I 
> have to do is to insert all the records again manually to the mysql.
>
> Thanks for your help and please kindly understand that because I am just 
> learning this process, I often need a bit more support than the experienced 
> developers.
>
> Thanks again.
>
> Cheers,
>
> Joe
>
> On Tuesday, August 18, 2015 at 8:52:24 PM UTC+8, Glenn Jones wrote:
>>
>> That sounds like you are connecting to the database, you're just not 
>> seeing the data you expect. How did you transfer the data from sqlite to 
>> MySQL?
>>
>> On Tuesday, 18 August 2015 10:14:54 UTC+1, Joe wrote:
>>>
>>> Hi Glenn, Yes, that's me. 
>>> Of course, I would be happy if you could help me out here as well! 
>>> Thanks very much, I appreciate it!
>>>
>>> On Tuesday, August 18, 2015 at 4:56:54 PM UTC+8, Glenn Jones wrote:

 Hi Joe,

 PythonAnywhere dev here (glenn on the Forums). Are you the guy I was 
 talking to in the forum thread titled "Web2py app connecting to mysql 
 database"? If you are, do you mind if I chime in to this with some of the 
 details we worked out to give the web2py guys a little more to work on?

 On Sunday, 16 August 2015 23:50:03 UTC+1, Massimo Di Pierro wrote:
>
> I would talk to them. They are very supporting. Anyway that said. You 
> can use any hosting you want. I use Python Anywhere, Digital Ocean, 
> Google 
> App Engine, and Google Managed VM (with Docker) for different projects.
>
> On Sunday, 16 August 2015 15:43:21 UTC-5, DaneW wrote:
>>
>> I've been using PythonAnywhere happily for over 2 years. The database 
>> (now with over 12m records) has worked perfectly under SQLite and later 
>> MySQL - although I do get error 1226 about exceeding 
>> max_user_connections 
>> every so often.
>>
>> In the db.py model I have  db = 
>> DAL('mysql://aaa:bbb@mysql.server/ccc$db1',pool_size=0,lazy_tables=True,check_reserved=['all'])
>>  
>>  - where aaa is my user name, bbb is my MySQL password and ccc$db1 is my 
>> database name.
>>
>> I used to have pool_size=1 but in the light of Annet's suggestion 
>> I've changed it to 0 and it seems to be working ok. Also PythonAnywhere 
>> are 
>> saying that recent infrastructure changes mean that we should alter 
>> mysql.server to *yourusername*.mysql.pythonanywhere-services.com but 
>> that results in my website crashing immediately so I've left it as it 
>> used 
>> to be for the time being.
>>
>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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 causing loss of css

2015-08-26 Thread David Ripplinger
Hi everyone,

I know I'm doing something wrong here. I'm trying out app-specific 
routes.py files. I have an app that currently has the default/index page 
unmodified, that is, it's equivalent to the welcome app.

I have in the web2py base directory the following contents in my routes.py 
file:
routes_app = (
 ('/$anything', 'myapp'),
 )

I have in the application directory myapp the following contents in my 
routes.py file:
routes_in = (
 ('/$anything', '/myapp/default/index'),
 )

I just wanted to see if, with these initial rules, I could simply visit the 
url '/' and get to '/myapp/default/index'. More complex rules will be going 
in once I have this working. It loads the correct page, but it is entirely 
unformatted, making me think that somehow the css file didn't get through 
or something.

I don't know if it's significant, but I'm running web2py on localhost with 
ssl using:
web2py.exe -c ssl/server.crt -k ssl/server.key

I observed normal behavior with the ssl before introducing the routes.py 
files.

Is there something I'm doing wrong?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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: populate form in view

2015-08-26 Thread Jim Steil
Thanks for the correction Anthony, I didn't know that.

-Jim

On Wed, Aug 26, 2015 at 10:07 AM, Anthony  wrote:

> There's nothing wrong with calling .process() when the form is first
> defined. Your code is exactly equivalent to the original.
>
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/lvimBCvBDl0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: populate form in view

2015-08-26 Thread Anthony
There's nothing wrong with calling .process() when the form is first defined. 
Your code is exactly equivalent to the original.

Anthony

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


[web2py] Re: Is this use of the scheduler correct?

2015-08-26 Thread Niphlod
this is how you queue tasks, and there's nothing wrong with it. 
The missing point here is 1. : there is a limit to the number of concurrent 
workers, which is how many you start from the commandline... and, BTW, even 
if you queue 10k tasks, you can't expect to start 10k scheduler processes 
on a single server and observe every task completed in a single loop. 
web2py's scheduler with a postgresql backend starts to show its limits with 
30~50 workers on modest hardware, i.e. even if you launch more, they won't 
get speedier in regards of concurrent execution. 
Given that it seems that you need to ingest data and probably the ingested 
goes on the same database, there's another probable concurrency penalty to 
consider. 

On Monday, August 24, 2015 at 12:42:58 AM UTC+2, Phillip wrote:
>
> 1.My goal is to use the scheduler to concurrently process as many files as 
> possible (I assume there is no limit to the number of processes and the 
> scheduler will prevent the server from dropping them).
>
> 2.My tasks are defined in a module, not model.
>
> 3.It is in the view that a potentially large number of items are selected 
> which triggers the callback and process below.
>
> 4.* I*n the function importData, the database is accessed and records 
> added.
>
>
> for dataID in dataIDs:
>
>   scheduler.queue_task(ImportData, [dataID], timeout=100)
>
>
> Is there anything I am missing to properly and fully utilize the scheduler 
> for this purpose?
>
> Please post any caveats, corrections, or tips, and let me know if any 
> other information is needed.
>
>
> Thanks,
>
> PV
>

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


[web2py] Re: populate form in view

2015-08-26 Thread Jim S
I'm confused by the use of .process() at the end of your SQLFORM 
instantiation.

Instead, I would do this:

form = SQLFORM(db.certificate_request)

if form.process().accepted:
response.flash = 'new CSR registered'
redirect(URL('customerArea', 'index')

Hope that helps.

-Jim

On Tuesday, August 25, 2015 at 7:52:53 AM UTC-5, Iancic Bogdan wrote:
>
> sure
>
> form = SQLFORM(db.certificate_request).process()
> if form.accepted:
> response.flash = 'new CSR registered'
> redirect(URL('customerArea','index'))
>
> On Tuesday, August 25, 2015 at 2:51:27 PM UTC+2, Jim S wrote:
>>
>> Can we see the form definition from your controller?
>>
>> -Jim
>>
>>
>> On Tuesday, August 25, 2015 at 7:16:49 AM UTC-5, Iancic Bogdan wrote:
>>>
>>> I want to populate a form, besides the input that the user inserts.
>>>
>>> This is the code from view:
>>> 
>>> var MattsPublicKeyString = cryptico.publicKeyString(MattsRSAkey);
>>>
>>> print("Matt's public key string:");
>>> print(MattsPublicKeyString);
>>> 
>>> 

Re: [web2py] Re: add icons to table

2015-08-26 Thread Ovidio Marinho
look at this
http://www.w3schools.com/bootstrap/bootstrap_ref_comp_glyphs.asp





   [image: http://itjp.net.br] 
 http://itjp.net.b r
  *Ovidio Marinho Falcao Neto*
 ovidio...@gmail.com
Brasil


2015-08-26 10:03 GMT-03:00 Iancic Bogdan :

> All the images will be saved in static
>
>
> On Wednesday, August 26, 2015 at 2:54:25 PM UTC+2, Iancic Bogdan wrote:
>>
>> I want to add a column to my table where will be displayed icons. Also,
>> when the user clicks on the icon I would like the icon to overlay.
>>
>> Can anyone help? I looked over the documentation but I didn't find
>> anything
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: add icons to table

2015-08-26 Thread Iancic Bogdan
All the images will be saved in static

On Wednesday, August 26, 2015 at 2:54:25 PM UTC+2, Iancic Bogdan wrote:
>
> I want to add a column to my table where will be displayed icons. Also, 
> when the user clicks on the icon I would like the icon to overlay.
>
> Can anyone help? I looked over the documentation but I didn't find anything
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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] add icons to table

2015-08-26 Thread Iancic Bogdan
I want to add a column to my table where will be displayed icons. Also, 
when the user clicks on the icon I would like the icon to overlay.

Can anyone help? I looked over the documentation but I didn't find anything

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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.