Re: [web2py] Re: Embed youtube videos

2012-06-06 Thread Kevin Miller
Ok thanks for answering. Thanks for the idea. I include the first part of
the url and replace the code section with the argument passed to the view.
When I used the entire URL it did not work. The only problem I don't like
with this approach is that the user has to enter the code (which is
sometimes hard to extract for some users) in the form. Is there an easy way
for the user? To just copy the url or something like that.

Thanks again.


On Wed, Jun 6, 2012 at 10:48 PM, pbreit  wrote:

> Should be pretty easy. Once you capture the YouTube URL, just pass it to a
> view and then:
>
> === view.html ===
>src="{{=video.url}}?autoplay=1&origin=http://example.com";
>   frameborder="0"/>
>
> === controller.py ===
> def play_video():
> video = db.video(request.args(0))
> return dict(video=video)
>
> video.url would need to be something like "
> http://www.youtube.com/embed/u1zgFlCw8Aw";. You can store the whole URL or
> just the YouTube code ("u1zgFlCw8Aw").
>
> From:
> https://developers.google.com/youtube/player_parameters#Embedding_a_Player
>
>
> On Wednesday, June 6, 2012 7:26:45 PM UTC-7, dundee wrote:
>>
>> I have been trying to figure out the best way to embed a youtube video in
>> web2py. I would like a form with an entry for the youtube video link/code
>> then at some point it will be displayed.
>> I found this comment using the widget from plugin_wiki, but that did not
>> work for me:
>>
>> https://groups.google.com/**forum/?fromgroups#!topic/**web2py/j8-EG58VbA4
>>
>>
>> Thanks very much.
>>
>>


-- 
Kevin Miller
Acting Data Controller
Department of Computing
UWI, Mona
Kingston 7


[web2py] Re: Embed youtube videos

2012-06-06 Thread pbreit
Should be pretty easy. Once you capture the YouTube URL, just pass it to a 
view and then:

=== view.html ===
http://example.com";
  frameborder="0"/>

=== controller.py ===
def play_video():
video = db.video(request.args(0))
return dict(video=video)

video.url would need to be something like 
"http://www.youtube.com/embed/u1zgFlCw8Aw";. You can store the whole URL or 
just the YouTube code ("u1zgFlCw8Aw").

From:
https://developers.google.com/youtube/player_parameters#Embedding_a_Player


On Wednesday, June 6, 2012 7:26:45 PM UTC-7, dundee wrote:
>
> I have been trying to figure out the best way to embed a youtube video in 
> web2py. I would like a form with an entry for the youtube video link/code 
> then at some point it will be displayed.
> I found this comment using the widget from plugin_wiki, but that did not 
> work for me:
>
> https://groups.google.com/forum/?fromgroups#!topic/web2py/j8-EG58VbA4
>
>
> Thanks very much.
>
>

[web2py] has_permission() broken?

2012-06-06 Thread craley


Traceback (most recent call last):

  File "/srv/web2py/gluon/restricted.py", line 204, in restricted
ccode = compile2(code,layer)
  File "/srv/web2py/applications/dashboard/controllers/admin.py" 
,
 line 258, in 
  File "/srv/web2py/gluon/globals.py", line 172, in 
self._vars = None
  File "/srv/web2py/gluon/tools.py", line 2533, in f
def not_authorized(self):
  File "/srv/web2py/applications/dashboard/controllers/admin.py" 
,
 line 183, in security
raise StandardError,[auth.has_permission(name = 'read',table_name = 
'location',user_id = user['id'],record_id = 
target_location[0]['id']),auth.has_permission(name = 'read',table_name = 
'location',group_id = auth.user_group(user['id']),record_id = 
target_location[0]['id'])]
StandardError: [False, True]



[web2py] Embed youtube videos

2012-06-06 Thread Kevin Miller
I have been trying to figure out the best way to embed a youtube video in
web2py. I would like a form with an entry for the youtube video link/code
then at some point it will be displayed.
I found this comment using the widget from plugin_wiki, but that did not
work for me:

https://groups.google.com/forum/?fromgroups#!topic/web2py/j8-EG58VbA4


Thanks very much.


[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-06 Thread LightDot
I can confirm this, using fresh welcome application and Bootstrap upgraded 
to 2.0.4.

If a menu item has both an URL specified and also additional submenus, 
these don't get displayed. Regardless if this is a first or a second level 
menu item. If the URL is set as None, additional submenus display properly.

Regards

On Wednesday, June 6, 2012 11:13:48 PM UTC+2, Paolo Caruccio wrote:
>
> Szimszon,
>
> is it a new application or have you replaced an old layout with that new 
> one?
>
>
> Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:
>>
>> I have issue with dropdown menu when the main menu is a link too.
>>
>> If I click on the main menu than that menu is activated and I can't 
>> access the items below it with any means :(
>>
>
> Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:
>>
>> I have issue with dropdown menu when the main menu is a link too.
>>
>> If I click on the main menu than that menu is activated and I can't 
>> access the items below it with any means :(
>>
>

Re: [web2py] Hosting services recommendation

2012-06-06 Thread sesenmaister
lot of thanks Anthony, now that fluxflex is going down this link pointed me 
to new valid options

jsesen

El viernes, 6 de enero de 2012 15:54:41 UTC+1, Anthony escribió:
>
> See https://groups.google.com/d/topic/web2py/e2SL5ViOhL4/discussion



[web2py] conflicts with issue 778

2012-06-06 Thread Carlos
Hi Massimo,

Why was the code in the following changeset re-included?:

   (e808fd6f684a) do not show errors about already uploaded files

This was already handled (so far successfully) via the following changeset:

   (af730eb609c0) fixed onvalidation for SQLFORM, issue 778

   http://code.google.com/p/web2py/issues/detail?id=778

Thanks,

   Carlos



Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-06 Thread Bruno Rocha
pythonanywhere has easy deployment for web2py

http://zerp.ly/rochacbruno
Em 06/06/2012 15:10, "sesenmaister"  escreveu:

> Andrew, I have the same question. Today I wanted to get payed hosting on
> FluxFlex. And now I have no idea where to go. I'm not pro, stdudying python
> and web2py for pleasure, I've got no idea how to install web2py in a
> "normal" server and have no idea if all hostings permit that. So FluxFlex
> was my salvation. Now I'm gonna loose so many days for the simple thing of
> deploying. If any advice in getting a way, please I'd be very very glad.
>
> jsesen
>
> El miércoles, 6 de junio de 2012 19:35:44 UTC+2, Andrew escribió:
>>
>> So where do we go now?
>
>


Re: [web2py] niphlod tvseries error

2012-06-06 Thread Niphlod
if you're using binary version there is a good chance that web2py will run 
under 2.5

if you have also 2.7 installed, download the source code version, unzip in 
a folder, then python web2py.py and voilà.

Il giorno mercoledì 6 giugno 2012 22:18:34 UTC+2, blye ha scritto:
>
> Thanks very much for prompt reply. Never quite sure if its a bug ...  or 
> me :-(
> This issue has happened with other apps, not sure if I understand.
> w2p has its own internal Python 2.5.. ???
> I have py 2.5 and 2.7 installed on my machine
>
> How do I resolve the w2p 2.7 issue?
> Should I be running w2p from source code? How do I resolve on a production 
> host server?
>
> OTT All the work of you guys is both inspirational, showing web2py power 
> and educational. What a great ongoing creation.
>
> Thanks.
>
> On Tuesday, 5 June 2012 18:39:41 UTC+2, Niphlod wrote:
>>
>> yeah, forgot to mention in the main page that w2p_tvseries won't work 
>> with python 2.5 (the scheduler part needs the multiprocessing module)
>>
>> BTW, the function this line is in is not used for the moment, but a 
>> one-line fix will avoid the error, so as soon as possible I'll release an 
>> update.
>>
>> @all: if you want to discuss it further, maybe this can be a right place, 
>> but if it's for filing a bug, let's keep this list uncluttered and move to 
>> github's pages ;-)
>>
>> Il giorno martedì 5 giugno 2012 17:16:05 UTC+2, rochacbruno ha scritto:
>>>
>>> whats the Python version?
>>>
>>> this is a python issue you can solve with this (if not running 2.7)
>>>
>>> return UL(*lis, **{"_class": 'nav'})
>>>
>>>
>>>
>>> On Tue, Jun 5, 2012 at 12:05 PM, blye  wrote:
>>>
 return UL(*lis, _class='nav')
>>>
>>>
>>>
>>>
>>> -- 
>>>
>>> Bruno Rocha
>>> [http://rochacbruno.com.br]
>>>
>>>

Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-06 Thread Massimo Di Pierro
We can help if they want to.

On Wednesday, 6 June 2012 12:46:37 UTC-5, encompass wrote:
>
> On 06/06/2012 08:35 PM, Andrew wrote: 
> > So where do we go now? 
> I know the owners of Pagodabox.  They are looking to support python, and 
> I think web2py should be involved. :) 
> BR, 
> Jason 
>


[web2py] Re: web2py: crud interface and query strings

2012-06-06 Thread Massimo Di Pierro
Looks like the error is at

row = rows[0] 

because rows is empty (no records matching query). You need a check like 

if rows:
row = rows[0]



On Wednesday, 6 June 2012 12:19:14 UTC-5, Joel Robinson wrote:
>
> First, let me give some background on what I've been trying to do. We 
> wanted to set up an inventory system using QR codes which would be put on 
> stickers on our stock and then scaned with smartphone when removing 
> inventory bring up the appropiate web page. The QR code should contain 
> something like: 
> 
> http://GeorgesTV/qrinv/update_inventory?partnum=12345
>
> and the following is the code I wrote for update_inventory:
>
> rows = db(db.invent.partnum == request.vars.partnum).select() 
> # change rows object to row object
> row = rows[0]
> 
> # display queried object
> record = crud.update(db.invent, row.id)
> return dict(record=record)
>  
> initialy it would work fine it would run the query and pull up the correct 
> record but 
> if I tried to update the record I would get the folling error:
> 
>
> Traceback (most recent call last):
>   File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in restricted
> exec ccode in environment
>   File "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
> , 
> line 123, in 
>   File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
> self._caller = lambda f: f()
>   File "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
> , 
> line 116, in update_inventory
> row = rows[0]
>   File "/home/joel/Source/web2py/gluon/dal.py", line 7755, in __getitem__
> row = self.records[i]
> IndexError: list index out of range
>
> I thought maybe the request variable wasn't getting passed correctly when 
> updated so I made the following change:
>
> session.partnum = request.vars.partnum
> rows = db(db.invent.partnum == session.partnum).select()
>
> which didn't help either, but I then noticed that if I tried to pull up the 
> update_inventory page now without the query string
> it would come up since session varible was already set and it would update 
> correctly!
>
> I was eventualy able to get it work more or less how I wanted by writing a 
> page whose only function was to take the 
> query string set a session variable and then redirect you to the 
> update_inventory page. But I worry that using session varibles
> may cause unforseen problems eventualy.
>
> So what I would like to know, is this a bug I've found or am I going about 
> doing this incorrectly? Could someone explains
> what happens when you use crud.update and why I get this error when I try to 
> use query strings?
>
> Thanks in advance for your help.
>
> Joel Robinson
>
>

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-06 Thread Paolo Caruccio
Szimszon,

is it a new application or have you replaced an old layout with that new 
one?


Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:
>
> I have issue with dropdown menu when the main menu is a link too.
>
> If I click on the main menu than that menu is activated and I can't access 
> the items below it with any means :(
>

Il giorno mercoledì 6 giugno 2012 13:42:22 UTC+2, szimszon ha scritto:
>
> I have issue with dropdown menu when the main menu is a link too.
>
> If I click on the main menu than that menu is activated and I can't access 
> the items below it with any means :(
>


[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-06 Thread Paolo Caruccio
Andrew,

if it's possible, could you post the raw html source of not working page?

Moreover, try to put in static/js folder the "web2py_ajax.js" from old 
application: sometimes the dropdown doesn't fire if this file is missing, I 
don't know why.


Il giorno mercoledì 6 giugno 2012 12:55:39 UTC+2, Andrew ha scritto:
>
> Funny ?   I've copied welcome's layout.html, and the whole welcome static 
> folder to my old app ( I hadn't modified them in my old app, except for 
> Paolo's files above).  I imagine others do this to get their existing basic 
> apps updated with the UI changes in trunk.  The jQuery selector 
> above '.nav>li>a' doesn't fire so I don't get the extra caret class or 
> data-toggle attribute in the Yellow "web2py" menu item's  tag . 
>  (Confirmed in chrome's Element viewer), and the auth menu item formats 
> don't match welcome's format.
>
> Not a big issue as I know the welcome clone works properly,  but I cannot 
> fathom it, particularly annoying when trying to learn how the whole css / 
> js stuff hangs together.
>
> P.S.  Are your changes above in trunk ?
>
>
> On Wednesday, June 6, 2012 2:07:45 PM UTC+12, Andrew wrote:
>>
>> And here, in layout.html where it gets the class.
>>
>>   jQuery(function(){
>>  jQuery('.nav>li>a').each(function(){
>> if(jQuery(this).parent().find('ul').length)
>>
>> jQuery(this).attr({'class':'dropdown-toggle','data-toggle':'dropdown'}).append('>  
>> class="caret">');
>>
>> I hope I can now figure it out ...
>>
>> On Tuesday, June 5, 2012 10:35:31 PM UTC+12, LightDot wrote:
>>>
>>> Just a heads up to everybody, Bootstrap 2.0.4 has been released a few 
>>> days ago.
>>
>>

Re: [web2py] niphlod tvseries error

2012-06-06 Thread blye
Thanks very much for prompt reply. Never quite sure if its a bug ...  or me 
:-(
This issue has happened with other apps, not sure if I understand.
w2p has its own internal Python 2.5.. ???
I have py 2.5 and 2.7 installed on my machine

How do I resolve the w2p 2.7 issue?
Should I be running w2p from source code? How do I resolve on a production 
host server?

OTT All the work of you guys is both inspirational, showing web2py power 
and educational. What a great ongoing creation.

Thanks.

On Tuesday, 5 June 2012 18:39:41 UTC+2, Niphlod wrote:
>
> yeah, forgot to mention in the main page that w2p_tvseries won't work with 
> python 2.5 (the scheduler part needs the multiprocessing module)
>
> BTW, the function this line is in is not used for the moment, but a 
> one-line fix will avoid the error, so as soon as possible I'll release an 
> update.
>
> @all: if you want to discuss it further, maybe this can be a right place, 
> but if it's for filing a bug, let's keep this list uncluttered and move to 
> github's pages ;-)
>
> Il giorno martedì 5 giugno 2012 17:16:05 UTC+2, rochacbruno ha scritto:
>>
>> whats the Python version?
>>
>> this is a python issue you can solve with this (if not running 2.7)
>>
>> return UL(*lis, **{"_class": 'nav'})
>>
>>
>>
>> On Tue, Jun 5, 2012 at 12:05 PM, blye  wrote:
>>
>>> return UL(*lis, _class='nav')
>>
>>
>>
>>
>> -- 
>>
>> Bruno Rocha
>> [http://rochacbruno.com.br]
>>
>>

[web2py] web2py: crud interface and query strings

2012-06-06 Thread Joel Robinson
First, let me give some background on what I've been trying to do. We 
wanted to set up an inventory system using QR codes which would be put on 
stickers on our stock and then scaned with smartphone when removing 
inventory bring up the appropiate web page. The QR code should contain 
something like: 

http://GeorgesTV/qrinv/update_inventory?partnum=12345

and the following is the code I wrote for update_inventory:

rows = db(db.invent.partnum == request.vars.partnum).select() 
# change rows object to row object
row = rows[0]

# display queried object
record = crud.update(db.invent, row.id)
return dict(record=record)
 
initialy it would work fine it would run the query and pull up the correct 
record but 
if I tried to update the record I would get the folling error:


Traceback (most recent call last):
  File "/home/joel/Source/web2py/gluon/restricted.py", line 205, in restricted
exec ccode in environment
  File "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
, line 
123, in 
  File "/home/joel/Source/web2py/gluon/globals.py", line 173, in 
self._caller = lambda f: f()
  File "/home/joel/Source/web2py/applications/GeorgesTV/controllers/qrinv.py" 
, line 
116, in update_inventory
row = rows[0]
  File "/home/joel/Source/web2py/gluon/dal.py", line 7755, in __getitem__
row = self.records[i]
IndexError: list index out of range

I thought maybe the request variable wasn't getting passed correctly when 
updated so I made the following change:

session.partnum = request.vars.partnum
rows = db(db.invent.partnum == session.partnum).select()

which didn't help either, but I then noticed that if I tried to pull up the 
update_inventory page now without the query string
it would come up since session varible was already set and it would update 
correctly!

I was eventualy able to get it work more or less how I wanted by writing a page 
whose only function was to take the 
query string set a session variable and then redirect you to the 
update_inventory page. But I worry that using session varibles
may cause unforseen problems eventualy.

So what I would like to know, is this a bug I've found or am I going about 
doing this incorrectly? Could someone explains
what happens when you use crud.update and why I get this error when I try to 
use query strings?

Thanks in advance for your help.

Joel Robinson



[web2py] Re: String EOF error

2012-06-06 Thread Derek
He just said there is a hotfix in trunk - that means you'd want to get the 
nightly release to fix it, or wait for an official release. He said it's a 
corrupted ticket, and that's your workaround. So, go to the file system - 
applications - your application - errors- and delete the tickets there.


On Wednesday, June 6, 2012 11:22:23 AM UTC-7, Chris wrote:
>
> I have had a similar issue.  Is there a resolution?
>
>
> On Wednesday, April 25, 2012 5:29:09 PM UTC-4, Bruce Wade wrote:
>>
>> Hi I randomly get a EOFError this doesn't always happen and I have no idea 
>> what is causing it.
>>
>> Traceback (most recent call last):
>>
>>   File "/home/developer/projects/yaw/gluon/restricted.py", line 205, in 
>> restricted
>>
>> exec ccode in environment
>>
>>   File 
>> "/home/developer/projects/yaw/applications/admin/controllers/default.py" 
>> , line 1352, 
>> in 
>>
>>   File "/home/developer/projects/yaw/gluon/globals.py", line 173, in 
>>
>> self._caller = lambda f: f()
>>
>>   File 
>> "/home/developer/projects/yaw/applications/admin/controllers/default.py" 
>> , line 1085, 
>> in errors
>>
>> error = pickle.load(fullpath_file)
>>
>>   File "/usr/lib/python2.7/pickle.py", line 1378, in load
>>
>> return Unpickler(file).load()
>>
>>   File "/usr/lib/python2.7/pickle.py", line 858, in load
>>
>> dispatch[key](self)
>>
>>   File "/usr/lib/python2.7/pickle.py", line 880, in load_eof
>>
>> raise EOFError
>>
>> EOFError
>>
>>
>> -- 
>> -- 
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/brucelwade
>> http://www.wadecybertech.com
>> http://www.fittraineronline.com - Fitness Personal Trainers Online
>> http://www.warplydesigned.com
>>
>>

[web2py] Re: grid's web2py style cleanup

2012-06-06 Thread szimszon
Or better the dictionary should be tied in the layout(.html) somehow. I 
think it would better than polluting the web2py core with time limited 
data... it could be a javascript / javascript variable that should set the 
right class names in layout scope. So people do not need to search and 
replace in all their code if new layout is applied.

2012. június 6., szerda 17:25:40 UTC+2 időpontban LightDot a következőt 
írta:
>
> Quite right, I forgot that the grids are experimental. Sorry, I was too 
> quick to comment in regards to backward compatibility. I missed the scope 
> of the issue anyway, since if I remember right, "ui" setting for the grid 
> is already defined as a dictionary in sqlhtml.py. With definitions such as 
> button='button', etc.
>
> So you are suggesting a new ui dictionary, predefined for the bootstrap? 
> Similar to the jquery-ui dictionary that is already in the sqlhtml.py? I 
> should have realized that sooner... And it's a great idea, of course.
>
> Regards
>
>
> On Wednesday, June 6, 2012 3:57:40 PM UTC+2, szimszon wrote:
>>
>> SQLFORM.grid and .smartgrid is experimental...
>>
>> If grid and smartgrid will use the button and buttontext class for 
>> buttons in grid with new app you have to add this class definition back 
>> manually to the new look&feel layout :(
>>
>> What if grid and smartgrid can access some resource in app layout system 
>> with class names and can adopt to the new underlying css system. 
>>
>> 2012. június 6., szerda 15:30:08 UTC+2 időpontban LightDot a következőt 
>> írta:
>>>
>>> I don't have a personal preference about this since I'm not using these 
>>> selectors in any project. But even if the default css doesn't use them, 
>>> some developer could already be using them for custom css definitions.
>>>
>>> So wouldn't this break backward compatibility of web2py?
>>>
>>> Regards
>>>
>>> On Wednesday, June 6, 2012 2:37:51 PM UTC+2, szimszon wrote:

 Hi!

 I wonder if somebody could help to clean up sqlhtml.py's grid web2py 
 style because there are buttons with 'button' and 'buttontext' class but 
 the css have no visible definition for it. It should be 'btn' or something.

 I opened an issue about it in google code:

 http://code.google.com/p/web2py/issues/detail?id=840

 Thanks.

>>>

Re: [web2py] Re: String EOF error

2012-06-06 Thread Bruce Wade
Nope I still have the same issue it happens constantly not sure where to
look or how to fix it. Also don't have the time this second to dig in more
as I have 1000 tasks on the go for this project.

On Wed, Jun 6, 2012 at 11:22 AM, Chris  wrote:

> I have had a similar issue.  Is there a resolution?
>
>
> On Wednesday, April 25, 2012 5:29:09 PM UTC-4, Bruce Wade wrote:
>>
>> Hi I randomly get a EOFError this doesn't always happen and I have no idea 
>> what is causing it.
>>
>> Traceback (most recent call last):
>>
>>   File "/home/developer/projects/yaw/**gluon/restricted.py", line 205, in 
>> restricted
>>
>> exec ccode in environment
>>
>>   File 
>> "/home/developer/projects/yaw/**applications/admin/**controllers/default.py" 
>> , line 1352, 
>> in 
>>
>>   File "/home/developer/projects/yaw/**gluon/globals.py", line 173, in 
>> 
>>
>> self._caller = lambda f: f()
>>
>>   File 
>> "/home/developer/projects/yaw/**applications/admin/**controllers/default.py" 
>> , line 1085, 
>> in errors
>>
>> error = pickle.load(fullpath_file)
>>
>>   File "/usr/lib/python2.7/pickle.py"**, line 1378, in load
>>
>> return Unpickler(file).load()
>>
>>   File "/usr/lib/python2.7/pickle.py"**, line 858, in load
>>
>> dispatch[key](self)
>>
>>   File "/usr/lib/python2.7/pickle.py"**, line 880, in load_eof
>>
>> raise EOFError
>>
>> EOFError
>>
>>
>> --
>> --
>> Regards,
>> Bruce Wade
>> http://ca.linkedin.com/in/**brucelwade
>> http://www.wadecybertech.com
>> http://www.fittraineronline.**com  -
>> Fitness Personal Trainers Online
>> http://www.warplydesigned.com
>>
>>


-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.fittraineronline.com - Fitness Personal Trainers Online
http://www.warplydesigned.com


[web2py] Re: String EOF error

2012-06-06 Thread Chris
I have had a similar issue.  Is there a resolution?


On Wednesday, April 25, 2012 5:29:09 PM UTC-4, Bruce Wade wrote:
>
> Hi I randomly get a EOFError this doesn't always happen and I have no idea 
> what is causing it.
>
> Traceback (most recent call last):
>
>   File "/home/developer/projects/yaw/gluon/restricted.py", line 205, in 
> restricted
>
> exec ccode in environment
>
>   File 
> "/home/developer/projects/yaw/applications/admin/controllers/default.py" 
> , line 1352, in 
> 
>
>   File "/home/developer/projects/yaw/gluon/globals.py", line 173, in 
>
> self._caller = lambda f: f()
>
>   File 
> "/home/developer/projects/yaw/applications/admin/controllers/default.py" 
> , line 1085, in 
> errors
>
> error = pickle.load(fullpath_file)
>
>   File "/usr/lib/python2.7/pickle.py", line 1378, in load
>
> return Unpickler(file).load()
>
>   File "/usr/lib/python2.7/pickle.py", line 858, in load
>
> dispatch[key](self)
>
>   File "/usr/lib/python2.7/pickle.py", line 880, in load_eof
>
> raise EOFError
>
> EOFError
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.fittraineronline.com - Fitness Personal Trainers Online
> http://www.warplydesigned.com
>
>

Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-06 Thread sesenmaister
Andrew, I have the same question. Today I wanted to get payed hosting on 
FluxFlex. And now I have no idea where to go. I'm not pro, stdudying python 
and web2py for pleasure, I've got no idea how to install web2py in a 
"normal" server and have no idea if all hostings permit that. So FluxFlex 
was my salvation. Now I'm gonna loose so many days for the simple thing of 
deploying. If any advice in getting a way, please I'd be very very glad.

jsesen

El miércoles, 6 de junio de 2012 19:35:44 UTC+2, Andrew escribió:
>
> So where do we go now?



Re: [web2py] We should add mariaDB to the list of functioning databases

2012-06-06 Thread R. Strusberg
+1

In fact MariaDB is a MySQL binary replacement.  Meanwhile, you can use the
MySQL python drivers without problem. Latinux use MariaDB and web2py
together. However, it would be great to support MariaDB characteristics
that are not in MySQL.

Ending July, Latinux will have the first certification MariaDB exam. It is
a joint effort with the Monty team.

 FYI: We are in search of MariaDB (MySQL) experts to incorporate
the certification committee. 

Ricardo Strusberg

2012/6/6 Jason Brower 

> Right now it is a drop in replacement for MySQL so the support is there.
>  Personally though, I think it will support more features so it might be
> good to have it as it's own call for future proofing it.
> I met with Monty the creator of MySQL and MariaDB and I think I want to
> give this MariaDB a chance.
> BR,
> Jason Brower
>
>


Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-06 Thread Jason Brower

On 06/06/2012 08:35 PM, Andrew wrote:

So where do we go now?
I know the owners of Pagodabox.  They are looking to support python, and 
I think web2py should be involved. :)

BR,
Jason


[web2py] We should add mariaDB to the list of functioning databases

2012-06-06 Thread Jason Brower
Right now it is a drop in replacement for MySQL so the support is 
there.  Personally though, I think it will support more features so it 
might be good to have it as it's own call for future proofing it.
I met with Monty the creator of MySQL and MariaDB and I think I want to 
give this MariaDB a chance.

BR,
Jason Brower



Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-06 Thread Andrew
So where do we go now?


[web2py] how to use crud.search for tables with fields that are references to other tables?

2012-06-06 Thread lcamara
Hey,

I've been trying to use crud.search for a table with many fields that 
reference other tables,

After failing I found:
http://code.google.com/p/web2py/issues/detail?id=329 

Which seems to be an old bug report saying this does not work. However, I 
glanced at the crud.search
 source code and at first sight it seems to care about reference fields. 
 Doing things like:

if field.type[0:10] == 'reference ':
refsearch.append(self.get_query(field,
opval, txtval, refsearch=True))

But it never works and I appear to get no results. Can anyone give me an 
example of how to do this?


[web2py] Re: backward-compatible CRYPT() upgrades

2012-06-06 Thread pbreit
Were these suggestions considered or deployed? In light of today's LinkedIn 
compromise, I am again searching for either a salted password or bcrypt 
solution.


On Friday, July 31, 2009 12:40:35 PM UTC-7, Jonathan Lundell wrote:
>
> There are several measures we might take to tighten up default security in 
> a backwards-compatible way.
>
> 1. Use IS_STRONG() by default in the welcome application template. 
>
> 2. Add salted hash methods, in particular a) random salt, and b) using the 
> user's email address as salt (it's not as good as random salt, but it 
> doesn't have to be appended to the hash, since it's already available).
>
> 3. Add a meta hash method for migrating hashes. Let a site that's using 
> currently using some WEAKHASH() (default CRYPT() in particular) to specify 
> a hash type of MIGRATEHASH(WEAKHASH, STRONGHASH). The rule for this method 
> is to always use STRONGHASH, with one exception: on login, if STRONGHASH 
> fails, try WEAKHASH. If WEAKHASH succeeds, then update the user table with 
> STRONGHASH.
>
> 4. Given (2) and (3), then by default CRYPT() could be redefined as 
> MIGRATEHASH(OLDCRYPT, STRONGHASH), for some strong hash.
>
> 5. Add a defense against blind brute-force attacks by rate-limiting login 
> attempts, but some method tbd.
>
> 6. Consider some mechanism that requires a user to choose a new password 
> (aging, perhaps), so that IS_STRONG can be enforced.
>
> 7. Encrypt the user table (or at least critical fields in it) with a 
> secret key, so that if someone gains access to the database, they don't get 
> access to email addresses or password hashes. This raises the question of 
> how to keep the secret key secret, but at the very least it can be kept 
> separate from the database, say in an access-controlled file in the 
> filesystem.
>
> 8. Note that (7) introduces the general problem of secret-key management, 
> which is also an issue for HMACs. Some general solution would be nice.
>
> 9. Finally, none of this helps against a stolen-password attack. For that, 
> we ought to be supporting two-factor authentication. I assume that we can 
> do this already via third-party methods; perhaps we could identify someone 
> supporting something like the Verisign dongle.
>


Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

2012-06-06 Thread Massimo Di Pierro
I agree. too bad. I liked it.

On Wednesday, 6 June 2012 08:18:13 UTC-5, Omi Chiba wrote:
>
> Too bad..
>
> On Wed, Jun 6, 2012 at 8:03 AM, drelyn86  wrote:
>
>> Fluxflex will be shut down and will be no longer available on June 30, 
>>> 2012.
>>> =
>>> From 2010, we have provided Fluxflex for about two years.
>>> But because of profitability, instability and some other issues,
>>> we decided to shut down fluxflex on June 30, 2012.
>>> Because our team is composed of just two members,
>>> we decided to focus more on concise products.
>>> Thanks to all of our users, who kindly support our team and
>>> advice us a lot to improve Fluxflex.
>>> Although we shut down fluxflex.com, we will introduce your our new 
>>> service soon,
>>> which is like pre-configured VPS as localhost on a Cloud and
>>> much more products for developers.
>>> I really appreciate all people who help fluxflex.
>>
>>
>>
>> Source:  http://dl.dropbox.com/u/964705/fluxflex/goodbye_fluxflex.md
>
>
>

Re: [web2py] syntaxis error in dal

2012-06-06 Thread Massimo Di Pierro
Fixed

On Wednesday, 6 June 2012 08:29:09 UTC-5, Johann Spies wrote:
>
> On 6 June 2012 15:26, Jose  wrote:
>
>>
>> File "/usr/home/jose/web2py/gluon/dal.py", line 4130
>> rows = [[(t=='id' and item.key().id_or_name()) or \  
>> 
>>^
>> there is more space at the end of line
>>
>>
> I have reported it in issue 838 few hours ago.
>
> Regards
> Johann 
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>
>

[web2py] Re: LOAD with ajax=True not working please help

2012-06-06 Thread Massimo Di Pierro
fixed in trunk. Thanks Anthony and Michele.

On Wednesday, 6 June 2012 08:18:29 UTC-5, Anthony wrote:
>
> Good point -- the new reload functionality should have used "jQuery()" 
> rather than "$()".
>
> Anthony
>
> On Wednesday, June 6, 2012 8:17:07 AM UTC-4, szimszon wrote:
>>
>> Here is what I found with help of 
>> http://stackoverflow.com/questions/777062/jquery-field-is-null
>>
>> --- web2py.js.old2012-06-04 22:02:56.0 +0200
>> +++ web2py.js2012-06-06 14:12:48.546141468 +0200
>> @@ -104,8 +104,8 @@
>>  
>>  function web2py_component(action, target, timeout, times){
>>jQuery(function(){
>> -var element = $("#" + target).get(0);
>> -var statement = "$('#" + target + "').get(0).reload();";
>> +var element = jQuery("#" + target).get(0);
>> +var statement = "jQuery('#" + target + "').get(0).reload();";
>>  element.reload = function (){
>>  // Continue if times is Infinity or
>>  // the times limit is not reached
>>
>>
>>
>> 2012. június 6., szerda 13:38:12 UTC+2 időpontban szimszon a következőt 
>> írta:
>>>
>>>
>>> Version 2.00.0 (2012-06-05 00:02:52) dev
>>>
>>> in layout.html {{=LOAD('default','setuser',extension='load',ajax=True)}}
>>>
>>> $("#" + target) is null @ http://127.0.0.1:8000/.../static/js/web2py.js:107
>>>
>>> without ajax=True it loads but is is working correctly only with ajax=True 
>>> :(
>>> http://code.google.com/p/web2py/issues/detail?id=839
>>>
>>>
>>>

[web2py] Re: book page is down

2012-06-06 Thread Massimo Di Pierro
I started having problems since last upgared because I left migrations on. 
That causes problems on high traffic. I disabled migrations and should now 
be fine.

On Wednesday, 6 June 2012 06:24:03 UTC-5, Vasile Ermicioi wrote:
>
> http://web2py.com/book
> Internal error Ticket issued 
>


Re: [web2py] Accessing extra sqlform elements from view

2012-06-06 Thread Cornelius Kölbel
Hello Rahul,

I think you should be able to access it as

form.vars.agree

which would either be "on" or None.

Kind regards
Cornelius

Am 06.06.2012 13:45, schrieb rahulserver:
> I added this extra element to my sqlform (as given in web2py book
> chapter forms and validators):
> form = SQLFORM(db.yourtable)
> my_extra_element = TR(LABEL('I agree to the terms and conditions'), \
>   INPUT(_name='agree',value=True,_type='checkbox'))
> form[0].insert(-1,my_extra_element)
> But when i tried to access it in view as
> {{=form.custom.widget.my_extra_element}} (between form.custom.begin
> and form.custom.end) i am getting a none instead of a checkbox.
>
> {{=form}} does give the output as desired. But i wish to make a few
> customizations in the form so i am trying the custom form
> approachfo.So what is the way to access the extra sqlform elements
> from views?



signature.asc
Description: OpenPGP digital signature


Re: [web2py] Web2Py + Mercurial + uWSGI + Nginx in Ubuntu 12.04

2012-06-06 Thread Richard Vézina
I am not sure with the new version of ubuntu, I am still under 10.04, but
Mercurial that comes with the official depot, is most of the time outdated
and there is PPA to get the bleeding edge Mercurial and Tortoise version :

https://launchpad.net/~tortoisehg-ppa
https://launchpad.net/~mercurial-ppa

Richard

On Wed, Jun 6, 2012 at 10:43 AM, orsomannaro  wrote:

> After installing Web2Py with this script:
>
> http://code.google.com/p/**web2py/source/browse/scripts/**
> setup-web2py-nginx-uwsgi-**ubuntu.sh
>
> I made some changes to integrate a Mercurial server.
>
> It seem to work but I'm a newbie, so I would like someone give me feedback.
>
> Thanks.
>
>
> = Mercurial =
> == install ==
>  apt-get install mercurial
>  adduser --ingroup www-data hg
> == users ==
>  cd /home/hg/
>  htpasswd -mc hgusers hg
>  htpasswd -m hgusers pc-user
> == config ==
>  vi /home/hg/hgweb.config
>
>  [paths]
>  / = /var/www/web2py/applications/*
>
> == wsgi script ==
>  mkdir /var/www/hg/
>  cp /usr/share/doc/mercurial-**common/examples/hgweb.wsgi /var/www/hg/
>  chown hg:www-data /var/www/hg/hgweb.wsgi
>  vi /var/www/hg/hgweb.wsgi
>
>  config = "/home/hg/hgweb.config"
>  from mercurial import demandimport; demandimport.enable()
>  from mercurial.hgweb import hgweb
>  application = hgweb(config)
>
>
> =uWSGI =
>  vi /etc/uwsgi/apps-available/**web2py.xml
>
>  
>python
>127.0.0.1:9001
>/var/www/web2py/
>/w2p=/var/www/web2py/**wsgihandler.py
>/hg=/var/www/hg/hgweb.**wsgi
>
>  
>
> (thanks to Roberto for this)
>
> = Nginx =
>  vi /etc/nginx/sites-available/**web2py
>
>  server {
>listen  443;
>server_name $hostname;
>
>ssl on;
>ssl_certificate /etc/nginx/ssl/web2py.crt;
>ssl_certificate_key /etc/nginx/ssl/web2py.key;
>
>location / {
>uwsgi_pass  127.0.0.1:9001;
>include uwsgi_params;
>uwsgi_param UWSGI_SCHEME $scheme;
>uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
>}
>
>location /hg {
>auth_basic "Secure Login";
>auth_basic_user_file /home/hg/hgusers;
>uwsgi_pass  127.0.0.1:9001;
>include uwsgi_params;
>uwsgi_param SCRIPT_NAME "";
>uwsgi_param UWSGI_SCHEME $scheme;
>uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
>}
>  }
>
>
> https:///w2p/ ==> Web2Py (or https:///)
> https:///hg/  ==> Hg
>


[web2py] Re: Why the temporary file is larger than the original one?

2012-06-06 Thread Massimo Di Pierro
The upload is done by the cgi.FieldStorage. It may store some additional 
metedata with it, like the original filename. Not sure.

On Wednesday, 6 June 2012 05:15:01 UTC-5, Charles Tang wrote:
>
> I am uploading a video from using web2py SQLFORM and want to process it 
> while it is uploading. I find that even the video is completely uploaded 
> the temporary file of the video in the /tmp directory is larger than the 
> original video.Why?Does the python tempfile module add some bytes to 
> it?Many thanks!
>


[web2py] Re: how to get correct values in info tag on gmap

2012-06-06 Thread greaneym
Anthony,

Thank you very much, that works.

Margaret

On Wednesday, June 6, 2012 11:13:58 AM UTC-5, Anthony wrote:
>
> plugin_gmap.represent=lambda row: '%(state_name)s %(capital_latitude)s 
> %(capital_longitude)s '
>
> should be:
>
> plugin_gmap.represent=lambda row: '%(state_name)s %(capital_latitude)s 
> %(capital_longitude)s' % row
>
> Anthony
>
> On Wednesday, June 6, 2012 11:57:12 AM UTC-4, greaneym wrote:
>>
>> Hi,
>>
>> I am having some difficulty in plottings some points on a gmap with 
>> informational attributes and I hope someone can help me understand what 
>> mistakes I am making.  I am aware that these cities are already marked on 
>> the map, but I want to 
>> add these markers for a quiz app I'm making.
>>
>> The points plot correctly, but when I click on the marker, instead of 
>> getting information of "state_name, latitude, longitude" values, I get
>> the string, %(statename)s %(capital_latitude)s %(capital_longitude)s  
>>
>> I don't understand how to modify the files to display the right values.
>>
>>
>> I created a copy of the welcome application and then installed the 
>> gmap_plugin
>> that Massimo Di Pierro provided via the wp2 file in an application called 
>> "testmap".
>>
>> I can see the map successfully shown if I click on "index" under the 
>> gmap_plugin controller in the ide.
>>
>> When I add the line
>>
>> {{=LOAD('plugin_gmap')}}
>> into the view/default/index.html file, the map shows up there as well.
>>
>> I made a csv file containing the 50 USs states, their capital city name, 
>> and the lat, long of the capitals, and loaded that into a db file named 
>> db5.py.
>> db.define_table('capitals',
>>  Field('state_name','string', requires=IS_NOT_EMPTY()),
>>  Field('capital_name','string',requires=IS_NOT_EMPTY()),
>> 
>>  Field('capital_latitude','double',requires=IS_FLOAT_IN_RANGE(0,10**7)),
>> 
>>  Field('capital_longitude','double',requires=IS_FLOAT_IN_RANGE(0,10**7)),
>> )
>>
>> In the ide, the fields show up ok:
>> In [7] : print db.capitals.fields
>> ['id', 'state_name', 'capital_name', 'capital_latitude', 
>> 'capital_longitude']
>>
>> After the csv import, I can see the data: (snip)
>>
>> 50 selected
>> capitals.id capitals.state_name capitals.capital_name 
>> capitals.capital_latitude capitals.capital_longitude
>> 1 Alabama Montgomery 32.361538 -86.279118
>> 2 Alaska Juneau 58.301935 -134.41974
>> 3 Arizona Phoenix 33.448457 -112.073844
>> 4 Arkansas Little Rock 34.736009 -92.331122
>>
>> etc.
>>
>> At this point, I should be able to do a select in the gmap_plugin.py in 
>> the
>> models directory, and then be able to plot the points as markers on the 
>> map by 
>> editing the views/default/index.html file or the index file in the 
>> gmap_plugin directory. This part worked ok. 
>>
>> Here's what I've tried but the info in the marker is not working.  Could 
>> someone please give
>> me suggestions why it is wrong? Thanks.
>>
>> First I check that a selection into lat,long points works.
>>
>> points = 
>> db(capitals.capital_latitude,capitals.capital_longitude,orderby=capitals.state_name)
>>  
>>
>> .
>> points = 
>> db(db.capitals.capital_latitude,db.capital.capital_longitude).select()
>> print points
>>
>> snip --
>> 'Wisconsin', 'capital_name': ' Madison', 'id': 49}, {'capital_longitude': 
>> -104.802042, 'capital_latitude': 41.1455478, 'state_name': 
>> 'Wyoming', 'capital_name': ' Cheyenne', 'id': 50}]
>> :w!
>>
>> rows =db().select(db.capitals.ALL, orderby=capitals.state_name)
>> print rows
>>
>> gives all information
>>  {'capital_longitude': -104.802042, 'capital_latitude': 
>> 41.1455478, 'state_name': 'Wyoming', 'capital_name': ' Cheyenne', 
>> 'id': 50}]
>>
>>
>> Here is the modified plugin_gmap.py model file:
>>
>> from gluon.storage import Storage
>> plugin_gmap=Storage()
>>
>> plugin_gmap.key='ABQInfs7bKE82qgb3Zc2YyS-oBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSySz_REpPq-4WZA27OwgbtyR3VcA'
>>  
>> # key for localhost  
>> plugin_gmap.set=db(db.capitals.id>0).select() ### change this to a query 
>> that lists records with latitude and longitute
>> points=db(db.capitals.id>0).select() ### change this to a query that 
>> lists records with latitude and longitute
>> plugin_gmap.represent=lambda row: '%(state_name)s %(capital_latitude)s 
>> %(capital_longitude)s '
>> # include plugin in views with {{=LOAD('plugin_gmap')}}
>>
>>
>> Here is the modified plugin_gmap.py controller file:
>> def index():
>> width = request.vars.width or 400
>> height = request.vars.height or 300
>> #rows = plugin_gmap.set.select()
>> rows =  db(db.capitals.id>0).select()
>> for row in rows:
>> row.plugin_gmap_popup = plugin_gmap.represent(row)
>> return 
>> dict(width=width,height=height,rows=rows,GOOGLEMAP_KEY=plugin_gmap.key)
>> ~ 
>>
>>
>> Here is the modified plugin_gmap view file:
>>
>> http://maps.google.com/maps?file=api&v=2&key={{=GOOGLEMAP_KEY}}<[web2py] Re: how to get correct values in info tag on gmap

plugin_gmap.represent=lambda row: '%(state_name)s %(capital_latitude)s 
%(capital_longitude)s '

should be:

plugin_gmap.represent=lambda row: '%(state_name)s %(capital_latitude)s 
%(capital_longitude)s' % row

Anthony

On Wednesday, June 6, 2012 11:57:12 AM UTC-4, greaneym wrote:
>
> Hi,
>
> I am having some difficulty in plottings some points on a gmap with 
> informational attributes and I hope someone can help me understand what 
> mistakes I am making.  I am aware that these cities are already marked on 
> the map, but I want to 
> add these markers for a quiz app I'm making.
>
> The points plot correctly, but when I click on the marker, instead of 
> getting information of "state_name, latitude, longitude" values, I get
> the string, %(statename)s %(capital_latitude)s %(capital_longitude)s  
>
> I don't understand how to modify the files to display the right values.
>
>
> I created a copy of the welcome application and then installed the 
> gmap_plugin
> that Massimo Di Pierro provided via the wp2 file in an application called 
> "testmap".
>
> I can see the map successfully shown if I click on "index" under the 
> gmap_plugin controller in the ide.
>
> When I add the line
>
> {{=LOAD('plugin_gmap')}}
> into the view/default/index.html file, the map shows up there as well.
>
> I made a csv file containing the 50 USs states, their capital city name, 
> and the lat, long of the capitals, and loaded that into a db file named 
> db5.py.
> db.define_table('capitals',
>  Field('state_name','string', requires=IS_NOT_EMPTY()),
>  Field('capital_name','string',requires=IS_NOT_EMPTY()),
> 
>  Field('capital_latitude','double',requires=IS_FLOAT_IN_RANGE(0,10**7)),
> 
>  Field('capital_longitude','double',requires=IS_FLOAT_IN_RANGE(0,10**7)),
> )
>
> In the ide, the fields show up ok:
> In [7] : print db.capitals.fields
> ['id', 'state_name', 'capital_name', 'capital_latitude', 
> 'capital_longitude']
>
> After the csv import, I can see the data: (snip)
>
> 50 selected
> capitals.id capitals.state_name capitals.capital_name 
> capitals.capital_latitude capitals.capital_longitude
> 1 Alabama Montgomery 32.361538 -86.279118
> 2 Alaska Juneau 58.301935 -134.41974
> 3 Arizona Phoenix 33.448457 -112.073844
> 4 Arkansas Little Rock 34.736009 -92.331122
>
> etc.
>
> At this point, I should be able to do a select in the gmap_plugin.py in the
> models directory, and then be able to plot the points as markers on the 
> map by 
> editing the views/default/index.html file or the index file in the 
> gmap_plugin directory. This part worked ok. 
>
> Here's what I've tried but the info in the marker is not working.  Could 
> someone please give
> me suggestions why it is wrong? Thanks.
>
> First I check that a selection into lat,long points works.
>
> points = 
> db(capitals.capital_latitude,capitals.capital_longitude,orderby=capitals.state_name)
>  
>
> .
> points = 
> db(db.capitals.capital_latitude,db.capital.capital_longitude).select()
> print points
>
> snip --
> 'Wisconsin', 'capital_name': ' Madison', 'id': 49}, {'capital_longitude': 
> -104.802042, 'capital_latitude': 41.1455478, 'state_name': 
> 'Wyoming', 'capital_name': ' Cheyenne', 'id': 50}]
> :w!
>
> rows =db().select(db.capitals.ALL, orderby=capitals.state_name)
> print rows
>
> gives all information
>  {'capital_longitude': -104.802042, 'capital_latitude': 
> 41.1455478, 'state_name': 'Wyoming', 'capital_name': ' Cheyenne', 
> 'id': 50}]
>
>
> Here is the modified plugin_gmap.py model file:
>
> from gluon.storage import Storage
> plugin_gmap=Storage()
>
> plugin_gmap.key='ABQInfs7bKE82qgb3Zc2YyS-oBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSySz_REpPq-4WZA27OwgbtyR3VcA'
>  
> # key for localhost  
> plugin_gmap.set=db(db.capitals.id>0).select() ### change this to a query 
> that lists records with latitude and longitute
> points=db(db.capitals.id>0).select() ### change this to a query that 
> lists records with latitude and longitute
> plugin_gmap.represent=lambda row: '%(state_name)s %(capital_latitude)s 
> %(capital_longitude)s '
> # include plugin in views with {{=LOAD('plugin_gmap')}}
>
>
> Here is the modified plugin_gmap.py controller file:
> def index():
> width = request.vars.width or 400
> height = request.vars.height or 300
> #rows = plugin_gmap.set.select()
> rows =  db(db.capitals.id>0).select()
> for row in rows:
> row.plugin_gmap_popup = plugin_gmap.represent(row)
> return 
> dict(width=width,height=height,rows=rows,GOOGLEMAP_KEY=plugin_gmap.key)
> ~ 
>
>
> Here is the modified plugin_gmap view file:
>
> http://maps.google.com/maps?file=api&v=2&key={{=GOOGLEMAP_KEY}}<http://maps.google.com/maps?file=api&v=2&key=%7B%7B=GOOGLEMAP_KEY%7D%7D>"
>  
> type="text/javascript">
> 
>   // function load() {
>   if (GBrowserIsCompatible()) {
> var map = new GMap2(do

Re: [web2py] Re: Instant press 2.1.0 holiday edition (?)

after the peek into custom_import, it was my mistake of missing __init__.py 
in /applications. actually i just notice we can use standard import instead 
of local_import now.

On Wednesday, June 6, 2012 2:49:29 AM UTC+8, vince wrote:
>
> i am using 1.99.7 with the similar errors, appsettings.py does exist in 
> modules so is it web2py or instantpress's problem?
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
>
> Traceback (most recent call last):
>   File "/home/web2py/gluon/restricted.py", line 205, in restricted
> exec ccode in environment
>   File "/home/web2py/applications/instantpress/models/00main.py" 
> , line 
> 18, in 
> from appsettings import app_settings
>   File "/home/web2py/gluon/custom_import.py", line 293, in __call__
> fromlist, level)
>   File "/home/web2py/gluon/custom_import.py", line 78, in __call__
> level)
> ImportError: No module named appsettings
>
>
>
>
>
>

[web2py] Re: Setting initial password when registering?

Ok, so, for the record, I'm an idiot. :-)
My app was generated with the admin wizard.
Apparently when I was just starting to get my web2py feet wet, I went
in and tinkered very early on and marked the password field as
writable=False ...
removing that allows for a password and repeat/verify password field to show up.
Sorry for the hassle.
   --Doug

P.S. I've created an issue in the tracker requesting that perhaps the
wizard use the extra_fields mechanism instead of creating the
auth_user table from whole cloth. Would just make it easier to prevent
this kind of self-foot-shooting, but more importantly it means not
having to keep the code in synch between the gluon code and the admin
application. Not a big deal though.


On Wed, Jun 6, 2012 at 11:28 AM, Doug Philips  wrote:
> Hello all, again,
>
> (I'm guessing the answer to this is in 'the book' , but that's down
> right now and when I went looking last night I couldn't seem to figure
> out where.)
>
> For the app I'm deploying which does require users to authenticate
> (login), I want to use the verification facility.
> I have the following settings in db.py. (I just double checked and I
> don't have any other code which seems to override or reset these
> values)
>
> auth.settings.registration_requires_verification = True
> auth.settings.registration_requires_approval = False
> auth.settings.reset_password_requires_verification = True
>
>
> Everything works great, the email configuration is fine, that all works.
> But there is nowhere on the registration form to set an initial password.
> Beta testers are complaining that after following the link in the
> email to verify their registration, they than have to go through the
> hassle of the "Lost Password" process.
>
> I'm a bit chagrined as I was so busy getting the rest of the app ready
> that I didn't even notice this.
> Do I have my app misconfigured? I'd really like to be able to have
> folks pick a password when they register, which is what the beta
> testers want, and (to my inexperienced web2py eyes) that seems a
> reasonable request.
>
> Thanks,
>    --Doug


[web2py] how to get correct values in info tag on gmap

Hi,

I am having some difficulty in plottings some points on a gmap with 
informational attributes and I hope someone can help me understand what 
mistakes I am making.  I am aware that these cities are already marked on 
the map, but I want to 
add these markers for a quiz app I'm making.

The points plot correctly, but when I click on the marker, instead of 
getting information of "state_name, latitude, longitude" values, I get
the string, %(statename)s %(capital_latitude)s %(capital_longitude)s  

I don't understand how to modify the files to display the right values.


I created a copy of the welcome application and then installed the 
gmap_plugin
that Massimo Di Pierro provided via the wp2 file in an application called 
"testmap".

I can see the map successfully shown if I click on "index" under the 
gmap_plugin controller in the ide.

When I add the line

{{=LOAD('plugin_gmap')}}
into the view/default/index.html file, the map shows up there as well.

I made a csv file containing the 50 USs states, their capital city name, 
and the lat, long of the capitals, and loaded that into a db file named 
db5.py.
db.define_table('capitals',
 Field('state_name','string', requires=IS_NOT_EMPTY()),
 Field('capital_name','string',requires=IS_NOT_EMPTY()),
 Field('capital_latitude','double',requires=IS_FLOAT_IN_RANGE(0,10**7)),

 Field('capital_longitude','double',requires=IS_FLOAT_IN_RANGE(0,10**7)),
)

In the ide, the fields show up ok:
In [7] : print db.capitals.fields
['id', 'state_name', 'capital_name', 'capital_latitude', 
'capital_longitude']

After the csv import, I can see the data: (snip)

50 selected
capitals.id capitals.state_name capitals.capital_name 
capitals.capital_latitude capitals.capital_longitude
1 Alabama Montgomery 32.361538 -86.279118
2 Alaska Juneau 58.301935 -134.41974
3 Arizona Phoenix 33.448457 -112.073844
4 Arkansas Little Rock 34.736009 -92.331122

etc.

At this point, I should be able to do a select in the gmap_plugin.py in the
models directory, and then be able to plot the points as markers on the map 
by 
editing the views/default/index.html file or the index file in the 
gmap_plugin directory. This part worked ok. 

Here's what I've tried but the info in the marker is not working.  Could 
someone please give
me suggestions why it is wrong? Thanks.

First I check that a selection into lat,long points works.

points = 
db(capitals.capital_latitude,capitals.capital_longitude,orderby=capitals.state_name)
 

.
points = 
db(db.capitals.capital_latitude,db.capital.capital_longitude).select()
print points

snip --
'Wisconsin', 'capital_name': ' Madison', 'id': 49}, {'capital_longitude': 
-104.802042, 'capital_latitude': 41.1455478, 'state_name': 
'Wyoming', 'capital_name': ' Cheyenne', 'id': 50}]
:w!

rows =db().select(db.capitals.ALL, orderby=capitals.state_name)
print rows

gives all information
 {'capital_longitude': -104.802042, 'capital_latitude': 41.1455478, 
'state_name': 'Wyoming', 'capital_name': ' Cheyenne', 'id': 50}]


Here is the modified plugin_gmap.py model file:

from gluon.storage import Storage
plugin_gmap=Storage()

plugin_gmap.key='ABQInfs7bKE82qgb3Zc2YyS-oBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSySz_REpPq-4WZA27OwgbtyR3VcA'
 
# key for localhost  
plugin_gmap.set=db(db.capitals.id>0).select() ### change this to a query 
that lists records with latitude and longitute
points=db(db.capitals.id>0).select() ### change this to a query that lists 
records with latitude and longitute
plugin_gmap.represent=lambda row: '%(state_name)s %(capital_latitude)s 
%(capital_longitude)s '
# include plugin in views with {{=LOAD('plugin_gmap')}}


Here is the modified plugin_gmap.py controller file:
def index():
width = request.vars.width or 400
height = request.vars.height or 300
#rows = plugin_gmap.set.select()
rows =  db(db.capitals.id>0).select()
for row in rows:
row.plugin_gmap_popup = plugin_gmap.represent(row)
return 
dict(width=width,height=height,rows=rows,GOOGLEMAP_KEY=plugin_gmap.key)
~ 


Here is the modified plugin_gmap view file:

http://maps.google.com/maps?file=api&v=2&key={{=GOOGLEMAP_KEY}}"; 
type="text/javascript">

  //http://www.google.com/mapfiles/shadow50.png";;
baseIcon.iconSize = new GSize(20, 34);
baseIcon.shadowSize = new GSize(37, 34);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);
baseIcon.infoShadowAnc

[web2py] Re: Typo bug in DAL

oops. Fixing in trunk.

On Wednesday, 6 June 2012 00:37:15 UTC-5, pbreit wrote:
>
> Traceback (most recent call last):
>   File "web2py.py", line 16, in 
> import gluon.widget
>   File "/Users/pbreit/web2py/gluon/__init__.py", line 19, in 
> from dal import DAL, Field
>   File "/Users/pbreit/web2py/gluon/dal.py", line 4130
> rows = [[(t=='id' and item.key().id_or_name()) or \  
> ^
> SyntaxError: unexpected character after line continuation character
>
> Line 4130:
> http://code.google.com/p/web2py/source/browse/gluon/dal.py#4130
>
> From this commit (although I don't see the extra spaces there):
>
> http://code.google.com/p/web2py/source/detail?r=7c84ba6cbadc859f26862fc0d427e0b42766e179
>


[web2py] Re: how to groupby date on a datetime field?

Can you try

s=(db.mytable.notified.year() | db.mytable.notified.month() | 
db.mytable.notified.day())
rows = db(...).select(s, db.mytable.id.count(),groupby=s,orderby=s)


On Wednesday, 6 June 2012 00:14:38 UTC-5, weheh wrote:
>
> I have db.define_table('mytable', ..., Field('notified', 'datetime') ...)
>
> I want to count the number of notifications that have been sent out on any 
> given day using a 1 day resolution, but I can't make "notified" a date 
> because I need 1 second resolution as to when the notification was sent for 
> a different measurement.
>
> Is there an easy way to do a groupby such that the notified date is 
> grouped by day and not by second? I've tried this:
>
> db(...).select(db.mytable.notified, db.mytable.notified.count(),
> groupby=(db.mytable.notified.year() | db.mytable.notified.month() | 
> db.mytable.notified.day()),
> orderby=(db.mytable.notified.year() | db.mytable.notified.month() | 
> db.mytable.notified.day()),
> )
> but this will cause a ticket saying that I also need to put in "| 
> db.mytable.notified", which will screw up the 1 day resolution. Any 
> thoughts as to how to do this elegantly, without making a duplicate field, 
> but type "date" instead of "datetime"?
>


[web2py] Setting initial password when registering?

Hello all, again,

(I'm guessing the answer to this is in 'the book' , but that's down
right now and when I went looking last night I couldn't seem to figure
out where.)

For the app I'm deploying which does require users to authenticate
(login), I want to use the verification facility.
I have the following settings in db.py. (I just double checked and I
don't have any other code which seems to override or reset these
values)

auth.settings.registration_requires_verification = True
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True


Everything works great, the email configuration is fine, that all works.
But there is nowhere on the registration form to set an initial password.
Beta testers are complaining that after following the link in the
email to verify their registration, they than have to go through the
hassle of the "Lost Password" process.

I'm a bit chagrined as I was so busy getting the rest of the app ready
that I didn't even notice this.
Do I have my app misconfigured? I'd really like to be able to have
folks pick a password when they register, which is what the beta
testers want, and (to my inexperienced web2py eyes) that seems a
reasonable request.

Thanks,
--Doug


[web2py] Re: grid's web2py style cleanup

Quite right, I forgot that the grids are experimental. Sorry, I was too 
quick to comment in regards to backward compatibility. I missed the scope 
of the issue anyway, since if I remember right, "ui" setting for the grid 
is already defined as a dictionary in sqlhtml.py. With definitions such as 
button='button', etc.

So you are suggesting a new ui dictionary, predefined for the bootstrap? 
Similar to the jquery-ui dictionary that is already in the sqlhtml.py? I 
should have realized that sooner... And it's a great idea, of course.

Regards


On Wednesday, June 6, 2012 3:57:40 PM UTC+2, szimszon wrote:
>
> SQLFORM.grid and .smartgrid is experimental...
>
> If grid and smartgrid will use the button and buttontext class for buttons 
> in grid with new app you have to add this class definition back manually to 
> the new look&feel layout :(
>
> What if grid and smartgrid can access some resource in app layout system 
> with class names and can adopt to the new underlying css system. 
>
> 2012. június 6., szerda 15:30:08 UTC+2 időpontban LightDot a következőt 
> írta:
>>
>> I don't have a personal preference about this since I'm not using these 
>> selectors in any project. But even if the default css doesn't use them, 
>> some developer could already be using them for custom css definitions.
>>
>> So wouldn't this break backward compatibility of web2py?
>>
>> Regards
>>
>> On Wednesday, June 6, 2012 2:37:51 PM UTC+2, szimszon wrote:
>>>
>>> Hi!
>>>
>>> I wonder if somebody could help to clean up sqlhtml.py's grid web2py 
>>> style because there are buttons with 'button' and 'buttontext' class but 
>>> the css have no visible definition for it. It should be 'btn' or something.
>>>
>>> I opened an issue about it in google code:
>>>
>>> http://code.google.com/p/web2py/issues/detail?id=840
>>>
>>> Thanks.
>>>
>>

Re: [web2py] Re: Question about layout.html

Ok, I've entered an issue for it:
http://code.google.com/p/web2py/issues/detail?id=841
Thanks!
   ---Doug


On Wed, Jun 6, 2012 at 9:49 AM, Anthony  wrote:
> Good catch -- we should make that change. In your case, you can just remove
> that line.


Re: [web2py] How to limit upload speed in web2py?

via your webserver config...

On Wed, Jun 6, 2012 at 8:14 AM, Charles Tang  wrote:

> I am using SQLForm to submit a large file and want to limit the upload
> speed. How to do it ? Thanks.
>



-- 
Sebastian E. Ovide


Re: [web2py] Error connecting with mysql database

would try to replace *Like* with something else ? it is a MySql (SQL)
keyword...

On Wed, Jun 6, 2012 at 1:08 PM, Hassan Alnatour
wrote:

> Field('Like','integer',default=1),
>



-- 
Sebastian E. Ovide


Re: [web2py] Re: Innovation under Austerity

we are just Sheeple!

2012/6/6 Cliff Kachinske 

> Re: Facebook and other 'Free' social networking sites, this old quote
> applies:
>
> "If you aren't paying for it, you are not the customer.  You are the
> product."
>
>
>
> On Tuesday, June 5, 2012 7:02:25 PM UTC-4, mcm wrote:
>>
>> F2C2012: Eben Moglen keynote - "Innovation under Austerity"
>>
>> http://youtu.be/G2VHf5vpBy8
>>
>> A great speech about freedom and the impact of free software on it.
>> Watch and share.
>>
>> mic
>>
>


Re: [web2py] Moving Data From Sqlite To MySql

check this http://goo.gl/VpwpB for moving the data... and the official book
has a chapter that explains how to use an existing DB.

Do you want also to keep the migration info ?

On Wed, Jun 6, 2012 at 9:18 AM, Hassan Alnatour
wrote:

> Dear ALL,
>
> How can i move my database from sqlite to mysql ?
>
> regards,
>



-- 
Sebastian E. Ovide


[web2py] Re: Innovation under Austerity

Re: Facebook and other 'Free' social networking sites, this old quote 
applies:

"If you aren't paying for it, you are not the customer.  You are the 
product."



On Tuesday, June 5, 2012 7:02:25 PM UTC-4, mcm wrote:
>
> F2C2012: Eben Moglen keynote - "Innovation under Austerity" 
>
> http://youtu.be/G2VHf5vpBy8 
>
> A great speech about freedom and the impact of free software on it. 
> Watch and share. 
>
> mic 
>


[web2py] Web2Py + Mercurial + uWSGI + Nginx in Ubuntu 12.04


After installing Web2Py with this script:

http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh

I made some changes to integrate a Mercurial server.

It seem to work but I'm a newbie, so I would like someone give me feedback.

Thanks.


= Mercurial =
== install ==
  apt-get install mercurial
  adduser --ingroup www-data hg
== users ==
  cd /home/hg/
  htpasswd -mc hgusers hg
  htpasswd -m hgusers pc-user
== config ==
  vi /home/hg/hgweb.config

  [paths]
  / = /var/www/web2py/applications/*

== wsgi script ==
  mkdir /var/www/hg/
  cp /usr/share/doc/mercurial-common/examples/hgweb.wsgi /var/www/hg/
  chown hg:www-data /var/www/hg/hgweb.wsgi
  vi /var/www/hg/hgweb.wsgi

  config = "/home/hg/hgweb.config"
  from mercurial import demandimport; demandimport.enable()
  from mercurial.hgweb import hgweb
  application = hgweb(config)


=uWSGI =
  vi /etc/uwsgi/apps-available/web2py.xml

  
python
127.0.0.1:9001
/var/www/web2py/
/w2p=/var/www/web2py/wsgihandler.py
/hg=/var/www/hg/hgweb.wsgi

  

(thanks to Roberto for this)

= Nginx =
  vi /etc/nginx/sites-available/web2py

  server {
listen  443;
server_name $hostname;

ssl on;
ssl_certificate /etc/nginx/ssl/web2py.crt;
ssl_certificate_key /etc/nginx/ssl/web2py.key;

location / {
uwsgi_pass  127.0.0.1:9001;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
}

location /hg {
auth_basic "Secure Login";
auth_basic_user_file /home/hg/hgusers;
uwsgi_pass  127.0.0.1:9001;
include uwsgi_params;
uwsgi_param SCRIPT_NAME "";
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
}
  }


https:///w2p/ ==> Web2Py (or https:///)
https:///hg/  ==> Hg


[web2py] Re: grid's web2py style cleanup

SQLFORM.grid and .smartgrid is experimental...

If grid and smartgrid will use the button and buttontext class for buttons 
in grid with new app you have to add this class definition back manually to 
the new look&feel layout :(

What if grid and smartgrid can access some resource in app layout system 
with class names and can adopt to the new underlying css system. 

2012. június 6., szerda 15:30:08 UTC+2 időpontban LightDot a következőt 
írta:
>
> I don't have a personal preference about this since I'm not using these 
> selectors in any project. But even if the default css doesn't use them, 
> some developer could already be using them for custom css definitions.
>
> So wouldn't this break backward compatibility of web2py?
>
> Regards
>
> On Wednesday, June 6, 2012 2:37:51 PM UTC+2, szimszon wrote:
>>
>> Hi!
>>
>> I wonder if somebody could help to clean up sqlhtml.py's grid web2py 
>> style because there are buttons with 'button' and 'buttontext' class but 
>> the css have no visible definition for it. It should be 'btn' or something.
>>
>> I opened an issue about it in google code:
>>
>> http://code.google.com/p/web2py/issues/detail?id=840
>>
>> Thanks.
>>
>

[web2py] Re: Fluxflex will be shut down and no longer available on June 30, 2012

Oh no! I had a great experience using Fluxglex. All the best in future.

On Wednesday, June 6, 2012 3:03:48 PM UTC+2, drelyn86 wrote:
>
> Fluxflex will be shut down and will be no longer available on June 30, 
>> 2012.
>> =
>> From 2010, we have provided Fluxflex for about two years.
>> But because of profitability, instability and some other issues,
>> we decided to shut down fluxflex on June 30, 2012.
>> Because our team is composed of just two members,
>> we decided to focus more on concise products.
>> Thanks to all of our users, who kindly support our team and
>> advice us a lot to improve Fluxflex.
>> Although we shut down fluxflex.com, we will introduce your our new 
>> service soon,
>> which is like pre-configured VPS as localhost on a Cloud and
>> much more products for developers.
>> I really appreciate all people who help fluxflex.
>
>
>
> Source:  http://dl.dropbox.com/u/964705/fluxflex/goodbye_fluxflex.md



Re: [web2py] App does not exist or your are not authorized when deploying layout plugin

Maybe it the permissions on your files...

sudo chown -R www-data.www-data web2py/applications/APP/

Richard

On Sat, Jun 2, 2012 at 5:56 PM, François Delpierre <
francois.delpie...@gmail.com> wrote:

> I just created a simple plugin as described here (Only the
> view/layout.html and a CSS) :
> http://comments.gmane.org/gmane.comp.python.web2py/71183
>
> Here is the content of the w2p plugin file :
> pivert@skinner:~/Downloads$ tar -ztvf web2py.plugin.layout_name.w2p
> -rw-rw francoisd/www-data 6279 2012-05-26 13:27 views/
> plugin_layout_name/layout.html
> drwxrwx--- francoisd/www-data0 2012-05-28 23:44 static/
> plugin_layout_name/css/
> -rw-rw francoisd/www-data 5237 2012-05-28 23:43 static/
> plugin_layout_name/css/name.css
> drwxrwx--- francoisd/www-data0 2012-05-28 23:48 static/
> plugin_layout_name/images/
> -rw-rw francoisd/www-data 2796 2012-05-22 23:46 static/
> plugin_layout_name/images/logo-name.gif
> -rw-rw francoisd/www-data  754 2012-05-22 23:46 static/
> plugin_layout_name/images/header.gif
>
>
>
> And if I deploy from the web admin interface, I have the "App does not
> exist or your are not authorized" error.
>


[web2py] Re: Question about layout.html

Good catch -- we should make that change. In your case, you can just remove 
that line.

Anthony

On Wednesday, June 6, 2012 9:45:09 AM UTC-4, Doug Philips wrote:
>
> I'm getting ready to deploy my first web2py application. 
> First off: THANK YOU! 
> I couldn't have pulled this off (I'm a systems programmer, not a web 
> programmer). 
>
> While I have only one application to deploy, I am hoping there are others. 
> As such, I want to use welcome as the 'landing page' which will show 
> what the other available applications are. 
>
> So, I thought, why not just tweak up the welcome app, it has a nice, 
> friendly, 'welcoming' name even. :-) 
>
> This app doesn't need authentication, so I've gone into the models, 
> etc. and removed all the references to Auth and auth and such. 
>
> When I did that, I started to get this weird 'False' showing up in the 
> upper right of the page. 
>
> I eventually tracked it down to applications/welcome/views/layout.html: 
> line 79 (or thereabouts): 
>  {{='auth' in globals() and 
> auth.navbar(separators=(' ',' | ',''))}} 
>
> So should I just remove that line? 
> It looks like it is written to be 'self-adusting'. 
> I "fixed" my mutant welcome app by changing it to: 
> {{=('auth' in globals() and 
> auth.navbar(separators=(' ',' | ',''))) or ''}} 
>
> Hopefully this question makes sense? 
> I guess I'd either like to see that change adopted or a comment added 
> to layout.html indicating that it is OK to remove that line (really, I 
> have no idea if that would break anything which is why I didn't remove 
> it already, I'm under the gun to get the app out). 
>
> Thanks, 
>  --Doug 
>


[web2py] Question about layout.html

I'm getting ready to deploy my first web2py application.
First off: THANK YOU!
I couldn't have pulled this off (I'm a systems programmer, not a web
programmer).

While I have only one application to deploy, I am hoping there are others.
As such, I want to use welcome as the 'landing page' which will show
what the other available applications are.

So, I thought, why not just tweak up the welcome app, it has a nice,
friendly, 'welcoming' name even. :-)

This app doesn't need authentication, so I've gone into the models,
etc. and removed all the references to Auth and auth and such.

When I did that, I started to get this weird 'False' showing up in the
upper right of the page.

I eventually tracked it down to applications/welcome/views/layout.html:
line 79 (or thereabouts):
 {{='auth' in globals() and
auth.navbar(separators=(' ',' | ',''))}}

So should I just remove that line?
It looks like it is written to be 'self-adusting'.
I "fixed" my mutant welcome app by changing it to:
{{=('auth' in globals() and
auth.navbar(separators=(' ',' | ',''))) or ''}}

Hopefully this question makes sense?
I guess I'd either like to see that change adopted or a comment added
to layout.html indicating that it is OK to remove that line (really, I
have no idea if that would break anything which is why I didn't remove
it already, I'm under the gun to get the app out).

Thanks,
 --Doug


[web2py] Re: Watching a table for changes

In trunk, there are now triggers for DAL tables:

self._before_insert = []
self._before_update = [lambda self,fs:self.delete_uploaded_files(fs
)]
self._before_delete = [lambda self:self.delete_uploaded_files()]
self._after_insert = []
self._after_update = []
self._after_delete = []

You could define a function that stores a timestamp in the cache and add it 
to the three "_after_" triggers for the relevant tables. Then just check 
the timestamp to see if it is more recent than the last request. To 
determine the time of the last request, you could store a timestamp in the 
session upon each request (so it will be specific to each user).

Anthony

On Wednesday, June 6, 2012 5:30:56 AM UTC-4, Omri Har-Shemesh wrote:
>
> Is it possible to watch a table for changes and define a callback whenever 
> the table is changed?
> I am trying to implement a mechanism where the client is asking for data 
> every 5 seconds from the server
> and the server should only return not a null value whenever the data has 
> changed. The problem is that
> the data is quite complex and is inferred from several tables. Therefore, 
> in order to save processing time,
> I want to calculate this data and return it only when I know it has 
> changed.
>
> Thanks,
> Omri
>


[web2py] Re: Accessing extra sqlform elements from view

When you add an extra element this way, it gets inserted into the form 
object, but it does not get added to the items in form.custom.widget, 
form.custom.label, etc. (those are constructed when the form is first 
created). You have a couple options. In the view, you can simply refer to:

{{=form.element(_name='agree')}}

Or you can explicitly add to custom.widget and custom.label:

form = SQLFORM(db.yourtable)
form.custom.widget.my_extra_input = INPUT(_name='agree', value=True, _type=
'checkbox')
form.custom.label.my_extra_label = LABEL('I agree to the terms and 
conditions')
my_extra_element = TR(form.custom.label.my_extra_label, form.custom.widget.
my_extra_input)
form[0].insert(-1, my_extra_element)

Anthony

On Wednesday, June 6, 2012 7:45:38 AM UTC-4, rahulserver wrote:
>
> I added this extra element to my sqlform (as given in web2py book chapter 
> forms and validators):
>
> form = SQLFORM(db.yourtable)
> my_extra_element = TR(LABEL('I agree to the terms and conditions'), \
>   INPUT(_name='agree',value=True,_type='checkbox'))
> form[0].insert(-1,my_extra_element)
>
> But when i tried to access it in view as 
> {{=form.custom.widget.my_extra_element}} (between form.custom.begin and 
> form.custom.end) i am getting a none instead of a checkbox.
>
> {{=form}} does give the output as desired. But i wish to make a few 
> customizations in the form so i am trying the custom form approachfo.So 
> what is the way to access the extra sqlform elements from views?
>


[web2py] Re: grid's web2py style cleanup

I don't have a personal preference about this since I'm not using these 
selectors in any project. But even if the default css doesn't use them, 
some developer could already be using them for custom css definitions.

So wouldn't this break backward compatibility of web2py?

Regards

On Wednesday, June 6, 2012 2:37:51 PM UTC+2, szimszon wrote:
>
> Hi!
>
> I wonder if somebody could help to clean up sqlhtml.py's grid web2py style 
> because there are buttons with 'button' and 'buttontext' class but the css 
> have no visible definition for it. It should be 'btn' or something.
>
> I opened an issue about it in google code:
>
> http://code.google.com/p/web2py/issues/detail?id=840
>
> Thanks.
>


Re: [web2py] syntaxis error in dal

On 6 June 2012 15:26, Jose  wrote:

>
> File "/usr/home/jose/web2py/gluon/dal.py", line 4130
> rows = [[(t=='id' and item.key().id_or_name()) or \
>
> ^
> there is more space at the end of line
>
>
I have reported it in issue 838 few hours ago.

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


[web2py] syntaxis error in dal

in the function

def select(self,query,fields,attributes):
(items, tablename, fields) = 
self.select_raw(query,fields,attributes)
# self.db['_lastsql'] = self._select(query,fields,attributes)
rows = [[(t=='id' and item.key().id_or_name()) or \
 (t=='nativeRef' and item) or getattr(item, t) \
 for t in fields] for item in items]
colnames = ['%s.%s' % (tablename, t) for t in fields]
processor = attributes.get('processor',self.parse)
return processor(rows,fields,colnames,False)

error:

File "/usr/home/jose/web2py/gluon/dal.py", line 4130
rows = [[(t=='id' and item.key().id_or_name()) or \  
   ^
there is more space at the end of line

Jose



[web2py] Re: LOAD with ajax=True not working please help

Good point -- the new reload functionality should have used "jQuery()" 
rather than "$()".

Anthony

On Wednesday, June 6, 2012 8:17:07 AM UTC-4, szimszon wrote:
>
> Here is what I found with help of 
> http://stackoverflow.com/questions/777062/jquery-field-is-null
>
> --- web2py.js.old2012-06-04 22:02:56.0 +0200
> +++ web2py.js2012-06-06 14:12:48.546141468 +0200
> @@ -104,8 +104,8 @@
>  
>  function web2py_component(action, target, timeout, times){
>jQuery(function(){
> -var element = $("#" + target).get(0);
> -var statement = "$('#" + target + "').get(0).reload();";
> +var element = jQuery("#" + target).get(0);
> +var statement = "jQuery('#" + target + "').get(0).reload();";
>  element.reload = function (){
>  // Continue if times is Infinity or
>  // the times limit is not reached
>
>
>
> 2012. június 6., szerda 13:38:12 UTC+2 időpontban szimszon a következőt 
> írta:
>>
>>
>> Version 2.00.0 (2012-06-05 00:02:52) dev
>>
>> in layout.html {{=LOAD('default','setuser',extension='load',ajax=True)}}
>>
>> $("#" + target) is null @ http://127.0.0.1:8000/.../static/js/web2py.js:107
>>
>> without ajax=True it loads but is is working correctly only with ajax=True :(
>> http://code.google.com/p/web2py/issues/detail?id=839
>>
>>
>>

Re: [web2py] Fluxflex will be shut down and no longer available on June 30, 2012

Too bad..

On Wed, Jun 6, 2012 at 8:03 AM, drelyn86  wrote:

> Fluxflex will be shut down and will be no longer available on June 30,
>> 2012.
>> =
>> From 2010, we have provided Fluxflex for about two years.
>> But because of profitability, instability and some other issues,
>> we decided to shut down fluxflex on June 30, 2012.
>> Because our team is composed of just two members,
>> we decided to focus more on concise products.
>> Thanks to all of our users, who kindly support our team and
>> advice us a lot to improve Fluxflex.
>> Although we shut down fluxflex.com, we will introduce your our new
>> service soon,
>> which is like pre-configured VPS as localhost on a Cloud and
>> much more products for developers.
>> I really appreciate all people who help fluxflex.
>
>
>
> Source:  http://dl.dropbox.com/u/964705/fluxflex/goodbye_fluxflex.md


[web2py] Three typos/updates in web2py online book (JSON/Pyjamas section)

In section http://web2py.com/books/default/chapter/29/10#JSONRPC-and-Pyjamas

   1. Pyjamas is now known as PyJS, even though the libraries are still 
   called pyjamas
   2. import pyjamas.ui.KeyboardListener should read import 
pyjamas.ui.KeyboardListener 
   as KeyboardListener to work properly
   3. src="{{=URL('static','output/*pygwt.js*')}}"> should be 
*bootstrap.js*instead of 
   *pygwt.js*
   


[web2py] Fluxflex will be shut down and no longer available on June 30, 2012


>
> Fluxflex will be shut down and will be no longer available on June 30, 
> 2012.
> =
> From 2010, we have provided Fluxflex for about two years.
> But because of profitability, instability and some other issues,
> we decided to shut down fluxflex on June 30, 2012.
> Because our team is composed of just two members,
> we decided to focus more on concise products.
> Thanks to all of our users, who kindly support our team and
> advice us a lot to improve Fluxflex.
> Although we shut down fluxflex.com, we will introduce your our new service 
> soon,
> which is like pre-configured VPS as localhost on a Cloud and
> much more products for developers.
> I really appreciate all people who help fluxflex.



Source:  http://dl.dropbox.com/u/964705/fluxflex/goodbye_fluxflex.md

[web2py] grid's web2py style cleanup

Hi!

I wonder if somebody could help to clean up sqlhtml.py's grid web2py style 
because there are buttons with 'button' and 'buttontext' class but the css 
have no visible definition for it. It should be 'btn' or something.

I opened an issue about it in google code:

http://code.google.com/p/web2py/issues/detail?id=840

Thanks.


[web2py] Re: LOAD with ajax=True not working please help

Here is what I found with help of 
http://stackoverflow.com/questions/777062/jquery-field-is-null

--- web2py.js.old2012-06-04 22:02:56.0 +0200
+++ web2py.js2012-06-06 14:12:48.546141468 +0200
@@ -104,8 +104,8 @@
 
 function web2py_component(action, target, timeout, times){
   jQuery(function(){
-var element = $("#" + target).get(0);
-var statement = "$('#" + target + "').get(0).reload();";
+var element = jQuery("#" + target).get(0);
+var statement = "jQuery('#" + target + "').get(0).reload();";
 element.reload = function (){
 // Continue if times is Infinity or
 // the times limit is not reached



2012. június 6., szerda 13:38:12 UTC+2 időpontban szimszon a következőt 
írta:
>
>
> Version 2.00.0 (2012-06-05 00:02:52) dev
>
> in layout.html {{=LOAD('default','setuser',extension='load',ajax=True)}}
>
> $("#" + target) is null @ http://127.0.0.1:8000/.../static/js/web2py.js:107
>
> without ajax=True it loads but is is working correctly only with ajax=True :(
> http://code.google.com/p/web2py/issues/detail?id=839
>
>
>

[web2py] Error connecting with mysql database

Dear ALL, 

i am trying to connect my website to a mysql database using this connection 
string db = DAL('mysql://i3zif_user:i3zif@localhost/i3zif_test')  and i 
keep getting this :




ERROR TICKET FOR "I3ZIF2"
TICKET ID
127.0.0.1.2012-06-06.07-02-36.d2515abd-2f82-4ed8-aef8-e1e52b134cd7

 (1064, u"You have an 
error in your SQL syntax; check the manual that corresponds to your MySQL 
server version for the right syntax to use near 'Like INT,\n 
Show_on_SideBar CHAR(1),\n Home_Page_Video CHAR(1),\n Order_Nu' at line 22")
VERSION
web2py™(1, 99, 4, datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable')
Python
TRACEBACK

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 204, in restricted
exec ccode in environment
  File "C:/web2py/applications/i3zif2/models/db.py", line 255, in 
Field('Order_Number','integer')
  File "C:\web2py\gluon\dal.py", line 5097, in define_table
polymodel=polymodel)
  File "C:\web2py\gluon\dal.py", line 705, in create_table
self.create_sequence_and_triggers(query,table)
  File "C:\web2py\gluon\dal.py", line 1348, in create_sequence_and_triggers
self.execute(query)
  File "C:\web2py\gluon\dal.py", line 1359, in execute
return self.log_execute(*a, **b)
  File "C:\web2py\gluon\dal.py", line 1353, in log_execute
ret = self.cursor.execute(*a, **b)
  File "C:\web2py\gluon\contrib\pymysql\cursors.py", line 108, in execute
self.errorhandler(self, exc, value)
  File "C:\web2py\gluon\contrib\pymysql\connections.py", line 184, in 
defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1064, u"You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right syntax 
to use near 'Like INT,\nShow_on_SideBar CHAR(1),\nHome_Page_Video 
CHAR(1),\nOrder_Nu' at line 22")
IN FILE: C:\WEB2PY\APPLICATIONS\I3ZIF2\MODELS\DB.PY
# -*- coding: utf-8 -*-

#
## Made By Hassan Alnatour
## Powerd By GardeniaTelco
#

## if SSL/HTTPS is properly configured and you want all HTTP requests to
## be redirected to HTTPS, uncomment the line below:
# request.requires_https()

if not request.env.web2py_runtime_gae:
## if NOT running on Google App Engine use SQLite or other DB
db = DAL('mysql://i3zif_user:i3zif@localhost/i3zif_test')
#db=DAL('sqlite://storage.sqlite')
else:
## connect to Google BigTable (optional 'google:datastore://namespace')
db = DAL('google:datastore')
## store sessions and tickets there
session.connect(request, response, db = db)
## or store session in Memcache, Redis, etc.
## from gluon.contrib.memdb import MEMDB
## from google.appengine.api.memcache import Client
## session.connect(request, response, db = MEMDB(Client()))

## by default give a view/generic.extension to all actions from localhost
## none otherwise. a pattern can be 'controller/function.extension'
response.generic_patterns = ['*'] if request.is_local else []
## (optional) optimize handling of static files
# response.optimize_css = 'concat,minify,inline'
# response.optimize_js = 'concat,minify,inline'

#
## Here is sample code if you need for
## - email capabilities
## - authentication (registration, login, logout, ... )
## - authorization (role based authorization)
## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)
## - old style crud actions
## (more options discussed in gluon/tools.py)
#

from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db, hmac_key=Auth.get_or_create_key())
crud, service, plugins = Crud(db), Service(), PluginManager()

#auth.settings.custom_fields['auth_user'].append()
genders = ['Male','Female']
## customize auth
auth.settings.extra_fields['auth_user']= [
  Field('Country'),
  Field('City'),
  Field('gender',requires=IS_IN_SET(genders,zero=None)),
  Field('Age','integer'),
  
Field('agree_to_terms','boolean',requires=IS_NOT_EMPTY(error_message='Dear 
User You Must Argee To Service Terms'))
  #Field('complete_registration',default=False,update=True,writable=False, 
readable=False),
  #Field('completed_registration',default="False",writable=False, 
readable=False)
  ]

#if auth.user and auth.user.complete_registration == False:
#   if not (request.controller,request.function) == ('default','user'):
#   redirect(URL('default', 'user', args='profile'))

## create all tables needed by auth if not custom tables
lan = request.controller
auth.define_tables()
auth.settings.register_next = URL(lan,'index')
auth.settings.profile_next = URL(lan,'index')
auth.settings.login_next = URL(lan,'index')
auth.settings.logout_next = URL(lan,'index')

## configure email
mail=auth.settings.mailer
mail.settings.server ='smtp

Re: [web2py] Re: response.flash: null

On 6 June 2012 12:30, Niphlod  wrote:

> Trunk code, but application was created with trunk welcome or not ?
> There is a small issue with encoding on flash messages for
> internationalization
>
> I am using the static/css, static/js and views/layout.html(with a few
changes) from the welcome app.  The original app was created long ago.

Regards
Johann


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


[web2py] Accessing extra sqlform elements from view

I added this extra element to my sqlform (as given in web2py book chapter 
forms and validators):

form = SQLFORM(db.yourtable)
my_extra_element = TR(LABEL('I agree to the terms and conditions'), \
  INPUT(_name='agree',value=True,_type='checkbox'))
form[0].insert(-1,my_extra_element)

But when i tried to access it in view as 
{{=form.custom.widget.my_extra_element}} (between form.custom.begin and 
form.custom.end) i am getting a none instead of a checkbox.

{{=form}} does give the output as desired. But i wish to make a few 
customizations in the form so i am trying the custom form approachfo.So 
what is the way to access the extra sqlform elements from views?


[web2py] Re: Anyone using BootSwatch with new web2py layout

I have issue with dropdown menu when the main menu is a link too.

If I click on the main menu than that menu is activated and I can't access 
the items below it with any means :(


[web2py] LOAD with ajax=True not working please help



Version 2.00.0 (2012-06-05 00:02:52) dev

in layout.html {{=LOAD('default','setuser',extension='load',ajax=True)}}

$("#" + target) is null @ http://127.0.0.1:8000/.../static/js/web2py.js:107

without ajax=True it loads but is is working correctly only with ajax=True :(
http://code.google.com/p/web2py/issues/detail?id=839




[web2py] book page is down

http://web2py.com/book
Internal error Ticket issued 


Re: [web2py] Re: Innovation under Austerity

WOW
quoting.

"the next facebook should never happen. Its intermediated inovation serving
the needs of finnanceer, not serving the needs of people.

which is not to say that social networking shouldnt happend, it shouldnt
happend with a man in the midle attack."


2012/6/6 Massimo Di Pierro 

> I agree with the first commenter "this is not only one of the best
> speeches I have ever heard, but also one of the most important".
>
> What he says if very relevant to who we are and what we do on this mailing
> list.
>
> Massimo
>
>
> On Tuesday, 5 June 2012 18:02:25 UTC-5, mcm wrote:
>>
>> F2C2012: Eben Moglen keynote - "Innovation under Austerity"
>>
>> http://youtu.be/G2VHf5vpBy8
>>
>> A great speech about freedom and the impact of free software on it.
>> Watch and share.
>>
>> mic
>>
>


[web2py] Re: Anyone using BootSwatch with new web2py layout

Funny ?   I've copied welcome's layout.html, and the whole welcome static 
folder to my old app ( I hadn't modified them in my old app, except for 
Paolo's files above).  I imagine others do this to get their existing basic 
apps updated with the UI changes in trunk.  The jQuery selector 
above '.nav>li>a' doesn't fire so I don't get the extra caret class or 
data-toggle attribute in the Yellow "web2py" menu item's  tag . 
 (Confirmed in chrome's Element viewer), and the auth menu item formats 
don't match welcome's format.

Not a big issue as I know the welcome clone works properly,  but I cannot 
fathom it, particularly annoying when trying to learn how the whole css / 
js stuff hangs together.

P.S.  Are your changes above in trunk ?


On Wednesday, June 6, 2012 2:07:45 PM UTC+12, Andrew wrote:
>
> And here, in layout.html where it gets the class.
>
>   jQuery(function(){
>  jQuery('.nav>li>a').each(function(){
> if(jQuery(this).parent().find('ul').length)
>
> jQuery(this).attr({'class':'dropdown-toggle','data-toggle':'dropdown'}).append('  
> class="caret">');
>
> I hope I can now figure it out ...
>
> On Tuesday, June 5, 2012 10:35:31 PM UTC+12, LightDot wrote:
>>
>> Just a heads up to everybody, Bootstrap 2.0.4 has been released a few 
>> days ago.
>
>

[web2py] DAL Sybase Adapter testing update

We have successfully queried rows using cursor.execute() with pythonodbc 
connected to our Sysbase database.
We cannot test a native pythonsybase driver because from what we found in 
opensource, you have to have the Sybase SDK to build
the opensource native driver and the SDK costs more than $1,700 apparently.
We used this Sybase ODBC driver on the remove AWS host on Citrix:
Sybase IQ Driver 11.00.01.5612
from Anywhere Solution Inc.
DBODBC11.dll  8/31/2010

We used this driver on the laptop client:
Adaptive Server IQ 9.00.02.1023
IAnywhere Solutions Inc.
DBODBC9.dll

We only have read access to the Sybase database.

Next we plan to get the table schemas and will try to construct the web2py 
tables for them.
Then we can try using web2py queries which will then exercise / test the 
column type mappings in the DAL Sybase Adapter.
It will take a few weeks probably.
I don't think there is any usable id column in the native sybase data, but 
I will cluge something.

One suggestion:
Where you can specify an id type column in a web2py table over a legacy 
database,
have it take the python int() function of the column if it is a legacy 
string column.
Often, a useable id column in a legacy table is unfortunately in string 
format, but otherwise would be a good id.
So my suggestion is to 'help it along' by taking the int() of the string 
column so that it will be a useable numeric id for the web2py table.





[web2py] Re: response.flash: null

Trunk code, but application was created with trunk welcome or not ?
There is a small issue with encoding on flash messages for 
internationalization

Il giorno mercoledì 6 giugno 2012 10:59:33 UTC+2, Johann Spies ha scritto:
>
> I am working with the trunk code.  When I load a form (SQLFORM.factory) 
>  there appears a 'null' flash which does not come from my code.  I do not 
> want it there. How can I prevent this flash?  This is even before the form 
> is submitted.
>
> Screenshot attached.
>
> Regards
> Johann
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>
> 

[web2py] Why the temporary file is larger than the original one?

I am uploading a video from using web2py SQLFORM and want to process it 
while it is uploading. I find that even the video is completely uploaded 
the temporary file of the video in the /tmp directory is larger than the 
original video.Why?Does the python tempfile module add some bytes to 
it?Many thanks!


[web2py] Watching a table for changes

Is it possible to watch a table for changes and define a callback whenever 
the table is changed?
I am trying to implement a mechanism where the client is asking for data 
every 5 seconds from the server
and the server should only return not a null value whenever the data has 
changed. The problem is that
the data is quite complex and is inferred from several tables. Therefore, 
in order to save processing time,
I want to calculate this data and return it only when I know it has changed.

Thanks,
Omri


Re: [web2py] web2py interactive console

Oh thank you , it working now


Re: [web2py] web2py interactive console

Hello

You need add the -M option to load models.



On Wed, Jun 6, 2012 at 6:25 AM, Hassan Alnatour
wrote:

> Dear ALL ,
>
> i am trying  to use web2py from the terminal now i open the terminal and
> did this :
>
> $ cd web2py
> $ python web2py.py -S welcome
>
>
> here web2py will start the interactive console :
>
> >>> db =  DAL('sqlite://storage.sqlite')
> >>> db.tables
> []
>
>
>
> i didnt find my tables , why ??  i want to do this becouse i want to
> export a csv file for my auth_user
>
>
>
>
>


[web2py] web2py interactive console

Dear ALL , 

i am trying  to use web2py from the terminal now i open the terminal and 
did this :

$ cd web2py
$ python web2py.py -S welcome


here web2py will start the interactive console :

>>> db =  DAL('sqlite://storage.sqlite')
>>> db.tables 
[]



i didnt find my tables , why ??  i want to do this becouse i want to export 
a csv file for my auth_user






[web2py] response.flash: null

I am working with the trunk code.  When I load a form (SQLFORM.factory)
 there appears a 'null' flash which does not come from my code.  I do not
want it there. How can I prevent this flash?  This is even before the form
is submitted.

Screenshot attached.

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

[web2py] Moving Data From Sqlite To MySql

Dear ALL, 

How can i move my database from sqlite to mysql ? 

regards,


[web2py] How to limit upload speed in web2py?

I am using SQLForm to submit a large file and want to limit the upload 
speed. How to do it ? Thanks.