[web2py] Re: What works, float type, decimal type, double or all/none of the above?

2015-07-16 Thread greenpoise
Well, if I comment out the sizes, everything works. I have tried using double 
as my field type. It doesn't work either. 

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


[web2py] Re: One to many represent as_json

2015-07-16 Thread LoveWeb2py
Any other thoughts on how this could happen? I think I've seen it done 
before

On Tuesday, July 14, 2015 at 5:14:56 PM UTC-4, Dave S wrote:
>
>
>
> On Tuesday, July 14, 2015 at 11:29:00 AM UTC-7, Dave S wrote:
>>
>>
>>
>> On Tuesday, July 14, 2015 at 11:07:39 AM UTC-7, LoveWeb2py wrote:
>>>
>>> Hello,
>>>
>>> My goal is to represent the name instead of the field id here is my 
>>> model:
>>>
>>> db.define_table('vendors',
>>> * Field('name','string'),*
>>>  Field('vendor_location','string'),
>>>  format='%(name)s', migrate=True)
>>>
>>
>>
>> I may be missing something, but it doesn't look like you have a 
>> "Field('name'')" for the format to work on.
>>
>
> Whoops, I did miss it.
>
>

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


[web2py] Re: Represent use wrong row id

2015-07-16 Thread Anthony
Definitely sounds odd. Can you upload a minimal app that reproduces the 
problem?

On Thursday, July 16, 2015 at 5:47:52 PM UTC-4, icodk wrote:
>
> I want to represent a field with a link to a function in an 
> SQLFORM.smartgrid with reference to the row:
> db.place.mode.represent=lambda mode,row: A(mode,_href=URL(
> 'place_mode_change',args=[row.id],user_signature=True))
>
> In the above expression the link A is constructed from the mode which is 
> the value of the mode of the current row.mode to be displayed and the args 
> in the URL should be the current row.id
> This works fine as long as the mode value is different from one row to 
> another. However, if the value of mode in two different rows are the same 
> then the row.id is the same and it is set to the first occurrence of the 
> mode value.
> For example if we have 3 rows and the values of the mode field 
> are:'Normal' in row 1 ,'High'  in row 2 and again 'Normal' in row 3 then 
> the args=row.id will be set to: 1 on the first row. 2 in the second row 
> and 1 again in the third row instead of 3 because the row id is actually 3 
> and not 1.
> Any idea about what is happening and what am I doing wrong ?
>
>

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


[web2py] Re: What works, float type, decimal type, double or all/none of the above?

2015-07-16 Thread Alex
you forget the type for the size field, as said before: default is string, 
so you must specify your type, e.g.:
Field('size1', 'double'),
Field('size2', 'double')

the error messages indicates a different error. A failed Foreign Key 
constraint happens when you set an invalid id for a FK field. Check your 
references, from the snippet you posted only color is a foreign key so 
maybe this field value is invalid.

Am Freitag, 17. Juli 2015 00:38:42 UTC+2 schrieb greenpoise:
>
> Alex,
>
> Just noticed that it is not the calculation. The error lies in the Size 1 
> & Size 2 of my db. These values could be decimal. So let me post this again.
>
>
> db:
> Field('size1'),
>Field('size2'),
>Field('color','reference color'),
>
>
> error:
>
> Traceback (most recent call last):
>   File "Applications/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
>   File 
> "Applications/web2py/applications/MosaicCatalogBuilder/controllers/appadmin.py"
>  
> ,
>  line 463, in 
>   File "Applications/web2py/gluon/globals.py", line 412, in 
> self._caller = lambda f: f()
>   File 
> "Applications/web2py/applications/MosaicCatalogBuilder/controllers/appadmin.py"
>  
> ,
>  line 299, in update
> if form.accepts(request.vars, session):
>   File "Applications/web2py/gluon/sqlhtml.py", line 1686, in accepts
> self.id_field_name]).update(**fields)
>   File "Applications/web2py/gluon/packages/dal/pydal/objects.py", line 2020, 
> in update
> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>   File "Applications/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 996, in update
> raise e
> IntegrityError: FOREIGN KEY constraint failed
>
>
> Thanks!
>
>
> On Thursday, July 16, 2015 at 3:30:24 PM UTC-7, Alex wrote:
>>
>> Posting the error information would probably help. Leaving the type blank 
>> sets 'string' as default. According to the documentation there is only a 
>> type 'double' but no type 'float'. What's the data type of your column in 
>> the db?
>>
>> Alex
>>
>

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


[web2py] Re: How to translate options list

2015-07-16 Thread 黄祥
just an idea, if you just have 2 or under 10 option why not is_in_set 
validators instead?
e.g.
db.define_table('room',
Field('name'), 
Field('status') )

room.status.requires = IS_IN_SET([('Busy', T('Busy') ), ('Empty', 
T('Empty') ) ] )

best regards,
stifan

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


[web2py] form in load component must be process directly

2015-07-16 Thread 黄祥
continue my testing in another discussion :
https://groups.google.com/forum/#!topic/web2py/I0qpV7P_Vrw

but much smaller (without session, without validation, to see how form work 
in components)

test from the book about components : it works well, when i go futher, 
split it into 2 functions, it still work, but when the split function that 
have form, have a condition if form.process(), it can't response directly
*e.g. from book split into 2 functions works*
*controllers/default.py*
@auth.requires_login()
def post():
form = SQLFORM(db.comment_post).process()
return dict(form = form)

def show():
comments = db(db.comment_post).select()
return dict(comments = comments)

*views/default/post.load*
{{=form}}

*views/default/show.load*
{{for post in comments:}}

  On {{=post.created_on}} {{=post.created_by.first_name}}
  says {{=post.body}}

{{pass}}

*e.g. split function that have form, have a condition, it can't response 
directly*
*controllers/default.py*
@auth.requires_login()
def post():
form = SQLFORM(db.comment_post)
if form.process().accepted:
response.js = "jQuery('#show').get(0).reload()"
#response.flash = "test"
session.flash = "test"
elif form.errors:
#response.flash = "Form has errors"
session.flash = "Form has errors"
return dict(form = form)

*expected result : *
the form have response flash after submit, and then reload the show load 
component. 

*result i got : *
the form didn't have response flash at all (not responding), yet the value 
is insert in database, the show load component is not reload, i must 
refresh the page to show new inserted value

already tried to give a comment the response.js to expect result just a 
response flash, but it still not show it after first submit

i think, it seems the code below the if conditional form process is not 
executed on the first submit. (please correct me if i'm wrong about this)

tested in chrome, firefox and ie with web2py source

best regards,
stifan

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


[web2py] Re: What works, float type, decimal type, double or all/none of the above?

2015-07-16 Thread greenpoise
Alex,

Just noticed that it is not the calculation. The error lies in the Size 1 & 
Size 2 of my db. These values could be decimal. So let me post this again.


db:
Field('size1'),
   Field('size2'),
   Field('color','reference color'),


error:

Traceback (most recent call last):
  File "Applications/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
  File 
"Applications/web2py/applications/MosaicCatalogBuilder/controllers/appadmin.py" 
,
 line 463, in 
  File "Applications/web2py/gluon/globals.py", line 412, in 
self._caller = lambda f: f()
  File 
"Applications/web2py/applications/MosaicCatalogBuilder/controllers/appadmin.py" 
,
 line 299, in update
if form.accepts(request.vars, session):
  File "Applications/web2py/gluon/sqlhtml.py", line 1686, in accepts
self.id_field_name]).update(**fields)
  File "Applications/web2py/gluon/packages/dal/pydal/objects.py", line 2020, in 
update
ret = db._adapter.update("%s" % table._tablename,self.query,fields)
  File "Applications/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
996, in update
raise e
IntegrityError: FOREIGN KEY constraint failed


Thanks!


On Thursday, July 16, 2015 at 3:30:24 PM UTC-7, Alex wrote:
>
> Posting the error information would probably help. Leaving the type blank 
> sets 'string' as default. According to the documentation there is only a 
> type 'double' but no type 'float'. What's the data type of your column in 
> the db?
>
> Alex
>

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


[web2py] Re: What works, float type, decimal type, double or all/none of the above?

2015-07-16 Thread Alex
Posting the error information would probably help. Leaving the type blank 
sets 'string' as default. According to the documentation there is only a 
type 'double' but no type 'float'. What's the data type of your column in 
the db?

Alex

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


[web2py] can I do Field ( 'mont[4]', ... ) or list item as a variable name

2015-07-16 Thread JorgeH
Hello

I need to generate a grid like






table definition is:

db.define_table ('produccion',
Field ('proyecto', 'reference proyectos'),
Field ('month', 'date'),
Field ('ton_presup', label='Budgeted Tons'),
Field ('ton_adic', label='Additional Tons'),
  
)


I have currently generated the form in the view only, iterating rows, but 
want to do it from the controller using form factory for validation 
purposes.



the number of rows and starting month may vary.

How can I use a list item as a variable name, and by the way is this the 
best approach?




Any hints?

thanks

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


[web2py] What works, float type, decimal type, double or all/none of the above?

2015-07-16 Thread greenpoise
As the subject reads. Could anyone explain to me which type works? I did an 
update to my application and now my calculation is giving me an error. This 
is what I had when it was working:

Field('size1','float'),
Field('size2','float'),
Field('color','reference color'),
Field('price'),
Field('cost',compute=lambda r: 
float(r['price'])*float(db.supplier[r.suppliercode].pricecoefficient)),

It was working before. I try searching and I found that 'float' does not 
work (or was never supposed to). Changed it to 'double', still does not 
work. Left the type blank, and does not work either. 

Thanks

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


[web2py] Represent use wrong row id

2015-07-16 Thread icodk
I want to represent a field with a link to a function in an 
SQLFORM.smartgrid with reference to the row:
db.place.mode.represent=lambda mode,row: A(mode,_href=URL(
'place_mode_change',args=[row.id],user_signature=True))

In the above expression the link A is constructed from the mode which is 
the value of the mode of the current row.mode to be displayed and the args 
in the URL should be the current row.id
This works fine as long as the mode value is different from one row to 
another. However, if the value of mode in two different rows are the same 
then the row.id is the same and it is set to the first occurrence of the 
mode value.
For example if we have 3 rows and the values of the mode field are:'Normal' 
in row 1 ,'High'  in row 2 and again 'Normal' in row 3 then the args=row.id 
will be set to: 1 on the first row. 2 in the second row and 1 again in the 
third row instead of 3 because the row id is actually 3 and not 1.
Any idea about what is happening and what am I doing wrong ?

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


[web2py] Re: redirecting app to another server

2015-07-16 Thread ari
Thank you very, very much. I've never thought that i can reroute an http 
error. Again, Thank you!!

joi, 16 iulie 2015, 03:00:31 UTC+3, Massimo Di Pierro a scris:
>
> Who says we do not have a clue? ;-)
>
> There are multiple ways:
>
> 1) The easiest way is to create a model file in your app that does:
>
> redirect(URL(args=request.args, vars=request.vars, host='
> your.new.host.com'))
>
> 2) It can be done at the routes level
>
> routes_in = [
> ('/appname','301->http://your.new.host.com/appname/default/index'),
> ('/appname/default','301->http://your.new.host.com/appname/default/index'
> ),
> ('/appname/default/index','301->
> http://your.new.host.com/appname/default/index'),
> #... more rules as needed
> ]
>
> 3) (recommended) use iptables
>
> iptables -t nat -A PREROUTING -d 1.1.1.1 -j DNAT --to-destination 2.2.2.2
> iptables -t filter -A FORWARD -d 1.1.1.1 -j ACCEPT
>
> 1.1.1.1 being the old server, and 2.2.2.2 being the new server.
>
> this will work even if the old server and the new server have the same DNS 
> domain name!
>
> 3) is recommended because although web2py can do it, this is really not a 
> job for web2py. This is a job for the OS.
>
>
>
>
> On Wednesday, 15 July 2015 18:36:59 UTC-5, ari wrote:
>>
>> it is interesting that not even the poeple who created the routes, nor 
>> the creator of web2py, doesn't have a clue how to redirect an app to 
>> another server.
>> maybe de logic behind the app is usefull?
>>
>> vineri, 10 iulie 2015, 02:32:28 UTC+3, ari a scris:
>>
>>> Hello!
>>>
>>> I have an web2py server with multiple apps. I want to redirect a 
>>> specific app to a new server
>>>
>>> Example:
>>> when i make the call
>>> http://name_of_the_server/app_name/default/index
>>>
>>> it will be redirected to:
>>> http://name_of_the_new_server/app_name/default/index
>>>
>>> i've tried the example from routes.example.py
>>> into the best case scenario, when i have some response: was only adding 
>>> into routes_in = ('BASE+/app_name/$anything'+
>>> http://name_of_the_new_server/app_name/default/index)
>>> but into the httpserver.log the entry is:
>>> 10.8.52.24, 2015-07-09 18:33:19, GET, 
>>> http://name_of_the_new_server/app_name/default/index, HTTP/1.1, 400, 
>>> 0.00
>>>
>>> the other cases was: only routes_out, both set.
>>> Could you , please, help me with this. Thank you very much
>>>
>>>
>>>

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


[web2py] Re: listen on all interfaces 0.0.0.0 or specific interface - how ?

2015-07-16 Thread Gary Cowell
Thanks Massimo. 



On Thursday, 16 July 2015 00:49:32 UTC+1, Massimo Di Pierro wrote:
>
> This is not valid syntax: 
>
> /web2py.py --ip 10.2.1.15:8000 #WRONG
>
> supposed to be
>
> /web2py.py --ip 10.2.1.15 --port 8000 
>
>
>
>
> On Wednesday, 15 July 2015 18:36:58 UTC-5, Gary Cowell wrote:
>>
>> I'm trying to get the web2py.py to listen on all interfaces in 
>> development.
>>
>> I'm sure I've done this before. I know I have. But I can't make this work 
>> at all now. I get this:
>>
>> $ ./web2py.py --ip 10.2.1.15:8000
>> web2py Web Framework
>> Created by Massimo Di Pierro, Copyright 2007-2015
>> Version 2.11.2-stable+timestamp.2015.05.30.16.33.24
>> Database drivers available: sqlite3, imaplib, cx_Oracle, pymysql, pg8000
>> WARNING:web2py:GUI not available because Tk library is not installed
>> choose a password:
>>
>> please visit:
>> http://[10.2.1.15:8000]:8000/
>> use "kill -SIGTERM 6380" to shutdown the web2py server
>>
>>
>> ERROR:Rocket.Errors.Port8000:Socket 10.2.1.15:8000:8000 in use by other 
>> process and it won't share.
>> WARNING:Rocket.Errors.Port8000:Listener started when not ready.
>>
>> The "please visit" line looks odd, and the Rocket.Erros.Port line too. 
>> Why is the port there twice?
>>
>> The only way I can get it to start, is by omitting the --ip option all 
>> together so it starts on 127.0.0.1:8000 , I can't even specify --ip 
>> 127.0.0.1:8000 because I get the same style of error.
>>
>> I'm prepared to kick myself when I find out what silly thing I'm doing 
>> wrong :/
>>
>> Thanks
>>
>

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


[web2py] How to translate options list

2015-07-16 Thread icodk
I have two tables:
db.define_table('room',
Field('name'), 
Field('status', 'reference room_status'))

db.define_table('room_status')
Field('status_name'))

The room_status table contians 2 records (keep it simple): Busy, Empty
I can show the 'busy' and empty in a listbox or as radio buttons No 
problem! But how do I internationalize /translate the Busy, Empty ?

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


Re: [web2py] Re: How do I tell how many users are connected to a page (websockets)?

2015-07-16 Thread Richard Vézina
I noticed some error in the scripts above, with time.ctime instead of
time.time which I ask myself how it has even work before... I am in the
process to make it works and make dummy app with will demonstrate all this
working...

Richard

On Tue, Jul 14, 2015 at 10:30 AM, Samuel Sowah  wrote:

> I was just about saying that I was taking a hack at websocket_messaging.py
> before even trying to go through Richard's code only to realize Stifan just
> mentioned that. Anyway, what happens now is, when I start the
> websocket_messaging.py with
>
> python web2py/gluon/contrib/websocket_messaging.py -k mykey -p 
>
> things seem to work just fine, except the onclose function in
>
> 
> $(document).ready(function(){
> var data;
> $.web2py.web2py_websocket('ws://127.0.0.1:/realtime/home/',
>  function(e){data=eval('('+e.data+')')},  #onmessage
>  function(){ajax('someone_online',[],'');}, #onopen
>  function(){ajax('{{='someone_offline/%s' % 
> auth.user.id}}',[],'');});
> #the onclose function that doesn't work
> });
> 
>
> 1436875501.27:CONNECT to home
> 1436875502.29:MESSAGE to home:$('#userStatus').append('saso just came
> online').fadeIn('slow').slideDown('slow')
> 1436875502.29:MESSAGE to
> home:$('#usersOnline').html($('1').fadeIn('slow').slideDown('slow'))
>
>
>
>
> When I start the websocket_messaging.py with
>
> python web2py/gluon/contrib/websocket_messaging.py -k mykey -p  -t
> 9b09360f-9052-4e5a-bb1e-a1fad72b3498
>
> the onclose function seems to execute, but it executes immediately after
> open executes and then sends the messages, hence the socket is closed even
> before the messages can reach the client.
>
> 1436882466.78:CONNECT to home
> 1436882466.78:DISCONNECT from home
> 1436882467.12:MESSAGE to home:$('#userStatus').prepend('saso just
> came online').fadeIn('slow').slideDown('slow')
> 1436882467.13:MESSAGE to
> home:$('#usersOnline').html($('2').fadeIn('slow').slideDown('slow'))
> 1436882467.74:MESSAGE to home:$('#userStatus').append('saso just went
> offline').fadeIn('slow').slideDown('slow')
> 1436882467.74:MESSAGE to
> home:$('#usersOnline').html($('1').fadeIn('slow').slideDown('slow'))
>
>
> then i realized something that I didn't exactly understand.
>
> if running with -t post a token to allow a client to join using the token
> the message here is the token (any uuid)
> allows only authorized parties to joins, for example, a chat
>
>
> it explains why the immediate disconnection after a connection is
> established because of some 'authorization'. how do i allow "authorized
> parties to join"? the users are already logged in :/
>
>
> On Saturday, July 11, 2015 at 12:53:34 AM UTC, 黄祥 wrote:
>>
>> please take a look at web2py/gluon/contrib/websocket_messaging.py
>> after that please try it, if still not success, please show the traceback
>> error or your code, so that people in this group can help.
>>
>> best regards,
>> stifan
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Pass html in label of SQLFORM.factory Field without it by sanitized

2015-07-16 Thread Thomas Sitter
XML() worked perfectly (and good catch on 'recieve', I get that wrong every 
time :P)

Thank you Massimo and Johann for the quick replies.


On Thursday, 16 July 2015 04:00:21 UTC-4, Johann Spies wrote:
>
> Hello Thomas,
>
> It seems that the css for label anyhow uses a strong font so 
>  would not have any visible effect. This is just to 
> illustrate how you can pass html in a form element:
>
> label=XML('I consent for  to provide my contact information to 
> ___. I confirm that my house DOES NOT have aluminium siding. *'),
>
> BTW "receive"  might be better than "receive". :)
>
> Regards.
> Johann
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>  

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


[web2py] Re: Web2py and OODBMS?

2015-07-16 Thread Anthony


> web2py does not include a OODBM but nothing prevent you from accessing one 
>> and take advantage of all the other features. You simply would not do it 
>> through the DAL. The reason is that there is no standardize API for 
>> accessing OODBMs. Every one of them is different and every one has its own 
>> set of APIs.
>>
>>
> This is weird to read as there is the ODMG Standard 
> http://www.odbms.org/odmg-standard/ which produced also OQL, ODL, etc.
>

According to Wikipedia, only two databases support that standard 

 
(and it doesn't look like OrientDB supports the OQL part of the standard). 
The standard was set in 2001, and although the development of a next 
generation standard was announced in 2006, it's not clear there has been 
any progress .
 

> So for example in the python world a popular one is ZODB. You can install 
>> ZODB and use it with web2py. I do not expect any problem but I never tried 
>> it. There are other OODBMs which you can use from python. If they work with 
>> Python, they work with web2py.
>>
>>
> Thank you for the reference to ZODB. However, using an OODB would miss the 
> SQLFORM and SQLFORM.factory features right?
>

You can certainly use SQLFORM.factory to generate a form and get the 
submitted data into request.vars. From there, you would have to write your 
own code to get the data into your database. You could even use SQLFORM by 
creating a dummy DAL object and defining tables on it (which is what 
SQLFORM.factory does behind the scenes). Again, SQLFORM wouldn't handle the 
database inserts/updates, but you could at least use it to generate forms 
and get the data. 

I do not want to promote a flame war here, but I didn't said SQL is the 
> past (even though that could represent a common perception about relational 
> databases today).
>

*"RDBMS (which to me is technology from 1970's but that's another story)"*

It's hard to interpret that statement in any other way...
 

> However COBOL is also used today although many languages (including 
> python) were invented later.
>

...especially in light of the COBOL comparison. Relational databases are 
under active development and are not merely kept in place to support legacy 
systems. 
 

> The same way, OODBMs were invented for specific reasons - everything has 
> been widely documented in documents like "Hitting the relational wall" 
> http://www.odbms.org/wp-content/uploads/2013/11/029.01-Wade-Hitting-the-Relational-Wall-2005.pdf
>  
> and if python is object-oriented, it makes sense to persist domain objects 
> in object-databases.
>

Whether or not it makes sense, object databases just aren't that popular 
. Frameworks like web2py tend to 
incorporate features that will have at least somewhat wide appeal. If there 
were significant demand, web2py would likely support object databases. 
 
Anthony

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


Re: [web2py] Re: using PyCharm

2015-07-16 Thread Richard Vézina
I don't think they are not interested in fixing it... I really think they
would like to fix it, but they may have limited resources to do it and many
issues to solve... Mean that, they have to prioritise and of course if you
have only few users affected by an issue make it easy to postponed this
given issue instead of the others which affect much more persons... Also
there maybe worse issue then other and this one as already a workaround,
so...

Though, I think time has come to get this one fixed...

If any one can provide them insight about how to import gluon properly it
surely will be appreciate by them...

Richard

On Wed, Jul 15, 2015 at 10:13 PM, Alex  wrote:

> web2py runs fine :) I never had serious problems with it. Here is a list
> of some PyCharm web2py issues:
>
> https://youtrack.jetbrains.com/issue/PY-10810
> reported by Richard - if this would be solved then I could probably live
> with the other issue reported by me:
> https://youtrack.jetbrains.com/issue/PY-15309
> and I found another issue which addresses the same problem (I think):
> https://youtrack.jetbrains.com/issue/PY-16070
>
> maybe you can help them somehow so they can fix it faster. But for me it
> looks like they are not even interested in fixing it.
>
> I think it would be good if more web2py PyCharm users would add comments
> and votes to those issues. Maybe then they will be taken more seriously.
>
> Alex
>
>
> Am Mittwoch, 15. Juli 2015 10:31:18 UTC+2 schrieb Massimo Di Pierro:
>>
>> Oh! I thought you were talking a web2py issue. Our turnaround is much
>> faster that that. That is a PyCharm issue. Next time if file an issue with
>> them about web2py, you may want to also open a web2py issue so we can be
>> proactive and help them resolve it.
>>
>> On Tuesday, 14 July 2015 17:34:28 UTC-5, Alex wrote:
>>>
>>> https://youtrack.jetbrains.com/issue/PY-13794
>>>
>>> Am Mittwoch, 15. Juli 2015 00:16:08 UTC+2 schrieb Massimo Di Pierro:

 Which  issue took 6 months?

 On Tuesday, 14 July 2015 14:59:15 UTC-5, Alex wrote:
>
> I added a comment to this issue. I hope they'll address this soon. But
> actually I doubt it, last time I reported an even more serious web2py 
> issue
> it took them over 6 months until they fixed it...
> I also don't think moving the applications folder out of web2py will
> work, it will probably lead to the same issue.
>
> Alex
>
  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] web2py 2.11 error on new install SESSION ISSUE

2015-07-16 Thread Kiran Subbaraman
After installing the file, from the admin screen click on the "clean" 
option (this should clear your cache, session, errors content). See if 
this helps.
If that doesn't work, please take a look at the discussions related to 
this in the group. Search for "pickle.HIGHEST_PROTOCOL".



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Thu, 16-07-2015 5:26 PM, use_web2py wrote:

Can some one look into this! I get this error after installing a new app from 
an existing w2p file.
Traceback(most recent call last):
   File"/home/www-data/web2py/gluon/main.py",line436,inwsgibase
 session.connect(request,response)
   File"/home/www-data/web2py/gluon/globals.py",line961,inconnect
 session_pickled=pickle.dumps(self,pickle.HIGHEST_PROTOCOL)
   File"/home/www-data/web2py/gluon/storage.py",line56,in
 __getnewargs__=lambda self:getattr(dict,self).__getnewargs__(self)
TypeError:getattr():attribute name must be string
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google 
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: expand_one not working anymore?

2015-07-16 Thread Samuel Sowah
Found the problem after reading this https://noembed.com/

>  Chrome now blocks insecure scripts from loading on secure sites 
> . 


I had https in the link, took that out to just http and it's working now, 
my bad. 

On Thursday, July 16, 2015 at 12:04:58 PM UTC, Samuel Sowah wrote:
>
> home.html
> {{from gluon.contrib.autolinks import expand_one}}
> {{def find_url(text):}}
> {{s = text.find("http")}}
> {{e = text.find(" ", s)}}
> {{if s is not -1:}}
> {{if e!=-1:}}
> {{url = text[s:e+1]}}
> {{else:}}
> {{url = text[s:]}}
> {{return url}}
> {{pass}}
> {{return None}}
> {{pass}}
>
> #I know the indentation isn't necessary in view but it helps me keep my 
> sanity
>
> {{url=find_url(message.message)}}
> {{=XML(expand_one(url,cache.ram('mycache',lambda:dict(),3600))) if url is 
> not None else ''}}
>
> if the message contains a url (i already posted example urls), the 
> xml(expand_one(url)) line just converts the url to an anchor link. i don't 
> see the youtube video render, neither do the google viewer thingy show up 
> for the files. am i missing something? cos i'm sure i've done this like a 
> hundred times and it's a bit weird. now i feel like i'm a bit lost.
>
>
> On Thursday, July 16, 2015 at 11:50:19 AM UTC, Massimo Di Pierro wrote:
>>
>> Are you sure your code has not changed? We have not changed the logic 
>> there in a year or more. 
>>
>> On Thursday, 16 July 2015 04:44:34 UTC-5, Samuel Sowah wrote:
>>>
>>> https://www.youtube.com/watch?v=Itlc9NUOx_Y
>>> http://www.sec.gov/news/speech/2012/spch020912co.pdf
>>> www.sigmobile.org/mobicom/2011/slides/25-understanding-slides.pptx
>>>
>>> On Thursday, July 16, 2015 at 7:41:00 AM UTC, Massimo Di Pierro wrote:

 Perhaps they no longer support oembed? Can you provide an example of a 
 URL?

 On Wednesday, 15 July 2015 23:35:45 UTC-5, Samuel Sowah wrote:
>
> currently, when I use autolinks' expand_one, I don't get youtube 
> videos rendering anymore, or anything for that matter, not even files. it 
> just turns the urls into anchor links. something I'm missing?
>


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


[web2py] Re: expand_one not working anymore?

2015-07-16 Thread Samuel Sowah
home.html
{{from gluon.contrib.autolinks import expand_one}}
{{def find_url(text):}}
{{s = text.find("http")}}
{{e = text.find(" ", s)}}
{{if s is not -1:}}
{{if e!=-1:}}
{{url = text[s:e+1]}}
{{else:}}
{{url = text[s:]}}
{{return url}}
{{pass}}
{{return None}}
{{pass}}

#I know the indentation isn't necessary in view but it helps me keep my 
sanity

{{url=find_url(message.message)}}
{{=XML(expand_one(url,cache.ram('mycache',lambda:dict(),3600))) if url is 
not None else ''}}

if the message contains a url (i already posted example urls), the 
xml(expand_one(url)) line just converts the url to an anchor link. i don't 
see the youtube video render, neither do the google viewer thingy show up 
for the files. am i missing something? cos i'm sure i've done this like a 
hundred times and it's a bit weird. now i feel like i'm a bit lost.


On Thursday, July 16, 2015 at 11:50:19 AM UTC, Massimo Di Pierro wrote:
>
> Are you sure your code has not changed? We have not changed the logic 
> there in a year or more. 
>
> On Thursday, 16 July 2015 04:44:34 UTC-5, Samuel Sowah wrote:
>>
>> https://www.youtube.com/watch?v=Itlc9NUOx_Y
>> http://www.sec.gov/news/speech/2012/spch020912co.pdf
>> www.sigmobile.org/mobicom/2011/slides/25-understanding-slides.pptx
>>
>> On Thursday, July 16, 2015 at 7:41:00 AM UTC, Massimo Di Pierro wrote:
>>>
>>> Perhaps they no longer support oembed? Can you provide an example of a 
>>> URL?
>>>
>>> On Wednesday, 15 July 2015 23:35:45 UTC-5, Samuel Sowah wrote:

 currently, when I use autolinks' expand_one, I don't get youtube videos 
 rendering anymore, or anything for that matter, not even files. it just 
 turns the urls into anchor links. something I'm missing?

>>>

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


[web2py] web2py 2.11 error on new install SESSION ISSUE

2015-07-16 Thread use_web2py


Can some one look into this! I get this error after installing a new app from 
an existing w2p file.

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/main.py", line 436, in wsgibase
session.connect(request, response)
  File "/home/www-data/web2py/gluon/globals.py", line 961, in connect
session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
  File "/home/www-data/web2py/gluon/storage.py", line 56, in 
__getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self)
TypeError: getattr(): attribute name must be string

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


[web2py] Re: expand_one not working anymore?

2015-07-16 Thread Massimo Di Pierro
Are you sure your code has not changed? We have not changed the logic there 
in a year or more. 

On Thursday, 16 July 2015 04:44:34 UTC-5, Samuel Sowah wrote:
>
> https://www.youtube.com/watch?v=Itlc9NUOx_Y
> http://www.sec.gov/news/speech/2012/spch020912co.pdf
> www.sigmobile.org/mobicom/2011/slides/25-understanding-slides.pptx
>
> On Thursday, July 16, 2015 at 7:41:00 AM UTC, Massimo Di Pierro wrote:
>>
>> Perhaps they no longer support oembed? Can you provide an example of a 
>> URL?
>>
>> On Wednesday, 15 July 2015 23:35:45 UTC-5, Samuel Sowah wrote:
>>>
>>> currently, when I use autolinks' expand_one, I don't get youtube videos 
>>> rendering anymore, or anything for that matter, not even files. it just 
>>> turns the urls into anchor links. something I'm missing?
>>>
>>

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


[web2py] another Web2py online book

2015-07-16 Thread António Ramos
Its in Portuguese

http://juliarizza.gitbooks.io/curso-web2py/content/

But its easier to navigate that the web2py.com online book.


Regards

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


Re: [web2py] Re: Web2py is "Badly designed framework" and "Does not scale"

2015-07-16 Thread Michele Comitini
Added my 2¢ .
I have many mission critical, emedded or huge projects on web2py, they make
real work for real people.

2015-07-16 4:37 GMT+02:00 Alex :

> I never understood why ORM should be better than the DAL. Actually I think
> it's the other way around. I worked with ORM for years and I'm really happy
> I can now use only DAL. It's very easy to get performance problems with ORM
> when all references are automatically fetched, and then those references
> can trigger even more selects for their own references and so on... Usually
> we ended up to manually generate our selects and then just fill in the
> class instances. This approach can be done with DAL as well (and it should
> be much easier) - if someone needs entities.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: expand_one not working anymore?

2015-07-16 Thread Samuel Sowah
https://www.youtube.com/watch?v=Itlc9NUOx_Y

On Thursday, July 16, 2015 at 7:41:00 AM UTC, Massimo Di Pierro wrote:
>
> Perhaps they no longer support oembed? Can you provide an example of a URL?
>
> On Wednesday, 15 July 2015 23:35:45 UTC-5, Samuel Sowah wrote:
>>
>> currently, when I use autolinks' expand_one, I don't get youtube videos 
>> rendering anymore, or anything for that matter, not even files. it just 
>> turns the urls into anchor links. something I'm missing?
>>
>

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


[web2py] Re: bootstrap select writable = False

2015-07-16 Thread Annet
Hi Anthony,

Thanks for your reply. Setting _disabled = True on the widget solves the 
issue.


Kind regards,

Annet

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


[web2py] Re: Multiples ajax forms (with LOAD). It is possible?

2015-07-16 Thread 黄祥
1. 
*action :*
after clean app, login, check the response.toolbar() 
*result *: 
no session value, no post_vars and no vars request
2. 
*action *:
fill in the SQLFORM.factory, submit the button, check the response.toolbar()
*result *:
the checkout in second load component is not filled (no session value yet 
the vars and post vars is filled with the value from SQLFORM.factory)
3. 
*action *:
fill in the SQLFORM.factory, submit the button, check the response.toolbar()
*result *:
the second load component have the value, there is vars, post_vars and 
session value in response.toolbar()
4.
after that all is well, the problem is sqlform is need to submit twice to 
get it work or responses (flash, error or fill the session), already tried 
clean app, give the form name, give the session a dummy value e.g. 
session_sale_order[1] = 0, 0

if this is not a bug in load component, perhaps i miss something, or this 
is just the way to use load component with two form with session.

best regards,
stifan

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


[web2py] Re: Web2py and OODBMS?

2015-07-16 Thread Massimo Di Pierro


On Thursday, 16 July 2015 02:37:46 UTC-5, Esteban Bulutsuzku wrote:
>
>
>
> El miércoles, 15 de julio de 2015, 6:09:26 (UTC-3), Massimo Di Pierro 
> escribió:
>>
>> web2py include pydal and pydal is an API for accessing RDBMs and some 
>> NoSQL engines. This is not your use case.
>>
>> web2py does not include a OODBM but nothing prevent you from accessing 
>> one and take advantage of all the other features. You simply would not do 
>> it through the DAL. The reason is that there is no standardize API for 
>> accessing OODBMs. Every one of them is different and every one has its own 
>> set of APIs.
>>
>>
> This is weird to read as there is the ODMG Standard 
> http://www.odbms.org/odmg-standard/ which produced also OQL, ODL, etc.
>

I admit I am not an expert on the topic but the page says "The ODMG Java 
binding has been superceded by Java Data Objects (JDO)." To me something 
that has Java in the name is not a standard, in the sense it probably it is 
not meant to work cross-language.
 

>  
>
>> So for example in the python world a popular one is ZODB. You can install 
>> ZODB and use it with web2py. I do not expect any problem but I never tried 
>> it. There are other OODBMs which you can use from python. If they work with 
>> Python, they work with web2py.
>>
>>
> Thank you for the reference to ZODB. However, using an OODB would miss the 
> SQLFORM and SQLFORM.factory features right?
>

You would miss SQLFORM but not SQLFORM.factory. You would still be able to 
use the latter to make forms for your ZODB database.
 

>  
>
>> That said. I disagree that OODBMs are the future and SQL is the past for 
>> two reasons: SQL databases are still widely more popular and more scalable. 
>> It is possible to build a OODBM on top of SQL database, and in fact, if 
>> time permits, I would like to build one on top of the web2py dal.
>>
>>
>>
> I do not want to promote a flame war here, but I didn't said SQL is the 
> past (even though that could represent a common perception about relational 
> databases today). However COBOL is also used today although many languages 
> (including python) were invented later. The same way, OODBMs were invented 
> for specific reasons - everything has been widely documented in documents 
> like "Hitting the relational wall" 
> http://www.odbms.org/wp-content/uploads/2013/11/029.01-Wade-Hitting-the-Relational-Wall-2005.pdf
>  
> and if python is object-oriented, it makes sense to persist domain objects 
> in object-databases.
>

 

>
>
>
>  
>
>> On Wednesday, 15 July 2015 03:29:04 UTC-5, Esteban Bulutsuzku wrote:
>>>
>>> Hello,
>>>
>>> I am an experienced OOP programmer. I -fortunately- do not use 
>>> relational technology anymore, so I won't plan get back to write 
>>> SQL/RDBMS/ORM stuff (I really don't care if the relational math theory + 
>>> ISO/IEC 9075-1 backs the stack). This could sound like a rare use case for 
>>> you, but it is not if you use actively other systems (Java, db4o, GemStone, 
>>> etc) where you can have nested complex designs with navigational access to 
>>> data, dynamic class definitions, class extensions, etc. Also if you don't 
>>> ever plan to use an OODBMS, sometimes is desirable to delay the need to 
>>> hook up a database during development, or ever forever ;)
>>>
>>> But I am dissapointed, because after hearing a lot about web2py I still 
>>> have not found how to work with web2py with an OODBMS (any of them). It 
>>> seems that web2py is tied to RDBMS (which to me is technology from 1970's 
>>> but that's another story).
>>>
>>> Maybe most python devs have experience with flat simple tabular data 
>>> models, it could also be the case that Python file-orientation promotes 
>>> more scripting approach than object-technology, and I am not criticizing 
>>> you but in my case I already have a rich object model (is *NOT* NoSQL) and 
>>> I am giving web2py a chance. 
>>>
>>> But it seems there is few to none documentation of web2py + OODBMS, i.e. 
>>> how to use the DAL with a OODMS backend.
>>>
>>> Is web2py still valid for my use-case?
>>> Anyone working with OODBMS and web2py?
>>>
>>> Thanks,
>>> Cheers,
>>>
>>> Esteban
>>>
>>>

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


Re: [web2py] Pass html in label of SQLFORM.factory Field without it by sanitized

2015-07-16 Thread Johann Spies
Hello Thomas,

It seems that the css for label anyhow uses a strong font so
 would not have any visible effect. This is just to
illustrate how you can pass html in a form element:

label=XML('I consent for  to provide my contact information to ___.
I confirm that my house DOES NOT have aluminium siding. *'),

BTW "receive"  might be better than "receive". :)

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

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


[web2py] Re: expand_one not working anymore?

2015-07-16 Thread Massimo Di Pierro
Perhaps they no longer support oembed? Can you provide an example of a URL?

On Wednesday, 15 July 2015 23:35:45 UTC-5, Samuel Sowah wrote:
>
> currently, when I use autolinks' expand_one, I don't get youtube videos 
> rendering anymore, or anything for that matter, not even files. it just 
> turns the urls into anchor links. something I'm missing?
>

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


[web2py] Re: Pass html in label of SQLFORM.factory Field without it by sanitized

2015-07-16 Thread Massimo Di Pierro
label = XML('I consent for  to provide my contact information to 
___. I confirm that my house DOES NOT have aluminium siding. 
*')

or

label=SPAN('I consent for  to provide my contact information to 
___. ', STRONG('I confirm that my house DOES NOT have aluminium siding. 
*')),


On Wednesday, 15 July 2015 22:09:14 UTC-5, Thomas Sitter wrote:
>
> Hello,
>
> I am trying to pass HTML from my controller in a SQLFORM.factory but it 
> keeps getting sanitized
>
> form = SQLFORM.factory(
> Field('install_consent', 'boolean', 
> label='I consent for  to provide my contact information to ___. 
> I confirm that my house DOES NOT have aluminium siding. *',
> requires=IS_NOT_EMPTY('You must provide consent in order to recieve the 
> equipment')
> )
> )
>
> Is there anyway to do this?
>
> Thanks for the help.
>

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


[web2py] Re: web2py.js websocket bug?

2015-07-16 Thread Massimo Di Pierro
Here. Just post a link to this thread.

https://github.com/web2py/web2py/issues/new

On Wednesday, 15 July 2015 18:51:37 UTC-5, Samuel Sowah wrote:
>
>
>
> On Wednesday, July 15, 2015 at 11:46:38 PM UTC, Massimo Di Pierro wrote:
>>
>> you may be right. Will check asap. Please open a ticket.
>>
>> I've never opened a ticket, where and how do I do that?
>  
>
>> On Wednesday, 15 July 2015 18:17:00 UTC-5, Samuel Sowah wrote:
>>>
>>> I believe this is a bug. Please confirm what I'm thinking or correct me 
>>> if I'm wrong.
>>> The web2py_websocket function in web2py.js takes 4 parameters (2 
>>> optional, onopen and onclose)
>>> web2py_websocket: function (url, onmessage, onopen, onclose) {
>>>   if("WebSocket" in window) {
>>> var ws = new WebSocket(url);
>>> ws.onopen = onopen ? onopen : (function () {});
>>> ws.onmessage = onmessage;
>>> ws.onclose = onclose ? onclose : (function () {});
>>> return true; /* supported */
>>>   } else return false; /* not supported */
>>> },
>>>
>>>
>>> I used all 4 parameters but only 3 behave how I expect them except to. 
>>> url, onmessage, and onopen.
>>> the url connects the client to the websocket, onmessage executes when a 
>>> message is sent, onopen if specified executes when the socket is opened. I 
>>> expect that onclose would execute if specified, when the socket is closed 
>>> (client disconnects). for some reason, when the client disconnects, the 
>>> function doesn't execute. I've already asked leading questions in other 
>>> threads but I think this should sum up my exact problem.
>>>
>>> *default/home.html*
>>> 
>>>$(document).ready(function(){
>>>   var data;
>>>   $.web2py.web2py_websocket('ws://127.0.0.1:/realtime/home',
>>>   function(e){data=eval('('+e.data+')')},
>>>   function(){ajax('someone_online',[],'');},
>>>   function(){ajax('{{='someone_offline/%s' % auth.user.id
>>> }}',[],'');});
>>>});
>>> 
>>>
>>>
>>> *default.py*
>>> @auth.requires_login()
>>> def someone_online():
>>> if not db(db.online_users.user_id==auth.user.id).select():
>>> db.online_users.insert(user_id=auth.user.id)
>>> script2="""$('#userStatus').prepend('%s just came 
>>> online').fadeIn('slow').slideDown('slow')""" % auth.user.full_name
>>> websocket_send('http://127.0.0.1:', script2, 'somekey', 'home')
>>> 
>>> script1="""$('#usersOnline').html($('%s').fadeIn('slow').slideDown('slow'))"""
>>>  
>>> % len(db().select(db.online_users.user_id))
>>> websocket_send('http://127.0.0.1:', script1, 'somekey', 'home')
>>>
>>>
>>> @auth.requires_login()
>>> def someone_offline():
>>> db(db.online_users.user_id==request.args(0)).delete()
>>> script2="""$('#userStatus').append('%s just went 
>>> offline').fadeIn('slow').slideDown('slow')""" % db(db.auth_user.id
>>> ==request.args(0)).select().first().full_name
>>> websocket_send('http://127.0.0.1:', script2, 'somekey', 'home')
>>> 
>>> script1="""$('#usersOnline').html($('%s').fadeIn('slow').slideDown('slow'))"""
>>>  
>>> % len(db().select(db.online_users.user_id))
>>> websocket_send('http://127.0.0.1:', script1, 'somekey', 'home')
>>>
>>>
>>> Scenario for the code above. when someone opens home.html, the page will 
>>> connect to the websocket server because of the ws:// url on the page. 
>>> because the onopen parameter has been specified, that function would 
>>> execute immediately after the connection is established, which is to call 
>>> the someone_online method in default.py via ajax. the someone_online method 
>>> then via websocket_send updates the page with the statement " just 
>>> came online".
>>>
>>> This so far works just as expected.
>>> 1436999804.04:CONNECT to home
>>> 1436999804.41:MESSAGE to home:$('#userStatus').prepend('saso just 
>>> came online').fadeIn('slow').slideDown('slow')
>>> 1436999804.41:MESSAGE to 
>>> home:$('#usersOnline').html($('2').fadeIn('slow').slideDown('slow'))
>>>
>>>
>>> The part that doesn't work is, when the page is closed, i expect that 
>>> other people who have that same page opened will get the update " 
>>> just went offline". the onclose function doesn't seem to be executed at 
>>> all, or at least it doesn't do what I'm expecting. For example, when i 
>>> refresh the page, it disconnects and reconnects without sending the offline 
>>> message.
>>> 1437002425.12:DISCONNECT from home
>>> 1437002425.52:CONNECT to home
>>> 1437002425.98:MESSAGE to home:$('#userStatus').prepend('saso just 
>>> came online').fadeIn('slow').slideDown('slow')
>>> 1437002425.98:MESSAGE to 
>>> home:$('#usersOnline').html($('2').fadeIn('slow').slideDown('slow'))
>>>
>>>
>>> What I have tried:
>>> I tried starting the websocket server with the token option -t. When 
>>> this is in play, somehow due to unregistered tokens I believe, the 
>>> connection opens and closes immediately due to this code in the 
>>> websocket_messaging.py script.
>>>

[web2py] Re: Web2py and OODBMS?

2015-07-16 Thread Esteban Bulutsuzku


El miércoles, 15 de julio de 2015, 6:09:26 (UTC-3), Massimo Di Pierro 
escribió:
>
> web2py include pydal and pydal is an API for accessing RDBMs and some 
> NoSQL engines. This is not your use case.
>
> web2py does not include a OODBM but nothing prevent you from accessing one 
> and take advantage of all the other features. You simply would not do it 
> through the DAL. The reason is that there is no standardize API for 
> accessing OODBMs. Every one of them is different and every one has its own 
> set of APIs.
>
>
This is weird to read as there is the ODMG Standard 
http://www.odbms.org/odmg-standard/ which produced also OQL, ODL, etc.
 

> So for example in the python world a popular one is ZODB. You can install 
> ZODB and use it with web2py. I do not expect any problem but I never tried 
> it. There are other OODBMs which you can use from python. If they work with 
> Python, they work with web2py.
>
>
Thank you for the reference to ZODB. However, using an OODB would miss the 
SQLFORM and SQLFORM.factory features right?
 

> That said. I disagree that OODBMs are the future and SQL is the past for 
> two reasons: SQL databases are still widely more popular and more scalable. 
> It is possible to build a OODBM on top of SQL database, and in fact, if 
> time permits, I would like to build one on top of the web2py dal.
>
>
>
I do not want to promote a flame war here, but I didn't said SQL is the 
past (even though that could represent a common perception about relational 
databases today). However COBOL is also used today although many languages 
(including python) were invented later. The same way, OODBMs were invented 
for specific reasons - everything has been widely documented in documents 
like "Hitting the relational wall" 
http://www.odbms.org/wp-content/uploads/2013/11/029.01-Wade-Hitting-the-Relational-Wall-2005.pdf
 
and if python is object-oriented, it makes sense to persist domain objects 
in object-databases.



 

> On Wednesday, 15 July 2015 03:29:04 UTC-5, Esteban Bulutsuzku wrote:
>>
>> Hello,
>>
>> I am an experienced OOP programmer. I -fortunately- do not use relational 
>> technology anymore, so I won't plan get back to write SQL/RDBMS/ORM stuff 
>> (I really don't care if the relational math theory + ISO/IEC 9075-1 backs 
>> the stack). This could sound like a rare use case for you, but it is not if 
>> you use actively other systems (Java, db4o, GemStone, etc) where you can 
>> have nested complex designs with navigational access to data, dynamic class 
>> definitions, class extensions, etc. Also if you don't ever plan to use an 
>> OODBMS, sometimes is desirable to delay the need to hook up a database 
>> during development, or ever forever ;)
>>
>> But I am dissapointed, because after hearing a lot about web2py I still 
>> have not found how to work with web2py with an OODBMS (any of them). It 
>> seems that web2py is tied to RDBMS (which to me is technology from 1970's 
>> but that's another story).
>>
>> Maybe most python devs have experience with flat simple tabular data 
>> models, it could also be the case that Python file-orientation promotes 
>> more scripting approach than object-technology, and I am not criticizing 
>> you but in my case I already have a rich object model (is *NOT* NoSQL) and 
>> I am giving web2py a chance. 
>>
>> But it seems there is few to none documentation of web2py + OODBMS, i.e. 
>> how to use the DAL with a OODMS backend.
>>
>> Is web2py still valid for my use-case?
>> Anyone working with OODBMS and web2py?
>>
>> Thanks,
>> Cheers,
>>
>> Esteban
>>
>>

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