[web2py] plugin_jqgrid and events

2010-07-21 Thread Massimiliano
Hi,

I'm trying to play with cube2py, is amazing.

I've a little problem with the jqgrid plugin, problem that didn't appears
using jqgrid standalone (declaring the grid in template and using json to
retrieve the data).

When I try to set an event, for example ondblClickRow, the grid's row
disappears.

``
name: jqgrid
table: friends
_id: friends
col_widths: 1,400
fields: id,name
col_width: 80
width: 400
height: 300
``:widget


``

jQuery("#jqgrid_friends").jqGrid({ ondblClickRow : function(rowid){
alert(rowid); } } );

``:template

The grid become like this one <http://yfrog.com/08schermata20100721a12165j>:


Has someone found a solution for that?


Thank you
-- 
Massimiliano


Re: [web2py] Re: plugin_jqgrid and events

2010-07-21 Thread Massimiliano
Massimo,

thank you for your fast reply.

unfortunately with setGridParm I get the same behavior.

What are your "best practice" to edit a record using jqgrid for selection?

Thank you and thank you again for you work.

Massimiliano

On Wed, Jul 21, 2010 at 1:59 PM, mdipierro  wrote:

> The jQuery(...).jqGrid is already called by the plugin. You cannot
> call it twice. I think you can use
>
> jQuery(...).setGridParam({...})
>
> to change grid parameters.
>
> On Jul 21, 6:39 am, Massimiliano  wrote:
> > Hi,
> >
> > I'm trying to play with cube2py, is amazing.
> >
> > I've a little problem with the jqgrid plugin, problem that didn't appears
> > using jqgrid standalone (declaring the grid in template and using json to
> > retrieve the data).
> >
> > When I try to set an event, for example ondblClickRow, the grid's row
> > disappears.
> >
> > ``
> > name: jqgrid
> > table: friends
> > _id: friends
> > col_widths: 1,400
> > fields: id,name
> > col_width: 80
> > width: 400
> > height: 300
> > ``:widget
> >
> > ``
> > 
> > jQuery("#jqgrid_friends").jqGrid({ ondblClickRow : function(rowid){
> > alert(rowid); } } );
> > 
> > ``:template
> >
> > The grid become like this one <
> http://yfrog.com/08schermata20100721a12165j>:
> >
> > Has someone found a solution for that?
> >
> > Thank you
> > --
> > Massimiliano
>



-- 
Massimiliano


[web2py] jqgrid header caption

2010-07-23 Thread Massimiliano
Hi,

I would to propose a little modify to use field.label as header caption in
plugin_jqgrid:

just replace the line:
colnames = [x.replace('_',' ').capitalize() for x in columns]

with
colnames = [table[c].label or c.replace('_',' ').capitalize() for c in
columns]



-- 
Massimiliano


[web2py] Create detail record

2010-07-23 Thread Massimiliano
Hi,

I'm sorry if it is a basic question but I don't find a clean way to do that.

Imagine I'm showing an Invoice with related rows.

How can I create a row and to assign automaticaly the invoice_id field in
the row record?

db.define_table(
'invoices',
Field('dateinvoice', 'date', default=now,label='Data')
...
)

db.define_table(
'invoice_rows',
Field('invoice_id', db.invoices)
...
)

Thank you
-- 
Massimiliano


Re: [web2py] Re: Create detail record

2010-07-23 Thread Massimiliano
Thank you.

So I need to do it manually...

row_id = db.invoice_rows.insert(invoce_id=my_invoice_id)


and after redirect to the edit page...

redirect(URL(r=request, f='edit', args=[row_id]))

I thought the was a way to pass the invoice_id to the SQLFORM...

Something like that:

form=SQLFORM(db.invoicesrows, invoice_id=my_invoice_id)



Thank you

Massimiliano

On Fri, Jul 23, 2010 at 4:34 PM, Vidul Petrov  wrote:

> You may want to read this part of the book:
> http://web2py.com/book/default/section/6/6?search=joins
>
> On Jul 23, 4:41 pm, Massimiliano  wrote:
> > Hi,
> >
> > I'm sorry if it is a basic question but I don't find a clean way to do
> that.
> >
> > Imagine I'm showing an Invoice with related rows.
> >
> > How can I create a row and to assign automaticaly the invoice_id field in
> > the row record?
> >
> > db.define_table(
> > 'invoices',
> > Field('dateinvoice', 'date', default=now,label='Data')
> > ...
> > )
> >
> > db.define_table(
> > 'invoice_rows',
> > Field('invoice_id', db.invoices)
> > ...
> > )
> >
> > Thank you
> > --
> > Massimiliano
>


Re: [web2py] Re: Create detail record

2010-07-23 Thread Massimiliano
Ok... It's friday :D

row_id = db.invoice_rows.insert(invoce_id=my_invoice_id)

form=SQLFORM(db.invoicesrows, row_id)




On Fri, Jul 23, 2010 at 4:51 PM, Massimiliano  wrote:

> Thank you.
>
> So I need to do it manually...
>
> row_id = db.invoice_rows.insert(invoce_id=my_invoice_id)
>
>
> and after redirect to the edit page...
>
> redirect(URL(r=request, f='edit', args=[row_id]))
>
> I thought the was a way to pass the invoice_id to the SQLFORM...
>
> Something like that:
>
> form=SQLFORM(db.invoicesrows, invoice_id=my_invoice_id)
>
>
>
> Thank you
>
> Massimiliano
>
>
> On Fri, Jul 23, 2010 at 4:34 PM, Vidul Petrov wrote:
>
>> You may want to read this part of the book:
>> http://web2py.com/book/default/section/6/6?search=joins
>>
>> On Jul 23, 4:41 pm, Massimiliano  wrote:
>> > Hi,
>> >
>> > I'm sorry if it is a basic question but I don't find a clean way to do
>> that.
>> >
>> > Imagine I'm showing an Invoice with related rows.
>> >
>> > How can I create a row and to assign automaticaly the invoice_id field
>> in
>> > the row record?
>> >
>> > db.define_table(
>> > 'invoices',
>> > Field('dateinvoice', 'date', default=now,label='Data')
>> > ...
>> > )
>> >
>> > db.define_table(
>> > 'invoice_rows',
>> > Field('invoice_id', db.invoices)
>> > ...
>> > )
>> >
>> > Thank you
>> > --
>> > Massimiliano
>>
>
>
>
>


-- 
Massimiliano


[web2py] Grouping fields

2010-10-24 Thread Massimiliano
Hello,

is there a simple way to group fields?

I have a big table with about 70 fields and I want to group them in the view
in some tabs.

How can I group them?

What I thought is to use table inheritance, so that I have my groups already
formed in "virtual" table defs and the db def is also more readable.

After that I will create containers directly in view via js/jquery.

Is there a better way?

Would be nice if we can add something in field defs so that SQLFORM can
group them directly :D

Thank you
-- 
Massimiliano


Re: [web2py] Re: new web2py appliance: File Manager

2010-11-04 Thread Massimiliano
Done.
Has been a good exercise.

How can I publish it?


-- 
Massimiliano

On Thu, Nov 4, 2010 at 2:22 AM, mdipierro  wrote:

> It should be easy to turn it into a plugin. Any takers?
>
> On Nov 3, 6:20 pm, yamandu  wrote:
> > Is there a way to integrate into my app?
> >
> > On Nov 3, 8:39 pm, mdipierro  wrote:
> >
> > > I just posted it. User Jeevan did it.
> >
> > > On Nov 3, 4:24 pm, Christopher Steel  wrote:
> >
> > > > Wow, this seems to work really well!
> >
> > > > Thanks!!! Great work
> >
> > > > On Nov 2, 6:09 pm, mdipierro  wrote:
> >
> > > > > This is CoreFive's Filemanager integrated with web2py. Also
> included
> > > > > ckeditor to edit text and html files.
> >
> > > > > Developed by Jeevan
> >
> > > > > License: BSD
> >
> > > > >http://web2py.com/appliances/default/show/70
> >
> >
>


[web2py:34859] Re: Join web2py wave

2009-11-08 Thread Massimiliano
I would love to receive an invite

Thank you
Massimiliano

On Sun, Nov 8, 2009 at 7:15 AM, Roger Gicquel wrote:

>
> +1 pls.
>
> On Nov 8, 4:37 am, DenesL  wrote:
> > I will take one. Thank you.
> >
> > On 7 nov, 16:08, Nicolás de la Torre  wrote:
> >
> > > Invited:
> >
> > > debe...@yahoo.com
> > > kuo...@gmail.com
> > > murxun...@googlemail.com
> > > jorgeh...@gmail.com
> >
> > > I have 5 invites left. Just ask.
>
> >
>


-- 
Massimiliano

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



[web2py:34944] Re: Join web2py wave

2009-11-09 Thread Massimiliano
thank you Richard :D

On Sun, Nov 8, 2009 at 10:29 PM, Richard  wrote:

>
> yeah! - can invite again.
>
> Have invited:
> denes1...@yahoo.ca
> roger.gicq...@gmail.com
> mbelle...@gmail.com
> whalb...@gmail.com
> debe...@yahoo.com
> digitalcry...@gmail.com
> maxu...@gmail.com
>
>
>
> On Nov 9, 2:35 am, Marat Maksumov  wrote:
> > I am very interested in receiving an invitation to Google Wave...
> >
> > On Nov 7, 10:44 am, Nicolás de la Torre  wrote:
> >
> >
> >
> > > i have sent invites to:
> >
> > > vinc...@vincentdavis.com
> > > thade...@thadeusb.com
> > > szims...@gmail.com
> > > boris.manojlo...@gmail.com
> > > richard_gor...@verizon.net
> > > chris.st...@gmail.com
> > > m.grit...@gmail.com
> > > lapcc...@gmail.com
> > > obutov...@googlemail.com
> >
> > > Pls tell me if someone is missing.
> >
>


-- 
Massimiliano

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



[web2py] jquery UI Widgets: wijmo

2010-12-10 Thread Massimiliano
Looks interesting

http://wijmo.com/

-- 
Massimiliano


[web2py] groupby in grid

2012-08-22 Thread Massimiliano
How groupby works in grid?

It seems that the query built include everytime the id field.

psycopg2.ProgrammingError: column "smsbytime.id" must appear in the GROUP
BY clause or be used in an aggregate function

db.define_table(
'smsbytime',
Field('year', 'integer'),
Field('month', 'integer'),
Field('day', 'integer'),
Field('hour', 'integer'),
Field('minute', 'integer'),
Field('nr', 'integer')
)


date_fields =
(db.smsbytime.year|db.smsbytime.month|db.smsbytime.day|db.smsbytime.hour)
sum = db.smsbytime.nr.sum()

grid = SQLFORM.grid(db.smsbytime.nr > 0,
fields=[db.smsbytime.year,
db.smsbytime.month,
db.smsbytime.day,
db.smsbytime.hour,
    sum],
groupby=date_fields,
orderby=date_fields
)


Thank you
-- 
Massimiliano

-- 





Re: [web2py] Numerical List of Entries

2012-09-10 Thread Massimiliano
Maybe this could be useful http://goo.gl/g61nt

On Mon, Sep 10, 2012 at 6:55 PM, AE  wrote:

> Hello I was wondering if anyone can tell me how I can create a numerical
> list of pages to use with my pagination
>
> I have a db query that selects alphabetically based on the title and would
> like to create a numerical index of the pages to link to. Currently I am
> using web2py_utils for pagination and it displays 10 per page pagination
> shouldn't matter cause it will just cycle through every entry.
>
> I was thinking more of how google does it in there search they display 1 2
> 3 4 5 6 up to 10 pages until you select 10 then it displays 11 12 13 etc :-)
>
> *cheers
>
> and ty for any help :-)
>
>
>  --
>
>
>
>



-- 
Massimiliano

-- 





[web2py] SQLTABLE, orderby and components

2012-09-14 Thread Massimiliano
Hi,

I'm trying to use SQLTABLE in components... Is there a way to make orderby
links to works in components?

It seems that miss an option to pass cid to orderby links.

I can copy SQLTABLE and make my own but is really a little change...

What do you think to add such option?

Thank you

-- 
Massimiliano

-- 





Re: [web2py] Re: SQLTABLE, orderby and components

2012-09-17 Thread Massimiliano
Just add an argument cid=None to SQLTABLE.__init__
and change line 2408-9

from
row.append(TH(A(headers.get(c, c),
_href=th_link+'?orderby=' + c)))

to
row.append(TH(A(headers.get(c, c),
_href=th_link+'?orderby=' + c,
cid=cid)))


Thank  you

On Fri, Sep 14, 2012 at 4:03 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Can you provide an example?
>
>
> On Friday, 14 September 2012 03:23:25 UTC-5, Massimiliano wrote:
>>
>> Hi,
>>
>> I'm trying to use SQLTABLE in components... Is there a way to make
>> orderby links to works in components?
>>
>> It seems that miss an option to pass cid to orderby links.
>>
>> I can copy SQLTABLE and make my own but is really a little change...
>>
>> What do you think to add such option?
>>
>> Thank you
>>
>> --
>> Massimiliano
>>
>  --
>
>
>
>



-- 
Massimiliano

-- 





Re: [web2py] Re: SQLTABLE, orderby and components

2012-09-17 Thread Massimiliano
Yes, my proposal was to add an arguments cid to sqltable.

I've attached a patch just to explain.

Thank you

On Mon, Sep 17, 2012 at 2:08 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> but there is no cid variable in sqlhtml.py. I am missing something? Can
> you send me a patch and I will try it?
>
>
> On Monday, 17 September 2012 03:39:30 UTC-5, Massimiliano wrote:
>
>> Just add an argument cid=None to SQLTABLE.__init__
>> and change line 2408-9
>>
>> from
>> row.append(TH(A(headers.get(c, c),
>> _href=th_link+'?orderby=' + c)))
>>
>> to
>> row.append(TH(A(headers.get(c, c),
>> _href=th_link+'?orderby=' + c,
>> cid=cid)))
>>
>>
>> Thank  you
>>
>> On Fri, Sep 14, 2012 at 4:03 PM, Massimo Di Pierro > > wrote:
>>
>>> Can you provide an example?
>>>
>>>
>>> On Friday, 14 September 2012 03:23:25 UTC-5, Massimiliano wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm trying to use SQLTABLE in components... Is there a way to make
>>>> orderby links to works in components?
>>>>
>>>> It seems that miss an option to pass cid to orderby links.
>>>>
>>>> I can copy SQLTABLE and make my own but is really a little change...
>>>>
>>>> What do you think to add such option?
>>>>
>>>> Thank you
>>>>
>>>> --
>>>> Massimiliano
>>>>
>>>  --
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Massimiliano
>>
>  --
>
>
>
>



-- 
Massimiliano

-- 





sqltable.diff
Description: Binary data


[web2py] Scheduler and legacy databases

2013-02-25 Thread Massimiliano
Hi,
I'm working on a legacy database where all boolean are mapped to 0, -1.

In my application I redefine adapter TRUE/FALSE as saw in this group.

In db.py:

db = DAL('postgres://postgres@127.0.0.1/logistica')  
import copy
db._adapter.types = copy.copy(db._adapter.types)
db._adapter.types['boolean']='SMALLINT'
db._adapter.TRUE = -1
db._adapter.FALSE = 0

Now I'm trying to use the scheduler but I found that running

./web2py.py-K logistica 

it doesn't take care (or it redefine to default 'F' and 'T') of my custom db
._adapter.FALSE and db._adapter.TRUE.

Is there something that I can do to help fixing that?

I think that to support custom boolean value is very important where 
working on legacy databases.

Thank you very much
 --
Massimiliano

-- 

--- 
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/groups/opt_out.




Re: [web2py] Scheduler and legacy databases

2013-03-08 Thread Massimiliano
The need of smallint as boolean is required for my application...
I don't knows if the word "legacy" is correct, I can't change the table
structure but I can insert and delete records...
In any case I expect that running ./web2py.py-K logistica it reads my db.py
and my defines.

What's happen if my scheduled task insert a record in the legacy table
where boolean need to be 0 or -1, but this task is in and enviroment
created by ./web2py.py-K logistica where boolean are F or T beacause it
don't take care of my defines in db.py?



On Fri, Mar 8, 2013 at 9:47 AM, Niphlod  wrote:

> deviating from the standards can be a pain, but if you set the migration
> off, change your column datatype outside web2py, the default typecasting
> would kick in and it should work anyway.
> PS: legacy db is where there are yet tables you can't change. The
> scheduler creates its own tables, so why the need for smallints as booleans
> ?
>
>
> On Friday, March 8, 2013 9:28:13 AM UTC+1, Massimiliano wrote:
>
>> Is there any chance to take a look on this problem?
>>
>> Thank you
>>
>>
>>
>> On Mon, Feb 25, 2013 at 7:42 PM, Massimiliano  wrote:
>>
>>> Hi,
>>> I'm working on a legacy database where all boolean are mapped to 0, -1.
>>>
>>> In my application I redefine adapter TRUE/FALSE as saw in this group.
>>>
>>> In db.py:
>>>
>>> db = 
>>> DAL('postgres://postgres@127.**0.0.1/logistica<http://postgres@127.0.0.1/logistica>
>>> ')
>>> import copy
>>> db._adapter.types = copy.copy(db._adapter.types)
>>>  db._adapter.types['boolean']='**SMALLINT'
>>>  db._adapter.TRUE = -1
>>>  db._adapter.FALSE = 0
>>>
>>> Now I'm trying to use the scheduler but I found that running
>>>
>>> ./web2py.py-K logistica
>>>
>>> it doesn't take care (or it redefine to default 'F' and 'T') of my
>>> custom db._adapter.FALSE and db._adapter.TRUE.
>>>
>>> Is there something that I can do to help fixing that?
>>>
>>> I think that to support custom boolean value is very important where
>>> working on legacy databases.
>>>
>>>  Thank you very much
>>>  --
>>> Massimiliano
>>>
>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> Massimiliano
>>
>  --
>
> ---
> 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/groups/opt_out.
>
>
>



-- 
Massimiliano

-- 

--- 
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/groups/opt_out.




Re: [web2py] Scheduler and legacy databases

2013-03-11 Thread Massimiliano
Thank you! That is a great hint!!




On Fri, Mar 8, 2013 at 11:04 AM, Niphlod  wrote:

> Ok, got it. it's not the scheduler's table you want with the booleans to
> work, it's the things the scheduler execute that needs to interact with
> some other tables in the environment...to be polite, that little hack you
> do is nice, but not "the recommended way" this is a case for your own
> custom adapter!
>
> ADAPTERS = {
> 'sqlite': SQLiteAdapter,
> 'sqlite:memory': SQLiteAdapter,
> 'mysql': MySQLAdapter,
> 'postgres': PostgreSQLAdapter,
> 'postgresmyown': MyOwnPostgreSQLAdapter,
> ..
> }
>
> class MyOwnPostgreSQLAdapter(PostgreSQLAdapter):
>
> # specify a diver to use
> drivers = ('psycopg2','pg8000')
> TRUE = 0
> FALSE = -1
>
> types = {
> 'boolean': 'smallint',
> 'string': 'VARCHAR(%(length)s)',
> 'text': 'TEXT',
> 'json': 'TEXT',
> 'password': 'VARCHAR(%(length)s)',
> 'blob': 'BYTEA',
> 'upload': 'VARCHAR(%(length)s)',
> 'integer': 'INTEGER',
> 'bigint': 'BIGINT',
> 'float': 'FLOAT',
> 'double': 'FLOAT8',
> 'decimal': 'NUMERIC(%(precision)s,%(scale)s)',
> 'date': 'DATE',
> 'time': 'TIME',
> 'datetime': 'TIMESTAMP',
> 'id': 'SERIAL PRIMARY KEY',
> 'reference': 'INTEGER REFERENCES %(foreign_key)s ON DELETE
> %(on_delete_action)s',
> 'list:integer': 'TEXT',
> 'list:string': 'TEXT',
> 'list:reference': 'TEXT',
>     'geometry': 'GEOMETRY',
> 'geography': 'GEOGRAPHY',
> 'big-id': 'BIGSERIAL PRIMARY KEY',
> 'big-reference': 'BIGINT REFERENCES %(foreign_key)s ON DELETE
> %(on_delete_action)s',
> }
>
> and then connect to it with
> db = DAL('postgresmyown://user:pass@host/database')
>
>
>
>
>  --
>
> ---
> 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/groups/opt_out.
>
>
>



-- 
Massimiliano

-- 

--- 
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/groups/opt_out.




[web2py] All app redirected to https

2012-10-23 Thread Massimiliano
Hi,
I found that with the last update, I'm using trunk, but it seems that also
the stable one behave the same, all apps are redirected to https.

Only admin, welcome and examples are correctly routed in http.

Is it my problem or it's a bug?
Thank you
-- 
Massimiliano

-- 





Re: [web2py] Re: All app redirected to https

2012-10-23 Thread Massimiliano
No I haven't custom routes and neither requires_https()

But it's strange... I've tried also with stable.
Browser cache cleaned...



On Tue, Oct 23, 2012 at 5:07 PM, Niphlod  wrote:

> I'm not seeing that behaviour both with stable or trunk. do you have
> requires_https() somewhere or some custom routes ?
>
>
> On Tuesday, October 23, 2012 4:36:24 PM UTC+2, Massimiliano wrote:
>>
>> Hi,
>> I found that with the last update, I'm using trunk, but it seems that
>> also the stable one behave the same, all apps are redirected to https.
>>
>> Only admin, welcome and examples are correctly routed in http.
>>
>> Is it my problem or it's a bug?
>> Thank you
>> --
>> Massimiliano
>>
>  --
>
>
>
>



-- 
Massimiliano

-- 





Re: [web2py] Re: All app redirected to https

2012-10-23 Thread Massimiliano
I don't understand what could be... 
A new installation give me the same problem... A simple python httpserver work 
as expected.. 

I've not router.py or routes.py in web2py folder and I never used 
requires_https()... What can I check?

Thank you
--
Massimiliano


Il giorno 23/ott/2012, alle ore 20:13, Bill Thayer  ha 
scritto:

> 2.2.1 stable seems to be going through http for me on Chrome. 
> -- 
>  
>  
>  

-- 





Re: [web2py] Re: All app redirected to https

2012-10-23 Thread Massimiliano
I've found the problem.

Was Auth(secure=True) that never had this behavior.. till now


On Tue, Oct 23, 2012 at 9:47 PM, Massimiliano  wrote:

> mbp:web2py max$ curl -l http://127.0.0.1:8000/m/default/index
> You are being redirected https://127.0.0.1:8000/m/default/index
> ">here
> mbp:web2py max$tail httpserver.log
> 127.0.0.1, 2012-10-23 21:45:46, GET, /m/default/index, HTTP/1.1, 303,
> 0.075703
>
>
>
> On Tue, Oct 23, 2012 at 8:41 PM, Niphlod  wrote:
>
>> check with curl or wget what headers the server returns...
>> curl -I http://oneofyourpages
>> or
>> wget --server-response --spider http://oneofyourpages
>>
>>
>> On Tuesday, October 23, 2012 8:19:17 PM UTC+2, Massimiliano wrote:
>>
>>> I don't understand what could be...
>>> A new installation give me the same problem... A simple python
>>> httpserver work as expected..
>>>
>>> I've not router.py or routes.py in web2py folder and I never used
>>> requires_https()... What can I check?
>>>
>>> Thank you
>>> --
>>> Massimiliano
>>>
>>>
>>> Il giorno 23/ott/2012, alle ore 20:13, Bill Thayer 
>>> ha scritto:
>>>
>>> 2.2.1 stable seems to be going through http for me on Chrome.
>>>
>>> --
>>>
>>>
>>>
>>>
>>>  --
>>
>>
>>
>>
>
>
>
> --
> Massimiliano
>



-- 
Massimiliano

-- 





[web2py] track_changes

2012-11-07 Thread Massimiliano
Version 2.2.1 (2012-11-06 14:26:21) stable

It's just me or it doesn't work anymore?

-- 
Massimiliano

-- 





Re: [web2py] Re: track_changes

2012-11-08 Thread Massimiliano
I filed a bug:
http://code.google.com/p/web2py/issues/detail?id=1128

and I posted a sample application.
I will put detail about my enviroment inside the issue.


On Thu, Nov 8, 2012 at 4:25 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Many have reported this problem but i cannot reproduce. Can you more about
> the environment and post a sample app?
>
> --
>
>
>
>


-- 
Massimiliano

-- 





Re: [web2py] Re: track_changes

2012-11-08 Thread Massimiliano
Massimo pointed me out in the right direction.

I was putting the tracking code in the wrong place.
I should be in the app and not in modules...




On Thu, Nov 8, 2012 at 4:39 PM, Massimiliano  wrote:

> I filed a bug:
> http://code.google.com/p/web2py/issues/detail?id=1128
>
> and I posted a sample application.
> I will put detail about my enviroment inside the issue.
>
>
> On Thu, Nov 8, 2012 at 4:25 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> Many have reported this problem but i cannot reproduce. Can you more
>> about the environment and post a sample app?
>>
>> --
>>
>>
>>
>>
>
>
> --
> Massimiliano
>



-- 
Massimiliano

-- 





Re: [web2py] invalid function (appadmin/graph_model)

2012-12-27 Thread Massimiliano
You need to copy welcome/controller/appadmin.py and
welcome/view/appadmin.html in your app or create a new app so that you have
the new appadmin .

Ciao


On Thu, Dec 27, 2012 at 11:13 AM, António Ramos wrote:

> I have latest web2py with graph model but when i click the button i get
>
> invalid function (appadmin/graph_model)
>
> --
>
>
>
>



-- 
Massimiliano

-- 





Re: [web2py] Re: utf-8 and pyfpdf

2012-01-01 Thread Massimiliano
Try this one:

euro = chr(128)

as euro char



On Sun, Jan 1, 2012 at 11:29 PM, Martin Weissenboeck wrote:

> Now I have found that I have to convert the string:
>
> txt = 'äöü ß ÄÖÜ'
> txt = txt.decode('utf-8').encode('latin-1','replace')
>
>
> This new string will be written correctly into the pdf-file.Is there a
> better way?
> No chance for the Euro-currency-symbol '€'
>
> Maybe there will be a full unicode characterset for pyfpdf in the future.
>
>
> 2012/1/1 Martin Weissenboeck 
>
>> Another question about pyfpdf:
>>
>> Is there any chance to get some more utf-8-characters?
>> (I have asked this some months ago).
>>
>> It seems, that pyfpdf only supports the basic ascii character set and no
>> latin-1-characters.
>> I want to use äöü ß ÄÖÜ €...and so on.
>>
>> Regards, Martin
>>
>>
>


-- 
Massimiliano


Re: [web2py] Re: Postgres: what am i doing wrong ?

2012-02-07 Thread Massimiliano
What do you expect to see in db.tables?

Tables defined in model(s) or tables on database?



On Tue, Feb 7, 2012 at 5:03 PM, Calycé wrote:

> Just tried it -> same results.
> FYI, I'm only using the interactive python shell to illustrate the
> problem I face I my app...
>
> On Feb 7, 4:56 pm, Michele Comitini 
> wrote:
> > python web2py/web2py.py -S courier
> >
> > add -M
> >
> > python web2py/web2py.py -S courier -M
> >
> > mic
> >
> > 2012/2/7 Calycé :
> >
> >
> >
> >
> >
> >
> >
> > > Hi all,
> >
> > > I'm starting a new project in which I'm using Postgresql, but I have
> > > some problems.
> > > I have defined a couple of tables in models/db.py. I can see and
> > > manipulate those tables through web2py's admin interface, but when I
> > > try to use DAL I'm facing some problems. I can connect without
> > > problem, but afterwards I can't  see nor access any tables.
> >
> > > Here's a copy of a python interactive session:
> > > (courier)[julie@landing courier]$ python web2py/web2py.py -S courier
> > > web2py Web Framework
> > > Created by Massimo Di Pierro, Copyright 2007-2011
> > > Version 1.99.3 (2011-12-09 16:18:03) stable
> > > Database drivers available: SQLite3, pymysql, PostgreSQL
> > > WARNING:web2py:import IPython error; use default python shell
> > > Python 2.7.2 (default, Jan 31 2012, 13:19:49)
> > > [GCC 4.6.2 20120120 (prerelease)] on linux2
> > > Type "help", "copyright", "credits" or "license" for more information.
> > > (InteractiveConsole)
> > >>>> db = DAL('postgres://postgres:@localhost/courier')
> > >>>> print db.tables
> > > []
> >
> > > As you can see, I apparently have no tables in my database but I can
> > > definitely see them in web2py's admin interface!
> > > Am I doing something wrong ?
> >
> > > Spec:
> > > Web2py: 1.99.3
> > > Postgres: 9.1.2
> > > Psycopg2: 2.4.4
>



-- 
Massimiliano


[web2py] Openldap and user_groups

2012-02-08 Thread Massimiliano
Hi,

I'm trying to login to our openldap server.

When a user login for the first time I got this error:

AttributeError: 'NoneType' object has no attribute 'user_groups'

in 

tools.py / update_groups
user_groups = self.user_groups = current.session.auth.user_groups = {}

Happen that current.session.auth is None 

If I comment current.session:
user_groups = self.user_groups = {} # = 
current.session.auth.user_groups = {}

login is working and user groups are created.

I'm missing something? 

Thank you
-- 
Massimiliano

[web2py] Re: Openldap and user_groups

2012-02-08 Thread Massimiliano
This options resolve the error:

*auth.settings.create_user_groups = False*


On Wed, Feb 8, 2012 at 1:22 PM, Massimiliano  wrote:

> Hi,
>
> I'm trying to login to our openldap server.
>
> When a user login for the first time I got this error:
> *
> *
> *AttributeError: 'NoneType' object has no attribute 'user_groups'*
>
> in
> *
> *
> *tools.py / update_groups*
> *user_groups = self.user_groups = current.session.auth.user_groups = {}*
>
> Happen that *current.session.auth* is *None*
>
> If I comment current.session:
> user_groups = self.user_groups = {} # =
> current.session.auth.user_groups = {}
>
> login is working and user groups are created.
>
> I'm missing something?
>
> Thank you
> --
> Massimiliano
>



-- 
Massimiliano


Re: [web2py] login next doesn't work Version 1.99.4 (2011-12-14 14:46:14) stable

2012-02-08 Thread Massimiliano
Same problem here

On Fri, Feb 3, 2012 at 5:12 PM, Tito Garrido  wrote:

> Hi Folks,
>
> I'm using login with ldap and login_next doesn't work...
>
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
>
> auth.settings.login_methods=[ldap_auth(mode='company',server='mycompany',base_dn='ou=myou,o=
> mycompany.com')]
>
> auth.settings.actions_disabled=['register','change_password','request_reset_password','profile']
> auth.settings.remember_me_form = False
> auth.settings.login_next = URL('default','get_ldapgroups')
>
> Is it expected? It just goes to index and doesn't care about my
> redirection...
>
> Regards,
>
> Tito
>
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>



-- 
Massimiliano


Re: [web2py] login next doesn't work Version 1.99.4 (2011-12-14 14:46:14) stable

2012-02-08 Thread Massimiliano
I've found that the problem could be in auth.navbar that doesn't take care
of auth.settings.login_next and logout_next.
I filed a bug and provided a patch.
http://code.google.com/p/web2py/issues/detail?id=652

give it a try



On Wed, Feb 8, 2012 at 10:08 PM, Ricardo Pedroso wrote:

> Hi,
>
> Try this:
>
> 1. Logout from you app.
> 2. delete all your sessions files in sessions folder. (if your are in
> a development environment)
> 3. Login again and see how the redirect behave.
>
> Ricardo
>
>
> On Wed, Feb 8, 2012 at 8:57 PM, Tito Garrido 
> wrote:
> > I don't know how I can debug it :-/
> >
> > On Wed, Feb 8, 2012 at 12:45 PM, Massimiliano 
> wrote:
> >>
> >> Same problem here
> >>
> >> On Fri, Feb 3, 2012 at 5:12 PM, Tito Garrido 
> >> wrote:
> >>>
> >>> Hi Folks,
> >>>
> >>> I'm using login with ldap and login_next doesn't work...
> >>>
> >>> from gluon.contrib.login_methods.ldap_auth import ldap_auth
> >>>
> >>>
> auth.settings.login_methods=[ldap_auth(mode='company',server='mycompany',base_dn='ou=myou,o=
> mycompany.com')]
> >>>
> >>>
> auth.settings.actions_disabled=['register','change_password','request_reset_password','profile']
> >>> auth.settings.remember_me_form = False
> >>> auth.settings.login_next = URL('default','get_ldapgroups')
> >>>
> >>> Is it expected? It just goes to index and doesn't care about my
> >>> redirection...
> >>>
> >>> Regards,
> >>>
> >>> Tito
> >>>
> >>>
> >>> --
> >>>
> >>> Linux User #387870
> >>> .
> >>>  _/_õ|__|
> >>> ..º[ .-.___.-._| . . . .
> >>> .__( o)__( o).:___
> >>
> >>
> >>
> >>
> >> --
> >> Massimiliano
> >
> >
> >
> >
> > --
> >
> > Linux User #387870
> > .
> >  _/_õ|__|
> > ..º[ .-.___.-._| . . . .
> > .__( o)__( o).:___
>



-- 
Massimiliano


Re: [web2py] Re: 1.99.4 Active Directory LDAP Issue

2012-02-23 Thread Massimiliano
try that:

auth.settings.create_user_groups = False

Ciao

On Thu, Feb 23, 2012 at 1:50 PM, Larry Wapnitsky  wrote:

> Getting the same error and just updated from the git repository.
>
> 10.102.50.37.2012-02-23.07-46-58.25a3ba02-828a-41d8-ae1d-daf22ab847df
>  'NoneType' object has no attribute
> 'user_groups'
>
>
> snippets from my db.py: (added to the original skeleton)
>
> ## create all tables needed by auth if not custom tables
> auth.define_tables(username=True)
>
> # all we need is login
>
> auth.settings.actions_disabled=['register','change_password','request_reset_password','retrieve_username','profile']
>
> # you don't have to remember me
> auth.settings.remember_me_form = False
>
> # ldap authentication and not save password on web2py
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
> auth.settings.login_methods = [ldap_auth(mode='ad',
>server='server.domain.com',
>base_dn='dc=domain,dc=com')]
>
>


-- 
Massimiliano


Re: [web2py] Re: About ldap_auth in 1.99.6

2012-03-03 Thread Massimiliano
Wow that's great!!

I tested both allowed_groups and managed_groups in opendladp and it work!!!

Thank you

-- 
Massimiliano


On Sat, Mar 3, 2012 at 8:57 AM, szimszon  wrote:

> If there is somebody using ldap_auth with AD please try to test
> allowed_groups and / or manage_groups as I have no means to test it. And I
> do not know differences between OpenLdap and AD regarding groups :(
>
> Tnx.
>
> 2012. március 2., péntek 22:30:37 UTC+1 időpontban szimszon a következőt
> írta:
>
>> Hi There!
>>
>> I tinkered a bit with ldap_auth.py and it's in 1.99.6 now.
>>
>> Now you can restrict login access based on ldap groups where the user is
>> a member
>> You need just to specify allowed_groups:
>>
>> auth.settings.login_methods.**append(ldap_auth(...as usual...,
>> allowed_groups = [...],
>> group_dn = 'ou=Groups,dc=domain,dc=com',
>> group_name_attrib = 'cn',
>> group_member_attrib = 'memberUid',
>> group_filterstr = 'objectClass=*'
>> ))
>>
>>
>> Where:
>> allowed_groups - a list with allowed ldap group names like 
>> ['admin','user']
>> group_dn - the ldap branch of the groups like 
>> "ou=Groups,dc=domain,dc=com"
>> group_name_attrib - the attribute where the group name is stored 
>> like "CN"
>> group_member_attrib - the attibute containing the group members name 
>> like "memberUid"
>> group_filterstr - as the filterstr but for group select
>>
>>
>> You can now manage auth_groups and auth_membership automatically. You
>> need to set manage_groups=True:
>>
>> auth.settings.login_methods.**append(ldap_auth(...as usual...,
>> manage_groups = True,
>> db = db,
>> group_dn = 'ou=Groups,dc=domain,dc=com',
>> group_name_attrib = 'cn',
>> group_member_attrib = 'memberUid',
>> group_filterstr = 'objectClass=*'
>> ))
>> Where:
>> manage_groups - let web2py handle the groups from ldap
>> db - is the database object (need to have auth_user, auth_group, 
>> auth_membership)
>> group_dn - the ldap branch of the groups like 
>> "ou=Groups,dc=domain,dc=com"
>> group_name_attrib - the attribute where the group name is stored 
>> like "cn"
>> group_member_attrib - the attibute containing the group members name 
>> like "memberUid"
>> group_filterstr - as the filterstr but for group select
>>
>>
>> If the user can log in then ldap_auth set up the corresponding groups and
>> memberships in app's db so RBAC can work properly and you don't have to set
>> group membership  in ldap and in app's db too.
>>
>> Ther "group_*" properties are shared by allowed_groups and manage_groups.
>>
>> Tested only with OpenLdap (I have no AD and co.)
>>
>


Re: [web2py] Re: web2py[:]

2012-03-05 Thread Massimiliano
Very nice work! I think it could be a booster for web2py community!

Congratulations


On Mon, Mar 5, 2012 at 8:25 PM, Omi Chiba  wrote:

> It looks great !!
>
>


-- 
Massimiliano


Re: [web2py] Installing PIL for creating thumbnails in windows7 environment

2012-03-13 Thread Massimiliano
Download the installer from PIL site:

http://www.pythonware.com/products/pil/


On Tue, Mar 13, 2012 at 12:25 PM, praveen krishna <
praveenchitne...@gmail.com> wrote:

> Hi,
>  I unable to install PIL in win for web2py .I came to know
>  some commands like ( sudo apt-get install python-imaging,sudo
> easy_install PIL and sudo pip install PIL)  but I think these are only
> applicable for linux environment if there is any possibility to install PIL
> in win it would be fine
>



-- 
Massimiliano


[web2py] SQLFORM.factory and Submit value

2011-09-07 Thread Massimiliano
Hi all,

I've a form generated by SQLFORM.factory

How do I change the Submit value to have a more explicative sentence?

Is there a way?

Thank you
-- 
Massimiliano


[web2py] Re: SQLFORM.factory and Submit value

2011-09-07 Thread Massimiliano
I've found the way :-)

form = SQLFORM.factory(
Field(...),
table_name=...,
submit_button='Your value'
)

Thank you

On Wed, Sep 7, 2011 at 5:16 PM, Massimiliano  wrote:

> Hi all,
>
> I've a form generated by SQLFORM.factory
>
> How do I change the Submit value to have a more explicative sentence?
>
> Is there a way?
>
> Thank you
> --
> Massimiliano
>



-- 
Massimiliano


Re: [web2py] Re: online book

2011-09-21 Thread Massimiliano
th_user'].append(Field('country'))
>> - validate_and_update, thanks Bruno
>> - new cpdb.py, thanks Mart
>> - field.represent = lambda value,record:  (record is optional)
>> - request.user_agent(), thanks Ross
>> - SQLFORM(...,separator=': ') now customizable
>> - experimental gluon/scheduler.py
>> - scripts/make_min_web2py.py
>> - crud.search has more options, thanks Denes
>> - gluon/contrib/simplejsonrpc.py
>> - gluon/contrib/redis_cache.py
>> - support for A(name,callback=url,target='id',delete='tr')
>> - support for A(name,component=url,target='id',delete='tr')
>> - isapiwsgihandler.py
>> - dal expression.coalesce(*options)
>> - new pip installer, thanks Chris Steel
>> - gluon/contrib/simplejsonrpc.py, thanks Mariano
>> - expire_sessions.py respects expiration time, thanks iceberg
>> - x509 support (needs rocket upgrade, thanks Michele)
>> - new syntax rows[i]('tablename.fieldname')
>> - new query syntax field.contains(list,all=True or False)
>> - new SQLFORM.grid and SQLFORM.smartgrid (should replace crud.search
>> and crud.select)
>> - support for natural language queries (english only) in SQLFORM.grid
>> - support for computed columns and additional links in SQLFORM.grid
>> - new style virtual fields (experimental):
>> db.table.field=Field.Lazy(...)
>> - request.utcnow
>> - cleaner/simpler welcome/models/db.py and welcome layout.html
>> - response.include_meta() and response.include_files(), thanks Denes
>> - dal auto-reconnect on time-out connections
>> - COL and COLGROUP helpers
>> - addresed OWASP #10, thanks Anthony and Eric
>> - auth.settings.login_after_registration=True
>> - detection of mobile devices and @mobilize helper (view.mobile.html),
>> thanks Angelo
>>
>
>


-- 
Massimiliano


Re: [web2py] Re: online book

2011-09-21 Thread Massimiliano
And for Chrome or safari is there a way?

On Wed, Sep 21, 2011 at 9:49 AM, Bruno Rocha  wrote:

> what browser?
>
> IN firefox you go to preferences > content > language and set en as the
> primary one.
>
>
> On Wed, Sep 21, 2011 at 4:40 AM, Massimiliano  wrote:
>
>> Stupid question.
>> Is there a way to get the english version of the book with the browser in
>> italian language? :-)
>>
>> Thank you
>>
>>
>> On Wed, Sep 21, 2011 at 6:17 AM, Ivica Kralj wrote:
>>
>>> Wow, Impressive list... more features to play with... This is going to be
>>> great :)
>>>
>>> Thanks all
>>>
>>>
>>> On 20 September 2011 23:17, Massimo Di Pierro <
>>> massimo.dipie...@gmail.com> wrote:
>>>
>>>> List of new features NOT yet documented in the book. I think:
>>>>
>>>>
>>>> - LICENSE CHANGE FROM GPLv2 to LGPLv3
>>>> - new URL syntax
>>>> - new T behavior
>>>> - new app level logging with logging.conf (thanks Jonathan)
>>>> - Polymmodel support on GAE
>>>> - current
>>>> - added pyfpdf, thank Mariano
>>>> - db(db.table), db(db.table.id) both suported and equivalent to
>>>> db(db.table.id>0)
>>>> - IS_DECIMAL_IN_RANGE and IS_FLOAT_IN_RANGE support dot="," (dot="."
>>>> is default)
>>>> - on_failed_authorization can be a function, thanks Niphold
>>>> - new layout for examples, thanks Bruno and Martin
>>>> - admin allow ``DEMO_MODE=True`` and ``FILTER_APPS=['welcome']``
>>>> - upgraded to anytime
>>>> - new admin wizard
>>>> - better mercual admin allows list of files, versions and retrieve
>>>> - SQLFORM.accepts(detect_record_change).record_changed
>>>> - SQLFORM.process()
>>>> - new admin layout (thanks Branko Vukelic)
>>>> - new Welcome app (thanks Martin Mulone)
>>>> - web2py.py -J for running cron (thanks Jonathan Lundell)
>>>> - web2py.py -K for running backgournd tasks
>>>> - new DAL (complete rewrite of the web2py DAL is more modular)
>>>> - better CAS with v2 support, thanks Olivier ROCH VILATO
>>>> - session.connect(separate=True) to handle many session files, thanks
>>>> huaiyu wang
>>>> - changed bahvior of impersonate (more secure, can generate form or
>>>> used as API)
>>>> - SQLTABLE(...,headers='labels') thanks Bruno
>>>> - optional: digitally signed URLs, thanks Brian Meredyk
>>>> - web2py comet via gluon/contrib/comet_messaging.py (html5 websockets)
>>>> experimental
>>>> - customizable uploadwidget, thanks Fran
>>>> - admin has MULTI_USER_MODE (admin/models/0.py)
>>>> - support for count(distinct=...)
>>>> - IS_MATCH(...,strict=True)
>>>> - URL(...,scheme=,host=,port=), thanks Jonathan
>>>> - auth.signature (experimental)
>>>> - combined expressions print db.data.body.len().sum()
>>>> - wizard can download plugins
>>>> - moderniz 1.17
>>>> - experimental REST API
>>>> - added experimental pip support, thanks Lifeeth
>>>> - added experimental SAP DB support
>>>> - Google MySQL support (experimental)
>>>> - DAL(...,migrate_enabled=True)
>>>> - login_methods/loginza.py, thanks Vladimir
>>>> - bpython shell support, thanks Arun
>>>> - response.toolbar()
>>>> - db._timings contains database query timing info
>>>> - efficient db(...).isempty()
>>>> - setup-web2py-nginx-uwsgi-ubuntu.sh
>>>> - "from gluon import *"
>>>> - conditional models in models//a.py and models/
>>>> //a.py
>>>> - from mymodule import *
>>>> - generic views
>>>> - all applications have cas 2.0 provider at http://.../user/cas/login
>>>> - all applications can delegate to login to external provider
>>>> Auth(...,cas_provider='http://.../other_app/default/user/cas'\
>>>> )
>>>> - A(...,callback=URL(...),larget='id') does Ajax
>>>> - URL(...,user_signature=True), LOAD(...,user_signature=True)
>>>> - DAL(...,migrate_enabled=False) to disable all migrations
>>>> - DAL(...,fake_migrate_all=True) to rebuild all corrupted metadata
>>>> - DAL(...,adapter_arg={}) allows support for alternate drivers
>>>> - DAL now allows circular table defintions
>>>> - DAL(..,auto

Re: [web2py] Re: online book

2011-09-21 Thread Massimiliano
Ok found for Chrome:

Preferenze->Roba da smanettoni->Impostazioni di lingua e controllo
ortografico

Thank you for the tip


On Wed, Sep 21, 2011 at 9:51 AM, Massimiliano  wrote:

> And for Chrome or safari is there a way?
>
>
> On Wed, Sep 21, 2011 at 9:49 AM, Bruno Rocha wrote:
>
>> what browser?
>>
>> IN firefox you go to preferences > content > language and set en as the
>> primary one.
>>
>>
>> On Wed, Sep 21, 2011 at 4:40 AM, Massimiliano wrote:
>>
>>> Stupid question.
>>> Is there a way to get the english version of the book with the browser in
>>> italian language? :-)
>>>
>>> Thank you
>>>
>>>
>>> On Wed, Sep 21, 2011 at 6:17 AM, Ivica Kralj wrote:
>>>
>>>> Wow, Impressive list... more features to play with... This is going to
>>>> be great :)
>>>>
>>>> Thanks all
>>>>
>>>>
>>>> On 20 September 2011 23:17, Massimo Di Pierro <
>>>> massimo.dipie...@gmail.com> wrote:
>>>>
>>>>> List of new features NOT yet documented in the book. I think:
>>>>>
>>>>>
>>>>> - LICENSE CHANGE FROM GPLv2 to LGPLv3
>>>>> - new URL syntax
>>>>> - new T behavior
>>>>> - new app level logging with logging.conf (thanks Jonathan)
>>>>> - Polymmodel support on GAE
>>>>> - current
>>>>> - added pyfpdf, thank Mariano
>>>>> - db(db.table), db(db.table.id) both suported and equivalent to
>>>>> db(db.table.id>0)
>>>>> - IS_DECIMAL_IN_RANGE and IS_FLOAT_IN_RANGE support dot="," (dot="."
>>>>> is default)
>>>>> - on_failed_authorization can be a function, thanks Niphold
>>>>> - new layout for examples, thanks Bruno and Martin
>>>>> - admin allow ``DEMO_MODE=True`` and ``FILTER_APPS=['welcome']``
>>>>> - upgraded to anytime
>>>>> - new admin wizard
>>>>> - better mercual admin allows list of files, versions and retrieve
>>>>> - SQLFORM.accepts(detect_record_change).record_changed
>>>>> - SQLFORM.process()
>>>>> - new admin layout (thanks Branko Vukelic)
>>>>> - new Welcome app (thanks Martin Mulone)
>>>>> - web2py.py -J for running cron (thanks Jonathan Lundell)
>>>>> - web2py.py -K for running backgournd tasks
>>>>> - new DAL (complete rewrite of the web2py DAL is more modular)
>>>>> - better CAS with v2 support, thanks Olivier ROCH VILATO
>>>>> - session.connect(separate=True) to handle many session files, thanks
>>>>> huaiyu wang
>>>>> - changed bahvior of impersonate (more secure, can generate form or
>>>>> used as API)
>>>>> - SQLTABLE(...,headers='labels') thanks Bruno
>>>>> - optional: digitally signed URLs, thanks Brian Meredyk
>>>>> - web2py comet via gluon/contrib/comet_messaging.py (html5 websockets)
>>>>> experimental
>>>>> - customizable uploadwidget, thanks Fran
>>>>> - admin has MULTI_USER_MODE (admin/models/0.py)
>>>>> - support for count(distinct=...)
>>>>> - IS_MATCH(...,strict=True)
>>>>> - URL(...,scheme=,host=,port=), thanks Jonathan
>>>>> - auth.signature (experimental)
>>>>> - combined expressions print db.data.body.len().sum()
>>>>> - wizard can download plugins
>>>>> - moderniz 1.17
>>>>> - experimental REST API
>>>>> - added experimental pip support, thanks Lifeeth
>>>>> - added experimental SAP DB support
>>>>> - Google MySQL support (experimental)
>>>>> - DAL(...,migrate_enabled=True)
>>>>> - login_methods/loginza.py, thanks Vladimir
>>>>> - bpython shell support, thanks Arun
>>>>> - response.toolbar()
>>>>> - db._timings contains database query timing info
>>>>> - efficient db(...).isempty()
>>>>> - setup-web2py-nginx-uwsgi-ubuntu.sh
>>>>> - "from gluon import *"
>>>>> - conditional models in models//a.py and models/
>>>>> //a.py
>>>>> - from mymodule import *
>>>>> - generic views
>>>>> - all applications have cas 2.0 provider at http://.../user/cas/login
>>>>> - all applications can delegate to login to external provider
>>>>> Auth(...,cas_pro

Re: [web2py] Can't use len() on db.select results? Can this be so?

2011-09-22 Thread Massimiliano
maybe:
len(supplier_contact_list)==1

On Thu, Sep 22, 2011 at 3:15 PM, Cliff  wrote:

> Is this the way it's supposed to work, or have I created a subtle bug?
>
> Here is the code snippet:
>
>  supplier_contact_list = db(db.supplier_contacts.supplier_id==
>supplier_id).select(
>db.supplier_contacts.first_name,
> db.supplier_contacts.middle_name,
>db.supplier_contacts.last_name,
> db.supplier_contacts.generation)
>print db._lastsql
>if not supplier_contact_list:
>contact_string = 'This supplier has no contact.'
>elif len(supplier_contact_list==1):  ## Exception gets raised on
> this line
>## do stuff
>
> It raises this exception:
> TypeError: object of type 'bool' has no len()
>
> Here is the SQL that rockit prints:
> SELECT  supplier_contacts.first_name, supplier_contacts.middle_name,
> supplier_contacts.last_name, supplier_contacts.generation FROM
> supplier_contacts WHERE (supplier_contacts.supplier_id = 1);
>
> I can work around this using db().count(), but it's an extra database
> hit and makes the code verbose.




-- 
Massimiliano


Re: [web2py] web2py with twitter bootstrap - very clean interface ...

2011-09-26 Thread Massimiliano
Very nice interface...

On Mon, Sep 26, 2011 at 8:10 AM, David Marko  wrote:

> http://labs.blouweb.com/bootstrap/default/index
>

-- 
Massimiliano


Re: [web2py] Re: web2py with twitter bootstrap - very clean interface ...

2011-09-26 Thread Massimiliano
Now that I realized what you have done I can say that is really a nice work.
:-)

On Mon, Sep 26, 2011 at 9:32 PM, Anaconda  wrote:

> Nice work, i struggled getting it to work, but i did get it to kind of
> work well. Is there any issue that you ran into that you could give us
> a heads up about?
>
>
> > > --
> > > Massimiliano
> >
> > --
> > Alvaro Lizama Molina  -http://alvarolizama.net
>



-- 
Massimiliano


Re: [web2py] smartgrid: currency format

2011-09-28 Thread Massimiliano
Is there a reason that you want to format on the grid?

 because you can do it in field.represent:

db.yourtable.yourfield = lambda value, row: '$ %.2f' % (0.0 if value == None
else value)


On Wed, Sep 28, 2011 at 4:48 PM, Omi Chiba  wrote:

> Can we format 500.00 to $500.00 on smartgrid ?




-- 
Massimiliano


Re: [web2py] Re: smartgrid: currency format

2011-09-28 Thread Massimiliano
This one should work...

db.Product.List_Price.represent = lambda value, row: DIV('€ %.2f' % (0.0
if value == None else value), _style='text-align: right;')

On Wed, Sep 28, 2011 at 6:26 PM, Omi Chiba  wrote:

> It's smartgrid so nothing really in default.py.
>
> just this one.
>
> def admin():
>products = SQLFORM.grid(db.Product,deletable=False, paginate=10)
>return dict(products = products)
>
> This is my table.
> db.define_table('Product',
>Field('Part_Number'),
>Field('List_Price', 'decimal(13,2)'))
>
>
> On Sep 28, 11:08 am, Jim Steil  wrote:
> > Can you post the relevant code from default.py?
> >
> >  -Jim
> >
> > On 9/28/2011 11:02 AM, Omi Chiba wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Jim,
> >
> > > close but I got a following error.
> >
> > > Traceback (most recent call last):
> > >File "/home/www-data/web2py/gluon/restricted.py", line 194, in
> > > restricted
> > >  exec ccode in environment
> > >File "/home/www-data/web2py/applications/pricelist/controllers/
> > > default.py", line 95, in
> > >  @auth.requires_signature()
> > >File "/home/www-data/web2py/gluon/tools.py", line 2494, in
> > > requires_signature
> > >  return
> > > self.requires(URL.verify(current.request,user_signature=True))
> > >File "/home/www-data/web2py/gluon/html.py", line 352, in verifyURL
> > >  hmac_key = current.session.auth.hmac_key
> > > AttributeError: 'NoneType' object has no attribute 'hmac_key'
> >
> > > On Sep 28, 10:48 am, Jim Steil  wrote:
> > >> untested
> >
> > >> db.Product.List_Price.represent = lambda value, row: XML(DIV('$ %.2f'
> % (0.0 if value == None else value),_style='text-align: right;'))
> >
> > >> On 9/28/2011 10:42 AM, Omi Chiba wrote:
> >
> > >>> Um, actually one more question.
> > >>> Now I have two represent and riht now either one of them work but not
> > >>> both. How I can combine them together ??
> > >>> # Currency format
> > >>> db.Product.List_Price.represent = lambda value, row: '$ %.2f' % (0.0
> > >>> if value == None else value)
> > >>> # text-align: right
> > >>> db.Product.List_Price.represent = lambda value, row:
> > >>> XML(DIV(value,_style='text-align: right;'))
> > >>> On Sep 28, 10:37 am, Omi Chibawrote:
> > >>>> Wow ! This is what I want.
> > >>>> Thanks !!
> > >>>> On Sep 28, 9:53 am, Massimilianowrote:
> > >>>>> Is there a reason that you want to format on the grid?
> > >>>>>because you can do it in field.represent:
> > >>>>> db.yourtable.yourfield = lambda value, row: '$ %.2f' % (0.0 if
> value == None
> > >>>>> else value)
> > >>>>> On Wed, Sep 28, 2011 at 4:48 PM, Omi Chiba
>  wrote:
> > >>>>>> Can we format 500.00 to $500.00 on smartgrid ?
> > >>>>> --
> > >>>>> Massimiliano
>



-- 
Massimiliano


Re: [web2py] Dynamic Model

2011-09-30 Thread Massimiliano
I'm very interested on dynamic model and I'm investigating a little bit.

I've had some results with this model.

The user can define compound models. Types are ancestor types (string, 
integer etc) useful for representation


db.define_table(
'types',
Field('type', 'string'),
format='%(type)s'
)

db.define_table(
'models',
Field('name', 'string'),
format='%(name)s'
)

db.define_table(
'models_tree',
Field('parent', 'reference models'),
Field('child', 'reference models'),
Field('display_order', 'integer')
)

db.define_table(
'fields',
Field('name', 'string'),
Field('label', 'string'),
Field('model', 'reference models'),
Field('type', 'reference types'),
Field('display_order', 'integer'),
format='%(name)s'
)

#db.fields.type.requires=IS_IN_DB(db, db.types)

db.define_table(
'rows',
Field('model', 'reference models'),
Field('note', 'text')
)

db.define_table(
'meta',
Field('field', 'reference fields'),
Field('row', 'reference rows'),
Field('value', 'text')
)

db.meta.field.requires=IS_IN_DB(db, db.fields)
db.meta.row.requires=IS_IN_DB(db, db.rows)

def get_models():
query = (db.fields.type == db.types.id) & (db.fields.model == 
db.models.id)

return db(query).select()

models = lambda : get_models()

def get_tree():
parents = db.models.with_alias('parents')
childs = db.models.with_alias('childs')
query = ((db.models_tree.parent == db.models.id) & (db.models_tree.child 
== childs.id))
sql = """
SELECT 
parents.name, 
childs.name 
FROM 
models as parents, 
models as childs, 
models_tree 
WHERE 
models_tree.parent = parents.id AND
models_tree.child = childs.id;
"""

return db.executesql(sql)

def get_fields_from_parent_model(parent_id):
query = db.models_tree.parent == parent_id
models = db(query).select(orderby=db.models_tree.display_order)
fields = []
if models:
for m in models:
fields += get_fields_from_parent_model(m.child)
else:
fields = [r for r in 
db(db.fields.model==parent_id).select(orderby=db.fields.display_order)]
return fields

tree = lambda : get_tree()


def build_query(model_id):
fields = get_fields_from_parent_model(model_id)

_select_tpl = "\t%(name)s.value as %(name)s"
_from_tpl = "\t\tJOIN meta %(name)s ON (%(name)s.row = rows.id AND 
%(name)s.field = %(id)s)"

_select = ["rows.id as id"] 
_from = [" FROM", "\tmodels, ", "\trows"]

for f in fields:
f.name = f.name.replace(" ", "_")
_select.append( _select_tpl % f)
_from.append( _from_tpl % f)
select = 'SELECT '
select += ", ".join(_select)
frm = "\n".join(_from)
#where = " WHERE rows.id = %s;" % row_id 
where = " WHERE rows.model = models.id AND models.id = %s" % model_id
sql = select + frm + where
print sql 
rows = db.executesql( sql )
return rows


[web2py] Duplicate record with details

2011-10-04 Thread Massimiliano
I've a doc with detail rows related.

I want to duplicate the doc and all details related.
I'm trying something like that but it doesn't work:

doc.id = 0
details = doc.details.select()
doc.update_record()
for detail in details:
detail.id = 0
detail.iddoc = doc.id
detail.update_record()

What is the right way?
Thank you

-- 
Massimiliano


Re: [web2py] Re: Duplicate record with details

2011-10-04 Thread Massimiliano
Thank you Massimo.

On Tue, Oct 4, 2011 at 3:36 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> try this instead
>
>  details = doc.details.select()
>  db.doc.insert(db.doc._filter_fields(**dict(doc)) for
> detail in details: detail.id = 0 detail.iddoc
> = doc.id
> db.detail.insert(db.doc._filter_fields(**dict(detail))
>
> On Oct 4, 8:04 am, Massimiliano  wrote:
> > I've a doc with detail rows related.
> >
> > I want to duplicate the doc and all details related.
> > I'm trying something like that but it doesn't work:
> >
> > doc.id = 0
> > details = doc.details.select()
> > doc.update_record()
> > for detail in details:
> > detail.id = 0
> > detail.iddoc = doc.id
> >     detail.update_record()
> >
> > What is the right way?
> > Thank you
> >
> > --
> > Massimiliano
>



-- 
Massimiliano


Re: [web2py] logged in user

2011-10-07 Thread Massimiliano
Take a look at the table auth_events

--
Massimiliano


Il giorno 07/ott/2011, alle ore 14:34, Web2Py Freak 
 ha scritto:

> Dear All ,
> 
> How Can I get the name of the user who is logged in my website ??


[web2py] Grid and links

2011-10-10 Thread Massimiliano
I like the new grid/smartgrid a lot, but when you have many linked tables
the grid appears a little bit cluttered.

What do you think of an option that hide all links/buttons (but not detail
button) from the grid, but show them on the detail view?

Thank you
-- 
Massimiliano


Re: [web2py] Re: Grid and links

2011-10-10 Thread Massimiliano
Thank you Massimo, I'm aware of that.

I was just looking for a way to show all "buttons" but "detail" only in the
detail view (the one generated from the grid) and not in the table view.

--
Massimiliano

On Mon, Oct 10, 2011 at 3:58 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> def grid(query, fields=None, field_id=None,
>  left=None, headers={}, columns=None,
>orderby=None, searchable=True,
>  sortable=True, paginate=20, deletable=True,
>editable=True, details=True,
>  selectable=None, create=True, csv=True,
>links=None, upload = '',
>  args=[], user_signature = True,
>  maxtextlengths={}, maxtextlength=20,
>  onvalidation=None, oncreate=None,
>  onupdate=None, ondelete=None,
> sorter_icons=('[^]','[v]'),
> ui = 'web2py',
> showbuttontext=True,
> _class="web2py_grid",
> formname='web2py_grid',
> search_widget='default',
>)
>
> Many of the options are True/False and you can switch them off.
>
> The smartgrid has the same arguments but they are dictionaries for
> example:
>
> SQLFORM.grid(db.mytable, editable=False)
> SQLFORM.smartgrid([db.mytable], editable = {'mytable',False})
>
>
>
>
>
>
> On Oct 10, 8:52 am, Massimiliano  wrote:
> > I like the new grid/smartgrid a lot, but when you have many linked tables
> > the grid appears a little bit cluttered.
> >
> > What do you think of an option that hide all links/buttons (but not
> detail
> > button) from the grid, but show them on the detail view?
> >
> > Thank you
> > --
> > Massimiliano
>



-- 
Massimiliano


Re: [web2py] Attaching a file to a mail

2011-11-22 Thread Massimiliano
remove response.headers['Content-**Type']='application/pdf'

f.render(filename, dest='F')

Ciao

2011/11/22 Kenneth Lundström 

> Hello,
>
> in our web2py based billing application we generate PDF:s that are sent to
> customers. So far I have always saved the PDF onto my local computer and
> attached that to a mail.
>
> Now I'd like to develop the app so I could send the bill directly from the
> app.
>
> When the PDF is created it is shown in the browser with these two rows.
>
>response.headers['Content-**Type']='application/pdf'
>return f.render('invoice.pdf', dest='S')
>
> This is probably a pypdf question but I was hoping somebody can help me.
>
> I guess that the pyfpdf should be written to the servers harddisk and when
> the mail is created it picks up the file.
>
> Anybody done anything like this?
>
>
> Kenneth
>



-- 
Massimiliano


[web2py] Postgresql database schema

2011-05-30 Thread Massimiliano
Hi all,

I've a legacy enterprise application that use postgresql as database.

Existing tables are divided on different database schemas (not only public).

Now I want to rewrite a single application that use existing tables on
schema "xyz".

Does web2py support that?

Thank you
-- 
Massimiliano


Re: [web2py] Re: Postgresql database schema

2011-05-31 Thread Massimiliano
Sure... That is the way I'm follow...
Fortunately I haven't tables with the same name...

Ciao

On Tue, May 31, 2011 at 3:50 AM, Mathew Grabau  wrote:

> You could always change the schema before executing the db commands:
>
> db.executesql("set search_path to 'schemaname,public';")
>
> If you could determine the name of the schema first that would be
> feasible.
>
> On May 30, 5:14 am, Massimiliano  wrote:
> > Hi all,
> >
> > I've a legacy enterprise application that use postgresql as database.
> >
> > Existing tables are divided on different database schemas (not only
> public).
> >
> > Now I want to rewrite a single application that use existing tables on
> > schema "xyz".
> >
> > Does web2py support that?
> >
> > Thank you
> > --
> > Massimiliano
>



-- 
Massimiliano


Re: [web2py] web2py and postgresql schema

2011-06-25 Thread Massimiliano
I've the same problem.
Take a look here.

http://groups.google.com/group/web2py/browse_thread/thread/8b5e166b7b27edc7?pli=1


On Fri, Jun 24, 2011 at 3:11 PM, Camil Ghircoias
wrote:

> Hi,
>
> I am now reading some documnentation about web2py.
> Does web2py support postgresql schemas ?
> I have my tables grouped in postgresql into scheme inside same
> database.
> So I can have same tables into the same databases but in different
> schemas.
>
> Like
>
> schema1.mytable
> schema2.mytable
>
> How can I work with web2py without renaming tables or changing the
> database logic ?
>
> I write here because on internbet there was not a clear answer if you
> can work with it or not.
>


Ciao
-- 
Massimiliano


[web2py] OffTopic Google+

2011-07-01 Thread Massimiliano
Anyone interested?
Mail me privately

Ciao
-- 
Massimiliano


[web2py] SQLFORM.factory tablename doesn't affect submit row

2011-07-01 Thread Massimiliano
>From something like that:

   form = SQLFORM.factory(
Field('mydate', 'date', label='Data carico', requires=IS_DATE()),
table_name='mytable',
_id = 'myform'
)


I got:

[...]
...

[...]

The submit row doesn't take the tablename
Is it normal?

-- 
Massimiliano


Re: [web2py] XMPP chat client

2011-08-17 Thread Massimiliano
Take a look if that can help you.

http://thp.io/2007/python-jabberbot/

On Tue, Aug 16, 2011 at 9:52 PM, Fernando Macedo  wrote:

> Hello all,
>
> I'm trying to figure out how to implement a xmpp chat bot to run some
> intranet queries and return those data. Like add the bot as friend on Google
> Talk, and ask him a 'list employees' command.
>
> I'd like to use the built-in server (not in gae).
>
> Is there an easy way to get this working?
>
> Can anyone suggest me the first steps or some reference? I've also googled
> it, but I don't know much about de xmpp protocol itself.
>
>
> Thanks in advance,
>
> Fernando Macedo
>
> "Somos o que repetidamente fazemos; a excelência, portanto, não é um feito,
> mas sim um hábito!" - Aristóteles
>



-- 
Massimiliano


[web2py] auth on cas and consume data from some apps

2016-05-17 Thread Massimiliano
Hello,

I've a system composed of some apps sharing auth on *cas*.

I would like that app A could get json data from app B but it seems not 
possibile if the user doesn't login in each app before.

Jus to to clarify.

Timeline.

1. User login on app A
2. App A try to get data from app B but He got "Insufficient privileges" or 
nothing. It depends from the decorator used. 

but if

1. User login on app A
2. User login on app B
3. App A try to get data from app B all is working well


I tried to decorate le app B controller function with
@auth.requires_signature() 
setting properly user_signature=True in the URL()
and I get "Insufficient privileges"

and with 
@auth.requires_login()
and I get nothing

Is possibile to get what I want?

Thank you

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


Re: [web2py] auth on cas and consume data from some apps

2016-05-17 Thread Massimiliano
Another timeline that clarify the situation.

with @auth.requires_login()

1. User login on app A
2. User follow the link on app B/function_decorated
3. App A try to get data from app B all is working well

Thank you

On Tue, May 17, 2016 at 11:34 AM, Massimiliano  wrote:

> Hello,
>
> I've a system composed of some apps sharing auth on *cas*.
>
> I would like that app A could get json data from app B but it seems not
> possibile if the user doesn't login in each app before.
>
> Jus to to clarify.
>
> Timeline.
>
> 1. User login on app A
> 2. App A try to get data from app B but He got "Insufficient privileges"
> or nothing. It depends from the decorator used.
>
> but if
>
> 1. User login on app A
> 2. User login on app B
> 3. App A try to get data from app B all is working well
>
>
> I tried to decorate le app B controller function with
> @auth.requires_signature()
> setting properly user_signature=True in the URL()
> and I get "Insufficient privileges"
>
> and with
> @auth.requires_login()
> and I get nothing
>
> Is possibile to get what I want?
>
> Thank you
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Massimiliano

-- 
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] SQL query to web2py code

2016-06-09 Thread Massimiliano
Try to print the sql generated from web2py:

print db(db.ntw_edge.outID==1147)._select(left=db.ntw_edge.on(db.
ntw_edge.inID==alias_edge.outID))

On Thu, Jun 9, 2016 at 10:10 AM, 'Annet' via web2py-users <
web2py@googlegroups.com> wrote:

> I have the following SQL query (in Postgresql):
>
>
> SELECT ntw_edge.outid, ntw_edge.inid, ntw_edge.label, alias_edge.inid,
> alias_edge.outid, alias_edge.label
> FROM ntw_edge
> LEFT OUTER JOIN ntw_edge AS alias_edge
> ON ntw_edge.inid=alias_edge.outid
> WHERE ntw_edge.outid=1147;
>
>
> In web2py I have:
>
> def retrieve_edge():
> alias_edge = db.ntw_edge.with_alias('alias_edge')
> rows =
> db(db.ntw_edge.outID==1147).select(left=db.ntw_edge.on(db.ntw_edge.inID==alias_edge.outID))
> return dict(rows=rows)
>
>
> The SQL query returns the right records:
>
> 1147549registered1147549registered
> 1147  1149registered
>
> The web2py query returns only 1 record:
>
> 1147549registered1147549registered
>
>
> Why doesn't the web2py query return the correct result?
>
>
> 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.
>



-- 
Massimiliano

-- 
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] I am trying to change the background image every 5 seconds like this but this doesn't seem to work?

2016-06-13 Thread Massimiliano
In *k* you have strings like “URL(‘static’,’images/1.jpg’)” not the URL
func result.

Try something like that:

def retimage():
from random import randint
i=randint(0,2)
return URL(‘static’,’images/%d.jpg’ % (i))



On Mon, Jun 13, 2016 at 11:30 AM, Emmanuel Dsouza 
wrote:

> CONTROLLER:
>
> def retimage():
>
> k=["URL('static','images/1.jpg')","URL('static','images/2.jpg')","URL('static','images/3.jpg')"]
> from random import randint
> i=randint(0,2)
> return k[i]
> def index():
> return locals()
>
> VIEW:
>
> {{extend 'layout.html'}}
> 
> window.setInterval(function(){
> {{getimage=retimage()}}
>   document.body.background = url("{{=getimage}}");
> }, 5000);
> 
> 
>
> How should I correct this?
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] I am trying to change the background image every 5 seconds like this but this doesn't seem to work?

2016-06-13 Thread Massimiliano
You can’t call directly a function defined in controller…

Try to define retimage in a model file.
It should work.



On Mon, Jun 13, 2016 at 11:53 AM, Emmanuel Dsouza 
wrote:

> My update code:
>
> def retimage():
> from random import randint
> i=randint(0,2)
> return URL('static','images/%d.jpg' %(i))
> def index():
>
> return dict(retimage=retimage)
>
>
>
> {{extend 'layout.html'}}
> 
> window.setInterval(function(){
> {{getimage=retimage()}}
>   document.body.background = url("{{=getimage}}");
> }, 500);
> 
>
>
>
> Still doesn't work!
>
> On Monday, June 13, 2016 at 3:17:15 PM UTC+5:30, Massimiliano wrote:
>>
>> In *k* you have strings like “URL(‘static’,’images/1.jpg’)” not the URL
>> func result.
>>
>> Try something like that:
>>
>> def retimage():
>> from random import randint
>> i=randint(0,2)
>> return URL(‘static’,’images/%d.jpg’ % (i))
>>
>>
>>
>> On Mon, Jun 13, 2016 at 11:30 AM, Emmanuel Dsouza 
>> wrote:
>>
>>> CONTROLLER:
>>>
>>> def retimage():
>>>
>>> k=["URL('static','images/1.jpg')","URL('static','images/2.jpg')","URL('static','images/3.jpg')"]
>>> from random import randint
>>> i=randint(0,2)
>>> return k[i]
>>> def index():
>>> return locals()
>>>
>>> VIEW:
>>>
>>> {{extend 'layout.html'}}
>>> 
>>> window.setInterval(function(){
>>> {{getimage=retimage()}}
>>>   document.body.background = url("{{=getimage}}");
>>> }, 5000);
>>> 
>>> >>
>>>
>>> How should I correct this?
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Massimiliano
>>
> --
> 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.
>



-- 
Massimiliano

-- 
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] Why is this simple join not rendering?

2016-06-17 Thread Massimiliano
I think you need to refer to fields in this way:

{{=customer.customer.first_name}}
{{=customer.customer_type.type_name}}

On Fri, Jun 17, 2016 at 8:56 AM, Greenpoise  wrote:

> so I have this simple join:
>
> query = (db.customer.id > 0) & (db.customer_type.id
> ==db.customer.customer_type)
>
> all_customers = db(query).select()
>
> return dict(all_customers = all_customers)
>
> and my view:
>
> {{for customer in all_customers:}}
> 
>   {{=customer.first_name}}
>   {{=customer.last_name}}
>   {{=customer_type.type_name}}
>   {{=customer.email}}
>   {{=customer.home_number}}
>  {{pass}}
>
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] custom postgres adapter

2016-06-22 Thread Massimiliano
Hi,

I'm working on legacy databases where boolean are defined as smallint.

The following adapter doesn't work anymore. Could you give me some hint on 
how can I write a new one for the "new" pydal.
Thank you

The adapter that was working till now:

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


from pydal.adapters import ADAPTERS, PostgreSQLAdapter

class BoolAsIntPostgreSQLAdapter(PostgreSQLAdapter):


# specify a diver to use
drivers = ('psycopg2','pg8000')
TRUE = -1
FALSE = 0


types = {
'boolean': 'smallint',
'string': 'VARCHAR(%(length)s)',
'text': 'TEXT',
'json': 'TEXT',
'password': 'VARCHAR(%(length)s)',
'blob': 'BYTEA',
'upload': 'VARCHAR(%(length)s)',
'integer': 'INTEGER',
'bigint': 'BIGINT',
'float': 'FLOAT',
'double': 'FLOAT8',
'decimal': 'NUMERIC(%(precision)s,%(scale)s)',
'date': 'DATE',
'time': 'TIME',
'datetime': 'TIMESTAMP',
'id': 'SERIAL PRIMARY KEY',
'reference': 'INTEGER REFERENCES %(foreign_key)s ON DELETE 
%(on_delete_action)s',
'list:integer': 'TEXT',
'list:string': 'TEXT',
'list:reference': 'TEXT',
'geometry': 'GEOMETRY',
'geography': 'GEOGRAPHY',
'big-id': 'BIGSERIAL PRIMARY KEY',
'big-reference': 'BIGINT REFERENCES %(foreign_key)s ON DELETE 
%(on_delete_action)s',
'reference FK': ', CONSTRAINT  "FK_%(constraint_name)s" FOREIGN KEY 
(%(field_name)s) REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s',
'reference TFK': ' CONSTRAINT  "FK_%(foreign_table)s_PK" FOREIGN 
KEY (%(field_name)s) REFERENCES %(foreign_table)s (%(foreign_key)s) ON 
DELETE %(on_delete_action)s',
}
def parse_boolean(self, value, field_type):
return value == self.TRUE or False



ADAPTERS.update( {
'pgsql': BoolAsIntPostgreSQLAdapter
})



-- 
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] fieldname variable in DAL expression

2016-06-22 Thread Massimiliano
Should be:

*db[tablename][afield]*


On Wed, Jun 22, 2016 at 11:40 AM, Pierre  wrote:

> Hi,
>
> Is there a way to pass a fieldname variable in a DAL expression other than
> the one described in the w2p book :
>
> *db[tablename].insert(**{fieldname:value**})*
>
> when tablename varies in an expression like: *db[tablename].afield* it is 
> likely that *afield* should do the same
>
> how do I enable  * afield  *to be a variable as well ?
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] Hide flash message after some elapsed time instead of on click

2016-07-11 Thread Massimiliano
Hi Jim,
I’m doing it in this way:

Edit static/web2py.js search for /*helper for flash messages*/

and add this command:

setTimeout(‘jQuery(".flash").fadeOut("slow")',5000);

just after:

if (flash.html()) flash.append(' ×
').slideDown();

Adjust 5000 that stands for 5 secods to your needs.


On Thu, Jul 7, 2016 at 6:00 PM, Jim Brouzoulis 
wrote:

> Hi everyone,
>
> Can I easily customise the web2py.js file to automatically hide/fade out
> the flash message after some given time (like a few seconds) instead of
> clicking on it? If so, how?
> I have a feeling that the solution is probably not that complicated but my
> js-skills aren't very impressive :)
>
> Regards
> // Jim
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] need code to update db from view to controller.

2016-08-11 Thread Massimiliano
Doesn’t update_records belong to *row* instead of *rows*?

On Thu, Aug 11, 2016 at 2:10 PM, madhu nomula  wrote:

> I am unable to update .
>
> In view its throwing issue: only row.update_record() code throwing
> error. unable to capture in view
>
> Please let me know if there is any issue below code:
>
> def update_timesheet():
>
>
> totalrecords=0;
> i=0;
>
> rows = db(
> (db.ActivityMapping.resource_id==db.auth_user.id)&
> (db.ActivityMapping.activity_date==request.vars.activity_date)&(
> db.auth_user.id==auth.user.id)
>  ).select(db.ActivityMapping.org_id,db.ActivityMapping.
> solution_id,db.ActivityMapping.activity_id,db.ActivityMapping.effort)
>
> for u in request.vars.org_id:
> totalrecords=totalrecords+1
>
> if totalrecords == 1:
>   rows.update_record(org_id=int(request.vars.org_id),solution_
> id=int(request.vars.solution_id),activity_id=int(request.
> vars.activity_id),effort=int(request.vars.effort))
> elif totalrecords>1:
> for m in request.vars.org_id:
>
> rows.update_record(org_id=int(m),solution_id=int(request.
> vars.solution_id[i]),activity_id=int(request.vars.activity_
> id[i]),effort=int(request.vars.effort[i]))
> #rows.update_record(effort=100)
> i=i+1
>
> return rows
>
> On Thu, Aug 11, 2016 at 1:53 AM, Dave S  wrote:
> >
> >
> > On Wednesday, August 10, 2016 at 3:52:20 AM UTC-7, madhu nomula wrote:
> >>
> >> Yes  totalrecords decalred.
> >>
> >> Updated the code like below in controller: But still throwing issue
> >>
> >
> > What issue is thrown?  Do you get a ticket, or wrong results?
> >
> > /dps
> >
> >
> > --
> > Resources:
> > - http://web2py.com
> > - http://web2py.com/book (Documentation)
> > - http://github.com/web2py/web2py (Source code)
> > - https://code.google.com/p/web2py/issues/list (Report Issues)
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "web2py-users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to web2py+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] change the default applicaton of web2py

2016-09-12 Thread Massimiliano
In routes.py

set:

default_application = "myapp"


http://www.web2py.com/books/default/chapter/29/04/the-core?search=init#Application-init

On Mon, Sep 12, 2016 at 8:36 AM, Alessio Varalta <
alessio.vara...@ethicalsoftware.it> wrote:

> Hi, I call my application with base_url+ name_application.
>
> With  base_url web2py call welcome application, I want to change and with
> base_url i want to call my name_application. Where is the code to change?
>
> --
> 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.
>



-- 
Massimiliano

-- 
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: request.user_agent().is_mobile

2013-11-28 Thread Massimiliano
Have you tried to delete sessions?


On Thu, Nov 28, 2013 at 9:32 PM, szimszon  wrote:

> I had that with 2.7.x too. I changed all my app to
> user_agent()['is_mobile'] :-o
>
> 2013. november 28., csütörtök 20:55:14 UTC+1 időpontban mr.freeze a
> következőt írta:
>
>> Did request.user_agent() change from a Storage object to dict?
>> request.user_agent().is_mobile is throwing errors for me on the latest bits
>> (2.8.2):
>> AttributeError: 'dict' object has no attribute 'is_mobile'.
>> Happy Thanksgiving!
>>
>  --
> 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/groups/opt_out.
>



-- 
Massimiliano

-- 
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/groups/opt_out.


Re: [web2py] String to query

2015-11-20 Thread Massimiliano
If I’m not missing something you can you do:

table = ‘memos’
field = ‘construction_site’
param1 = 1
param2 = 2

query = (db[table][field] == param1)
query = query | (db[table][field] == param2)


On Fri, Nov 20, 2015 at 11:32 AM, Gael Princivalle <
gaelprinciva...@gmail.com> wrote:

> Hello all.
>
> I need to build a query in a loop. Query is a string like:
> query = "db.memos.construction_site == 1"
>
> So query is a string and when I use it in a grid:
> grid_memos = SQLFORM.grid(query=query)
>
> It fails.
>  'str' object has no attribute '_db'
>
> How can I resolve it?
>
> Thanks, 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.
>



-- 
Massimiliano

-- 
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] String to query

2015-11-20 Thread Massimiliano
… but if you really want to use a string you can do:

query = eval(“db.memos.construction_site == 1")

On Fri, Nov 20, 2015 at 11:53 AM, Massimiliano  wrote:

> If I’m not missing something you can you do:
>
> table = ‘memos’
> field = ‘construction_site’
> param1 = 1
> param2 = 2
>
> query = (db[table][field] == param1)
> query = query | (db[table][field] == param2)
>
>
> On Fri, Nov 20, 2015 at 11:32 AM, Gael Princivalle <
> gaelprinciva...@gmail.com> wrote:
>
>> Hello all.
>>
>> I need to build a query in a loop. Query is a string like:
>> query = "db.memos.construction_site == 1"
>>
>> So query is a string and when I use it in a grid:
>> grid_memos = SQLFORM.grid(query=query)
>>
>> It fails.
>>  'str' object has no attribute '_db'
>>
>> How can I resolve it?
>>
>> Thanks, 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.
>>
>
>
>
> --
> Massimiliano
>



-- 
Massimiliano

-- 
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] Impostare un gruppo d'appartenenza di DEFAULT per la registrazione

2015-12-04 Thread Massimiliano
Ciao Alessandro, guarda se questo e’ cio’ che ti serve:

auth.settings.everybody_group_id = your_id


2015-12-01 14:49 GMT+01:00 Alessandro Leonetti :

>
> Buongiorno Massimo,
>
> intanto comincio col ringraziarti per aver costruito Web2Py, mi stai dando
> una grossa mano per completare il mio stage universitario che prevede lo
> sviluppo di una piattaforma web.
>
> Dunque ho un paio di domande da farti:
>
> 1) La prima è come faccio ad assegnare ad i nuovi utenti che si registrano
> alla piattaforma un Gruppo di default?
> Personalmente ho impostato a False la riga per la creazione di nuovi
> gruppi ad ogni nuova registrazione, ma non so come continuare.
>
> 2) La seconda domanda invece è se posso adattare in qualche modo i
> template di altri siti web a web2py, (ad esempio quelli di questo sito
> http://templated.co/),
> oppure se ce ne sono già altri nuovi da qualche altra parte. Per ora ho
> visto solo quelli predefiniti alla pagina http://web2py.com/layouts
>
> Ringrazio te e chiunque risponderà a questo post per l'attenzione,
>
> Saluti,
> Alessandro
>
> --
> 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.
>



-- 
Massimiliano

-- 
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.com seams down

2015-12-09 Thread Massimiliano
It’s up for me.

On Wed, Dec 9, 2015 at 10:54 AM, Manuele Pesenti 
wrote:

> Just tried to access web2py web site but it seams unreachable... anybody
> else got the same result?
>
> M.
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] db.define_table Advanced Field

2015-12-10 Thread Massimiliano
Take a look here:

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#One-to-many-relation

You will find that you need to set the *format* value for the table leader
just to inform web2py how to represent the record.

So in your example:

db.define_table(‘LEADER’,
… your fields,
format=‘%(yourfield)s’)


where *yourfield* is the LEADER’s field that you want to see instead the id.

Ciao

On Thu, Dec 10, 2015 at 1:35 AM, Alessandro Leonetti <
ale.leonett...@gmail.com> wrote:

> Good evening,
>
> I'm running into a problem quite uncomfortable but I'm pretty sure there
> is a fairly simple way to resolve it.
> I defined the various tables within my database and put them in relation
> with each other (one to many, many to many etc.).
> The problem is that when I insert a new record in a table that requires me
> to a field in another table, I have to specify that field in the record ID
> which will be linked to the record that I am creating.
>
> Example:
>
> Tables: Worker & Leader
> I want to specify, creating a new record in the table worker who is the
> head of the worker that I am entering:
>
> Name: BOB
> Surname: DYLAN
> Leader: 3 --> HOW DO I APPEAR TO A MENU 'CURTAIN FROM
> WHICH CAN CHOOSE ONE OF THE LEADERS ALREADY' INCLUDED IN THE DATABASE
> INSTEAD OF DOVER INSERT EXACT LEADER ID ???
>
> Dovrò specificare qualcosa all'interno di
> db.define_table('Worker',
> Field('Name',requires=IS_NOT_EMPTY()),
> Field('Surname',requires=IS_NOT_EMPTY()),
> Field('LEADER', db.LEADER ..
>)
> ?
>
> Thanks for any answers, it would be great if you could help me, I'm losing
> a lot of time!
>
> Best Regard and sorry for my disappointing english,
> Alessandro
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] Need help with inno Plugin/Web2pyPackagingApp

2015-12-11 Thread Massimiliano
pip search inno

return a couple of suitable entries

On Fri, Dec 11, 2015 at 2:08 PM, Jitun John  wrote:

> Hi,
>
> I am using Web2pyPackagingApp to build a binary distribution of the app.
> I have searched for the"inno plugin" on the web.. but cant find anything.
>
>1. Download and install the inno plugin into your web2py development
>environment.
>
> So I thought it might be the "inno.py" file provided in the
> Web2pyPackagingApp/modules folder
> I see "._hstart.exe, "hstart.exe"  "styles.css" files in the
>  "Web2pyPackagingApp\static  folder as well.
> So I copies the same to the respective locations in "myapp"
>
> I installed the "Inno Setup <http://www.jrsoftware.org/isdl.php>".
> Added def inno() in my controller/default.py
>
> Then when I try /myapp/default/inno
> I get "ImportError: No module named inno.modules.inno"
>
> Then, I tried
>
> from inno import Inno as Inno
>
> and
> from applications.myapp.modules.inno import Inno as Inno
>
> when I try /myapp/default/inno  I get
>
> "Object not found"
>
>
>
>
> I then created, web2py\applications\inno\modules and added __init__.py and
> inno.py to it
> And then  web2py\applications\inno\static with hstart files.
>
> With similar results.
>
> I have tried both windows version and source version.
> What have I missed ?
>
>
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] Need help with inno Plugin/Web2pyPackagingApp

2015-12-11 Thread Massimiliano
Sorry I didn’t understand the question.

keep your inno.py in yourapp/modules/

the problem is in inno.py in this line:

form=SQLFORM(self.db.innoinfo,1,showid=False,col3={….


try to change it to

form=SQLFORM(self.db.innoinfo,*None*,showid=False,col3={




On Fri, Dec 11, 2015 at 4:07 PM, Massimiliano  wrote:

> pip search inno
>
> return a couple of suitable entries
>
> On Fri, Dec 11, 2015 at 2:08 PM, Jitun John  wrote:
>
>> Hi,
>>
>> I am using Web2pyPackagingApp to build a binary distribution of the app.
>> I have searched for the"inno plugin" on the web.. but cant find anything.
>>
>>1. Download and install the inno plugin into your web2py development
>>environment.
>>
>> So I thought it might be the "inno.py" file provided in the
>> Web2pyPackagingApp/modules folder
>> I see "._hstart.exe, "hstart.exe"  "styles.css" files in the
>>  "Web2pyPackagingApp\static  folder as well.
>> So I copies the same to the respective locations in "myapp"
>>
>> I installed the "Inno Setup <http://www.jrsoftware.org/isdl.php>".
>> Added def inno() in my controller/default.py
>>
>> Then when I try /myapp/default/inno
>> I get "ImportError: No module named inno.modules.inno"
>>
>> Then, I tried
>>
>> from inno import Inno as Inno
>>
>> and
>> from applications.myapp.modules.inno import Inno as Inno
>>
>> when I try /myapp/default/inno  I get
>>
>> "Object not found"
>>
>>
>>
>>
>> I then created, web2py\applications\inno\modules and added __init__.py
>> and inno.py to it
>> And then  web2py\applications\inno\static with hstart files.
>>
>> With similar results.
>>
>> I have tried both windows version and source version.
>> What have I missed ?
>>
>>
>>
>> --
>> 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.
>>
>
>
>
> --
> Massimiliano
>



-- 
Massimiliano

-- 
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: Support for BIT(1) as boolean?

2016-01-11 Thread Massimiliano
Eventually take a look here:

http://www.web2pyslices.com/slice/show/1611/postgresql-custom-adapter



On Mon, Jan 11, 2016 at 5:57 PM, Alfonso Serra  wrote:

> Im sorry i just seen Massimo's answer at the post:
>
> https://groups.google.com/forum/#!searchin/web2py/boolean$20values/web2py/IukqqZF_PPE/Dehg9dKUT58J
>
> import copy
> db =DAL()
> db._adapter.types = copy.copy(db._adapter.types)
> db._adapter.types['boolean']='TINYINT(1)'
> db._adapter.TRUE = 1
> db._adapter.FALSE = 0
>
> Ill try BIT
>
> --
> 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.
>



-- 
Massimiliano

-- 
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: Spreadsheet.py documentation and status

2016-02-09 Thread Massimiliano
Wow nice w2ui! Thank you for sharing!

On Mon, Feb 8, 2016 at 10:50 AM, Rimantas Nedzinskas 
wrote:

> Try this:
>
>> http://w2ui.com/web/demos/#!combo/combo-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.
>



-- 
Massimiliano

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


Re: [web2py] Re: How to insert different grid elements in tab panels?

2016-03-18 Thread Massimiliano
Try to give a each grid a uniq formname:

SQLFORM.grid(db.post, formname=‘grid_post’)

SQLFORM.grid(db.post, formname=‘grid_comments’)

On Wed, Mar 16, 2016 at 1:25 AM, Ron Chatterjee 
wrote:

> Basically, I go to panel one and "view" the grid element. And if I click
> on "back" button it takes me to panel2 content even though it says panel1.
> And vice versa.
>
>
> On Tuesday, March 15, 2016 at 8:21:59 PM UTC-4, Ron Chatterjee wrote:
>>
>> I used the LOAD but seems to be the problem still there. See attached pic
>>
>>
>> My Model
>>
>> db.define_table('post',
>> Field("title", "string", length=128, default=""),
>> Field("contents", "text", length=512, default=""),
>> Field("created_on", "date", default=None),
>> )
>>
>> if not db(db.post).count():
>> from gluon.contrib.populate import populate
>> populate(db.post,25)
>>
>> db.define_table('comments',
>> Field("title", "text", length=128, default=""),
>> Field("contents", "string", length=512, default=""),
>> Field("created_on", "date", default=None),
>> )
>>
>> if not db(db.comments).count():
>> from gluon.contrib.populate import populate
>> populate(db.comments,25)
>>
>>
>>
>> Controller:
>>
>> def first_action():
>> grid1 = SQLFORM.grid(db.post)
>> return dict(grid1 = grid1)
>>
>> def second_action():
>> grid2 = SQLFORM.grid(db.comments)
>> return dict(grid2 = grid2)
>>
>>
>> def tab_panel():
>> return locals()
>>
>>
>>
>> View:
>>
>> {{extend 'layout.html'}}
>>
>> 
>>   My Dashboard
>>   
>> My
>> Projects
>> My Files
>> Menu 2
>> Menu 3
>>   
>>
>>   
>> 
>>   {{=LOAD('default','first_action.load',ajax=True)}}
>> 
>> 
>>
>>   {{=LOAD('default','second_action.load',ajax=True)}}
>> 
>> 
>>   Menu 2
>>   Sed ut perspiciatis unde omnis iste natus error sit voluptatem
>> accusantium doloremque laudantium, totam rem aperiam.
>> 
>> 
>>   Menu 3
>>   Eaque ipsa quae ab illo inventore veritatis et quasi architecto
>> beatae vitae dicta sunt explicabo.
>> 
>>   
>> 
>>
>>
>>
>> On Wednesday, March 2, 2016 at 4:24:26 PM UTC-5, Ron Chatterjee wrote:
>>>
>>> Thank you Val. Appreciate the help.
>>>
>>> On Wednesday, March 2, 2016 at 1:51:58 PM UTC-5, Val K wrote:
>>>>
>>>> As I know it's impossible to have 2 "static" (not ajax)  SQLFORM.grids
>>>> at the same page, because each of them will treat request.args  as its own
>>>>
>>>> Use {=LOAD(... , ajax=True)}
>>>>
>>>> And I think  you have to have different controllers to process them or
>>>> one controller that will return different results depends on "whose
>>>> requests" - return dict(grid= grid1)  or  return dict(grid= grid2)  not
>>>> both!
>>>>
>>>>
>>>> On Wednesday, March 2, 2016 at 8:12:49 PM UTC+3, Ron Chatterjee wrote:
>>>>>
>>>>>
>>>>> If I have two independent grid, when I search in one grid, it gets
>>>>> redirected to the other tab. And I noticed this with other tab panel as
>>>>> well.
>>>>>
>>>>>
>>>>>
>>>>> 
>>>>>   
>>>>> My Projects
>>>>> My Payments
>>>>> My Contacts
>>>>>   
>>>>>   
>>>>>
>>>>>   {{=grid1}}
>>>>>   
>>>>>   
>>>>> {{=grid2}}
>>>>>   
>>>>>   
>>>>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
>>>>> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
>>>>> volutpat.
>>>>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
>>>>> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
>>>>> volutpat.
>>>>> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
>>>>> nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
>>>>> volutpat.
>>>>>   
>>>>> 
>>>>>
>>>>> 
>>>>> $( "#tabs" ).tabs();
>>>>> 
>>>>>
>>>>> --
> 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.
>



-- 
Massimiliano

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


Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-23 Thread Massimiliano
Very very nice.

Thank you for sharing

On Wed, Mar 23, 2016 at 3:17 AM, Michael Beller  wrote:

> I created a new 'starter' app for the types of data and process management
> apps I tend to build.
>
> I used https://almsaeedstudio.com/preview as the template and I'm hosting
> a preview at https://mjbeller.pythonanywhere.com/starter.
>
> I'd welcome any feedback but also wanted to share the code at
> https://github.com/mjbeller/web2py-starter for anybody that may want to
> explore.
>
> I started with the goal to create a new web2py app without using the
> Welcome app to help me learn a little more about web2py.  I found myself
> slowly adding more and more code (primarily CSS and JS) from the Welcome
> app to support some features such as Smartgrids.  I'd like to evolve
> Starter to support the upcoming form.py and grid.py that the core team is
> evaluating and developing.
>
> --
> 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.
>



-- 
Massimiliano

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


Re: [web2py] new Starter app (alternative to Welcome app)

2016-03-23 Thread Massimiliano
Just copy

appconfic.ini from welcome/private to starter/private

On Wednesday, March 23, 2016 at 11:19:23 AM UTC+1, Ramos wrote:
>
> Nice but i get an error installing it as "starter" application
> any help ?
>
> [image: Imagem inline 1]
>
> 2016-03-23 9:40 GMT+00:00 Massimiliano >:
>
>> Very very nice. 
>>
>> Thank you for sharing
>>
>> On Wed, Mar 23, 2016 at 3:17 AM, Michael Beller > > wrote:
>>
>>> I created a new 'starter' app for the types of data and process 
>>> management apps I tend to build.
>>>
>>> I used https://almsaeedstudio.com/preview as the template and I'm 
>>> hosting a preview at https://mjbeller.pythonanywhere.com/starter.
>>>
>>> I'd welcome any feedback but also wanted to share the code at 
>>> https://github.com/mjbeller/web2py-starter for anybody that may want to 
>>> explore.
>>>
>>> I started with the goal to create a new web2py app without using the 
>>> Welcome app to help me learn a little more about web2py.  I found myself 
>>> slowly adding more and more code (primarily CSS and JS) from the Welcome 
>>> app to support some features such as Smartgrids.  I'd like to evolve 
>>> Starter to support the upcoming form.py and grid.py that the core team is 
>>> evaluating and developing.
>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web2py+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Massimiliano
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: [web2py] Create links in smartgrid for the child

2016-03-31 Thread Massimiliano
Maybe you can check the table involved and set links option accordingly.

Something like:

table = request.args(0) or ‘dashboard’

links = []
if table == ‘label_dashboard’:
links=[…]
grid = SQLFORM.smartgrid(db.dashboard,linked_tables=[‘label_dashboard’],
links=links)


Not tested


On Wed, Mar 30, 2016 at 6:40 PM, Alessio Varalta <
alessio.vara...@ethicalsoftware.it> wrote:

> Hi I have a smartgrid with one child and i want a to add links to my child
> is possibile for example:
>
> I have entity dashboard with a child label_dashboard
>
> So i create the smartgrid
>
> grid = SQLFORM.smartgrid(db.dashboard,linked_tables=['label_dashboard'])
>
> Now I want to add links to label_dashboard is possible? When in the grid i
> go to label_dashboard i want for every row a link button for go to a
> page..I know how use the link button in a grid but for the smartgrid?
>
> --
> 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.
>



-- 
Massimiliano

-- 
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] Create links in smartgrid for the child

2016-03-31 Thread Massimiliano
Sorry is a little more complex to get the table name involved.

It should be in request.args(1)

table = request.args(1).rpartition('.')[0]

On Thu, Mar 31, 2016 at 12:10 PM, Massimiliano  wrote:

> Maybe you can check the table involved and set links option accordingly.
>
> Something like:
>
> table = request.args(0) or ‘dashboard’
>
> links = []
> if table == ‘label_dashboard’:
> links=[…]
> grid = SQLFORM.smartgrid(db.dashboard,linked_tables=[‘label_dashboard’],
> links=links)
>
>
> Not tested
>
>
> On Wed, Mar 30, 2016 at 6:40 PM, Alessio Varalta <
> alessio.vara...@ethicalsoftware.it> wrote:
>
>> Hi I have a smartgrid with one child and i want a to add links to my
>> child is possibile for example:
>>
>> I have entity dashboard with a child label_dashboard
>>
>> So i create the smartgrid
>>
>> grid = SQLFORM.smartgrid(db.dashboard,linked_tables=['label_dashboard'])
>>
>> Now I want to add links to label_dashboard is possible? When in the grid
>> i go to label_dashboard i want for every row a link button for go to a
>> page..I know how use the link button in a grid but for the smartgrid?
>>
>> --
>> 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.
>>
>
>
>
> --
> Massimiliano
>



-- 
Massimiliano

-- 
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] Create links in smartgrid for the child

2016-03-31 Thread Massimiliano
There is a simple way :-)

from the code:

https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L2914

links(dict): like `{'tablename':[lambda row: A(), ...]}`

that will add buttons when table tablename is displayed

On Thu, Mar 31, 2016 at 12:18 PM, Massimiliano  wrote:

> Sorry is a little more complex to get the table name involved.
>
> It should be in request.args(1)
>
> table = request.args(1).rpartition('.')[0]
>
> On Thu, Mar 31, 2016 at 12:10 PM, Massimiliano 
> wrote:
>
>> Maybe you can check the table involved and set links option accordingly.
>>
>> Something like:
>>
>> table = request.args(0) or ‘dashboard’
>>
>> links = []
>> if table == ‘label_dashboard’:
>> links=[…]
>> grid = SQLFORM.smartgrid(db.dashboard,linked_tables=[‘label_dashboard’],
>> links=links)
>>
>>
>> Not tested
>>
>>
>> On Wed, Mar 30, 2016 at 6:40 PM, Alessio Varalta <
>> alessio.vara...@ethicalsoftware.it> wrote:
>>
>>> Hi I have a smartgrid with one child and i want a to add links to my
>>> child is possibile for example:
>>>
>>> I have entity dashboard with a child label_dashboard
>>>
>>> So i create the smartgrid
>>>
>>> grid = SQLFORM.smartgrid(db.dashboard,linked_tables=['label_dashboard'])
>>>
>>> Now I want to add links to label_dashboard is possible? When in the grid
>>> i go to label_dashboard i want for every row a link button for go to a
>>> page..I know how use the link button in a grid but for the smartgrid?
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> Massimiliano
>>
>
>
>
> --
> Massimiliano
>



-- 
Massimiliano

-- 
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: cas broken in 2.14.3?

2016-04-07 Thread Massimiliano
I tested trunk.
Seems ok to me.



On Thu, Apr 7, 2016 at 3:26 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> I believe this has been fixed in trunk. Can you check? If you confirm we
> will deploy a new web2py version.
>
>
> On Wednesday, 6 April 2016 08:55:31 UTC-5, Franz Pietz wrote:
>>
>> Same here. My server was running 2.12.3 and CAS works fine (with a logout
>> issue that I reported previously, but had no answer yet).
>>
>> After updating to 2.14.3, I get the same 'not authorized' page.
>>
>> On Saturday, April 2, 2016 at 4:15:04 AM UTC-3, mweissen wrote:
>>>
>>> Is cas broken in 2.14.3?
>>>
>>> I am not sure - I have tested it with two different sites and I have got
>>> errors like "invalid request" or "not authorized".
>>>
>>> Site 1: Cas worked before upgrade to 2.14.3.
>>>
>>> Site 2: A new test with my local server:
>>>
>>> In application m_abschluss, db.py:
>>>
>>> auth = Auth(db, cas_provider = '
>>> http://127.0.0.1:8000/media/default/user/cas')
>>>
>>>
>>> A login to m_abschluss creates this url:
>>>
>>>
>>> http://127.0.0.1:8000/media/default/user/cas/login?service=http://127.0.0.1:8000/m_abschluss/default/user/login
>>>
>>> And a call to this url gives "not authorized".
>>>
>>> Kind regards, Martin
>>>
>>>
>>> --
> 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.
>



-- 
Massimiliano

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


Re: [web2py] Re: How to serve same view for multiple urls

2018-03-15 Thread Massimiliano
If I understand correctly what you mean, you need an entrypoint that could
be index in your controller that load the view.
Now from the view you get and set data via ajax from/to other controller
functions.

SPA are heavly javascript based.

Take a look on discussions on Vue.js

On Thu, Mar 15, 2018 at 11:53 AM, Ur. Kr.  wrote:

> Would also need a way to redirect to "index" controller instead of getting
> "invalid controller" when navigating to a URL without a controller.
>
>
> On Thursday, March 15, 2018 at 11:28:33 AM UTC+1, Ur. Kr. wrote:
>>
>> If you want to convert part of a web2py app into an SPA with client-side
>> routing, how do you make web2py serve the same view for multiple urls?
>>
> --
> 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.
>



-- 
Massimiliano

-- 
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] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Massimiliano
Have you tried to install psycopg2? Is the standard de facto postgresql
driver.
The pip package should be psycopg2-binary

On Wed, Jan 23, 2019 at 10:39 AM Lisandro 
wrote:

> Hi there! Yesterday I had a MAJOR downtime and I would need your help to
> understand what happened.
>
> The team that is in charge of upgrading security packages at my server
> (CentOS 7 at Linode) did an update that involved an upgrade to pgBouncer.
> Accordingly to what they said, they noticed pgBouncer was throwing errors
> after the upgrade, so they downgraded to the previous version that was
> installed. But sadly the problem remained. After this upgrade/downgrade of
> pgBouncer, all the attempts of connecting from my web2py app to pgBouncer
> fail.
>
> Inside of postgresql.log I can see lot of this:
> 2019-01-22 14:39:37 -03 ERROR:  prepared statement «pg8000_statement_0»
> already exists
> 2019-01-22 14:39:37 -03 SENTENCIA:  begin transaction
> 2019-01-22 14:39:38 -03 ERROR:  prepared statement «pg8000_statement_0»
> already exists
> 2019-01-22 14:39:38 -03 SENTENCIA:  begin transaction
>
> I've noticed that "pg8000_statement_0" is referenced at line 1894 in
> gluon/contrib/pg8000/core.py, but I can't realise if there is something I
> could do to avoid the error.
> I'm using web2py Version 2.16.1-stable+timestamp.2017.11.14.05.54.25, and
> I've noticed that gluon/contrib/pg8000/core.py isn't anymore in version
> 2.17.1.
>
> Of course I've tried restarting al the involved services, but nothing
> worked. Every time my web2py application tries to connect to the database,
> if pgBouncer is at the middle, the 5 attempts fail and those lines are
> printed to the postgresql.log. Right now I've bypassed pgbouncer and my
> application is connecting directly to postgresql.
>
> Could you put some lights into this? What can I do to avoid that error and
> still connect to pgBouncer with web2py 2.16.1?
>
> Thank you very much in advance.
> Regards, Lisandro.
>
> --
> 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.
>


-- 
Massimiliano

-- 
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] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Massimiliano
Could be.

When you strart web2py it show database driver available:
Mine:
Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000,
pyodbc, pymongo




On Wed, Jan 23, 2019 at 10:59 AM Lisandro 
wrote:

> Thanks Massimiliano.
>
> Apparently psycopg2 is already installed (of course it was already
> installed, maybe something broke during the packages upgrade).
> Something weird is that I see psycopg2 installed twice, is this correct?
>
> ~$ pip freeze | grep psycopg2
> psycopg2==2.7.5
> psycopg2-binary==2.7.5
>
> Could this be the source of the problem?
> I don't see how. For what I understand, using or not using pgBouncer in
> the middle is transparent to the web2py application: it always connects in
> the same way, the application doesn't know if its connecting to PostgreSQL
> or pgBouncer. I think that's the whole idea of pgBouncer, to act as a
> middle man, pooling connections, behaving as if the application was
> connected directly to PostgreSQL.
>
> Any comment or suggestion will be much appreciated.
>
> El miércoles, 23 de enero de 2019, 6:51:06 (UTC-3), Massimiliano escribió:
>>
>> Have you tried to install psycopg2? Is the standard de facto postgresql
>> driver.
>> The pip package should be psycopg2-binary
>>
>> On Wed, Jan 23, 2019 at 10:39 AM Lisandro  wrote:
>>
>>> Hi there! Yesterday I had a MAJOR downtime and I would need your help to
>>> understand what happened.
>>>
>>> The team that is in charge of upgrading security packages at my server
>>> (CentOS 7 at Linode) did an update that involved an upgrade to pgBouncer.
>>> Accordingly to what they said, they noticed pgBouncer was throwing errors
>>> after the upgrade, so they downgraded to the previous version that was
>>> installed. But sadly the problem remained. After this upgrade/downgrade of
>>> pgBouncer, all the attempts of connecting from my web2py app to pgBouncer
>>> fail.
>>>
>>> Inside of postgresql.log I can see lot of this:
>>> 2019-01-22 14:39:37 -03 ERROR:  prepared statement «pg8000_statement_0»
>>> already exists
>>> 2019-01-22 14:39:37 -03 SENTENCIA:  begin transaction
>>> 2019-01-22 14:39:38 -03 ERROR:  prepared statement «pg8000_statement_0»
>>> already exists
>>> 2019-01-22 14:39:38 -03 SENTENCIA:  begin transaction
>>>
>>> I've noticed that "pg8000_statement_0" is referenced at line 1894 in
>>> gluon/contrib/pg8000/core.py, but I can't realise if there is something I
>>> could do to avoid the error.
>>> I'm using web2py Version 2.16.1-stable+timestamp.2017.11.14.05.54.25,
>>> and I've noticed that gluon/contrib/pg8000/core.py isn't anymore in version
>>> 2.17.1.
>>>
>>> Of course I've tried restarting al the involved services, but nothing
>>> worked. Every time my web2py application tries to connect to the database,
>>> if pgBouncer is at the middle, the 5 attempts fail and those lines are
>>> printed to the postgresql.log. Right now I've bypassed pgbouncer and my
>>> application is connecting directly to postgresql.
>>>
>>> Could you put some lights into this? What can I do to avoid that error
>>> and still connect to pgBouncer with web2py 2.16.1?
>>>
>>> Thank you very much in advance.
>>> Regards, Lisandro.
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Massimiliano
>>
> --
> 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.
>


-- 
Massimiliano

-- 
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] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Massimiliano
Try to uninstall psycopg2-* and reinstall only psycopg2-binary

On Wed, Jan 23, 2019 at 11:52 AM Massimiliano  wrote:

> Could be.
>
> When you strart web2py it show database driver available:
> Mine:
> Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000,
> pyodbc, pymongo
>
>
>
>
> On Wed, Jan 23, 2019 at 10:59 AM Lisandro 
> wrote:
>
>> Thanks Massimiliano.
>>
>> Apparently psycopg2 is already installed (of course it was already
>> installed, maybe something broke during the packages upgrade).
>> Something weird is that I see psycopg2 installed twice, is this correct?
>>
>> ~$ pip freeze | grep psycopg2
>> psycopg2==2.7.5
>> psycopg2-binary==2.7.5
>>
>> Could this be the source of the problem?
>> I don't see how. For what I understand, using or not using pgBouncer in
>> the middle is transparent to the web2py application: it always connects in
>> the same way, the application doesn't know if its connecting to PostgreSQL
>> or pgBouncer. I think that's the whole idea of pgBouncer, to act as a
>> middle man, pooling connections, behaving as if the application was
>> connected directly to PostgreSQL.
>>
>> Any comment or suggestion will be much appreciated.
>>
>> El miércoles, 23 de enero de 2019, 6:51:06 (UTC-3), Massimiliano escribió:
>>>
>>> Have you tried to install psycopg2? Is the standard de facto postgresql
>>> driver.
>>> The pip package should be psycopg2-binary
>>>
>>> On Wed, Jan 23, 2019 at 10:39 AM Lisandro  wrote:
>>>
>>>> Hi there! Yesterday I had a MAJOR downtime and I would need your help
>>>> to understand what happened.
>>>>
>>>> The team that is in charge of upgrading security packages at my server
>>>> (CentOS 7 at Linode) did an update that involved an upgrade to pgBouncer.
>>>> Accordingly to what they said, they noticed pgBouncer was throwing errors
>>>> after the upgrade, so they downgraded to the previous version that was
>>>> installed. But sadly the problem remained. After this upgrade/downgrade of
>>>> pgBouncer, all the attempts of connecting from my web2py app to pgBouncer
>>>> fail.
>>>>
>>>> Inside of postgresql.log I can see lot of this:
>>>> 2019-01-22 14:39:37 -03 ERROR:  prepared statement «pg8000_statement_0»
>>>> already exists
>>>> 2019-01-22 14:39:37 -03 SENTENCIA:  begin transaction
>>>> 2019-01-22 14:39:38 -03 ERROR:  prepared statement «pg8000_statement_0»
>>>> already exists
>>>> 2019-01-22 14:39:38 -03 SENTENCIA:  begin transaction
>>>>
>>>> I've noticed that "pg8000_statement_0" is referenced at line 1894 in
>>>> gluon/contrib/pg8000/core.py, but I can't realise if there is something I
>>>> could do to avoid the error.
>>>> I'm using web2py Version 2.16.1-stable+timestamp.2017.11.14.05.54.25,
>>>> and I've noticed that gluon/contrib/pg8000/core.py isn't anymore in version
>>>> 2.17.1.
>>>>
>>>> Of course I've tried restarting al the involved services, but nothing
>>>> worked. Every time my web2py application tries to connect to the database,
>>>> if pgBouncer is at the middle, the 5 attempts fail and those lines are
>>>> printed to the postgresql.log. Right now I've bypassed pgbouncer and my
>>>> application is connecting directly to postgresql.
>>>>
>>>> Could you put some lights into this? What can I do to avoid that error
>>>> and still connect to pgBouncer with web2py 2.16.1?
>>>>
>>>> Thank you very much in advance.
>>>> Regards, Lisandro.
>>>>
>>>> --
>>>> Resources:
>>>> - http://web2py.com
>>>> - http://web2py.com/book (Documentation)
>>>> - http://github.com/web2py/web2py (Source code)
>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "web2py-users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to web2py+un...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>> --
>>> Massimiliano
>>>
>> --
>> 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.
>>
>
>
> --
> Massimiliano
>


-- 
Massimiliano

-- 
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] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Massimiliano
When psycopg is available web2py will use it when is not it use pg8000 that
was included in web2py

Il giorno mer 23 gen 2019 alle 14:05 Lisandro 
ha scritto:

> Thank you all for that notes.
>
> When I run web2py at my server, I see this available drivers: sqlite3,
> imaplib, pymysql, pg8000
> I don't see psycopg2, so I presume it will be available if I uninstall
> those two versions and install the psycopg2-binary version.
>
> One additional question: which driver is using my app then?
> I mean, right now my application is connecting directly to PostgreSQL
> without problems. Would this mean it is using the pg8000 driver? Would
> psycopg2 be available to web2py once I reinstall it (restarting uwsgi)?
>
>
>
> El miércoles, 23 de enero de 2019, 7:54:37 (UTC-3), Massimiliano escribió:
>>
>> Try to uninstall psycopg2-* and reinstall only psycopg2-binary
>>
>> On Wed, Jan 23, 2019 at 11:52 AM Massimiliano  wrote:
>>
>>> Could be.
>>>
>>> When you strart web2py it show database driver available:
>>> Mine:
>>> Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000,
>>> pyodbc, pymongo
>>>
>>>
>>>
>>>
>>> On Wed, Jan 23, 2019 at 10:59 AM Lisandro  wrote:
>>>
>>>> Thanks Massimiliano.
>>>>
>>>> Apparently psycopg2 is already installed (of course it was already
>>>> installed, maybe something broke during the packages upgrade).
>>>> Something weird is that I see psycopg2 installed twice, is this correct?
>>>>
>>>> ~$ pip freeze | grep psycopg2
>>>> psycopg2==2.7.5
>>>> psycopg2-binary==2.7.5
>>>>
>>>> Could this be the source of the problem?
>>>> I don't see how. For what I understand, using or not using pgBouncer in
>>>> the middle is transparent to the web2py application: it always connects in
>>>> the same way, the application doesn't know if its connecting to PostgreSQL
>>>> or pgBouncer. I think that's the whole idea of pgBouncer, to act as a
>>>> middle man, pooling connections, behaving as if the application was
>>>> connected directly to PostgreSQL.
>>>>
>>>> Any comment or suggestion will be much appreciated.
>>>>
>>>> El miércoles, 23 de enero de 2019, 6:51:06 (UTC-3), Massimiliano
>>>> escribió:
>>>>>
>>>>> Have you tried to install psycopg2? Is the standard de facto
>>>>> postgresql driver.
>>>>> The pip package should be psycopg2-binary
>>>>>
>>>>> On Wed, Jan 23, 2019 at 10:39 AM Lisandro 
>>>>> wrote:
>>>>>
>>>>>> Hi there! Yesterday I had a MAJOR downtime and I would need your help
>>>>>> to understand what happened.
>>>>>>
>>>>>> The team that is in charge of upgrading security packages at my
>>>>>> server (CentOS 7 at Linode) did an update that involved an upgrade to
>>>>>> pgBouncer. Accordingly to what they said, they noticed pgBouncer was
>>>>>> throwing errors after the upgrade, so they downgraded to the previous
>>>>>> version that was installed. But sadly the problem remained. After this
>>>>>> upgrade/downgrade of pgBouncer, all the attempts of connecting from my
>>>>>> web2py app to pgBouncer fail.
>>>>>>
>>>>>> Inside of postgresql.log I can see lot of this:
>>>>>> 2019-01-22 14:39:37 -03 ERROR:  prepared statement
>>>>>> «pg8000_statement_0» already exists
>>>>>> 2019-01-22 14:39:37 -03 SENTENCIA:  begin transaction
>>>>>> 2019-01-22 14:39:38 -03 ERROR:  prepared statement
>>>>>> «pg8000_statement_0» already exists
>>>>>> 2019-01-22 14:39:38 -03 SENTENCIA:  begin transaction
>>>>>>
>>>>>> I've noticed that "pg8000_statement_0" is referenced at line 1894 in
>>>>>> gluon/contrib/pg8000/core.py, but I can't realise if there is something I
>>>>>> could do to avoid the error.
>>>>>> I'm using web2py Version 2.16.1-stable+timestamp.2017.11.14.05.54.25,
>>>>>> and I've noticed that gluon/contrib/pg8000/core.py isn't anymore in 
>>>>>> version
>>>>>> 2.17.1.
>>>>>>
>>>>>> Of course I've tried restarting al the involved services, but nothing
>>>>>> wo

Re: [web2py] Re: custom search

2019-04-26 Thread Massimiliano
Is difficult to understand how you intend to trigger the search without
some infos.
Anyway just to give you an hint:

jQuery("#your_custom_widget").closest('form').trigger('submit');

On Fri, Apr 26, 2019 at 12:22 PM Andrea Fae'  wrote:

> They are the standard buttons "Search" and "Reset". I'd like from
> javascript in the html view to execute "Search" by code.
> Thank you
>
> Il giorno venerdì 26 aprile 2019 00:05:39 UTC+2, João Matos ha scritto:
>>
>> You don't have the standard buttons, but have a search button created by
>> you?
>>
>>
>> quinta-feira, 25 de Abril de 2019 às 15:21:41 UTC+1, Andrea Fae' escreveu:
>>>
>>> I create a custom search, so not standard field with "Search" and
>>> "reset" button standard. How to click the button "Search" programmatically?
>>> thank you
>>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Massimiliano

-- 
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] TABLE and aggregate fields

2014-06-03 Thread Massimiliano
Hello,

I've an application in production with
2.5.1-stable+timestamp.2013.06.06.15.39.19, and I would like to update at
the newest web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, but I could a
problem with aggregate fields.

That is what's happen:

If I print my Rows var I get:
print rows:

zone.zona,tratte.tratta,SUM(qviewriepilogoprevisioni.bilici),SUM(qviewriepilogoprevisioni.motrici),SUM(qviewriepilogoprevisioni.abbinati)
ABRUZZO,ASCOLI (Ascoli Piceno),3,0,0
ABRUZZO,C. ABRUZZO (Pescara),2,0,0
ABRUZZO,S.BENEDETTO (),1,0,1

BUT if I do something like that:

TABLE(rows)

I got ONLY the 2 fields zone.zona,tratte.tratta

With the old web2py version this wasn't happen.
Where can I start to look at this problem?

Thank you

-- 
Massimiliano

-- 
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: TABLE and aggregate fields

2014-06-04 Thread Massimiliano
I think I explained the problem in the wrong way.

Before, with the old version of web2py some procedures that make use of
datatable worked very well.
Today we miss some fields... aggregate fields.

So I was looking for an hint to make the system work again with little
effort :D

Thank you


On Tue, Jun 3, 2014 at 5:26 PM, Niphlod  wrote:

> it's not a problem. we just changed the way a Rows class gets represented
> (printing resultsets with 1k rows was kynda lame ^_^)
> if you do
>
> print rows
>
> things "change", but
>
> for row in rows:
>  print row
>
> doesn't change a bit.
>
>
> On Tuesday, June 3, 2014 12:53:08 PM UTC+2, Massimiliano wrote:
>>
>> Hello,
>>
>> I've an application in production with 2.5.1-stable+timestamp.2013.
>> 06.06.15.39.19, and I would like to update at the newest
>> web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, but I could a problem
>> with aggregate fields.
>>
>> That is what's happen:
>>
>> If I print my Rows var I get:
>> print rows:
>>
>> zone.zona,tratte.tratta,SUM(qviewriepilogoprevisioni.bilici),SUM(
>> qviewriepilogoprevisioni.motrici),SUM(qviewriepilogoprevisioni.abbinati)
>> ABRUZZO,ASCOLI (Ascoli Piceno),3,0,0
>> ABRUZZO,C. ABRUZZO (Pescara),2,0,0
>> ABRUZZO,S.BENEDETTO (),1,0,1
>>
>> BUT if I do something like that:
>>
>> TABLE(rows)
>>
>> I got ONLY the 2 fields zone.zona,tratte.tratta
>>
>> With the old web2py version this wasn't happen.
>> Where can I start to look at this problem?
>>
>> Thank you
>>
>> --
>> Massimiliano
>>
>  --
> 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.
>



-- 
Massimiliano

-- 
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: TABLE and aggregate fields

2014-06-04 Thread Massimiliano
I think that is the problem.

Data from rows.json()

Look at the data structure:

version 2.5.1

u'[{"SUM(qviewriepilogoprevisioni.motrici)": 0, "zona": "ABRUZZO",
"SUM(qviewriepilogoprevisioni.bilici)": 2,
"SUM(qviewriepilogoprevisioni.abbinati)": 0, "tratta": "ASCOLI (Ascoli
Piceno)"}, {"SUM(qviewriepilogoprevisioni.motrici)": 0, "zona": "ABRUZZO",
"SUM(qviewriepilogoprevisioni.bilici)": 3,
"SUM(qviewriepilogoprevisioni.abbinati)": 0, "tratta": "C. ABRUZZO
(Pescara)"}]'

version 2.9.5 Now aggregate fields are under "_extra"

[{"cooptratte": {"tratta": "ASCOLI (Ascoli Piceno)"}, "coopzone": {"zona":
"ABRUZZO"}, "_extra": {"SUM(qviewriepilogoprevisioni.bilici)": 1,
"SUM(qviewriepilogoprevisioni.motrici)": 0,
"SUM(qviewriepilogoprevisioni.abbinati)": 1}}]

Thank you

On Wed, Jun 4, 2014 at 10:47 AM, Niphlod  wrote:

> I don't know what to suggest unless you show some code.
>
>
> On Wednesday, June 4, 2014 10:23:29 AM UTC+2, Massimiliano wrote:
>
>> I think I explained the problem in the wrong way.
>>
>> Before, with the old version of web2py some procedures that make use of
>> datatable worked very well.
>> Today we miss some fields... aggregate fields.
>>
>> So I was looking for an hint to make the system work again with little
>> effort :D
>>
>> Thank you
>>
>>
>> On Tue, Jun 3, 2014 at 5:26 PM, Niphlod  wrote:
>>
>>> it's not a problem. we just changed the way a Rows class gets
>>> represented (printing resultsets with 1k rows was kynda lame ^_^)
>>> if you do
>>>
>>> print rows
>>>
>>> things "change", but
>>>
>>> for row in rows:
>>>  print row
>>>
>>> doesn't change a bit.
>>>
>>>
>>> On Tuesday, June 3, 2014 12:53:08 PM UTC+2, Massimiliano wrote:
>>>>
>>>> Hello,
>>>>
>>>> I've an application in production with 2.5.1-stable+timestamp.2013.06
>>>> .06.15.39.19, and I would like to update at the newest
>>>> web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, but I could a
>>>> problem with aggregate fields.
>>>>
>>>> That is what's happen:
>>>>
>>>> If I print my Rows var I get:
>>>> print rows:
>>>>
>>>> zone.zona,tratte.tratta,SUM(qviewriepilogoprevisioni.bilici),SUM(
>>>> qviewriepilogoprevisioni.motrici),SUM(qviewriepilogoprevisioni.
>>>> abbinati)
>>>> ABRUZZO,ASCOLI (Ascoli Piceno),3,0,0
>>>> ABRUZZO,C. ABRUZZO (Pescara),2,0,0
>>>> ABRUZZO,S.BENEDETTO (),1,0,1
>>>>
>>>> BUT if I do something like that:
>>>>
>>>> TABLE(rows)
>>>>
>>>> I got ONLY the 2 fields zone.zona,tratte.tratta
>>>>
>>>> With the old web2py version this wasn't happen.
>>>> Where can I start to look at this problem?
>>>>
>>>> Thank you
>>>>
>>>> --
>>>> Massimiliano
>>>>
>>>  --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Massimiliano
>>
>  --
> 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.
>



-- 
Massimiliano

-- 
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] query and fields involved

2014-12-11 Thread Massimiliano
Is there a way to know if a field is involved in a query inspecting the
query object?

Thank you
-- 
Massimiliano

-- 
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: query and fields involved

2014-12-12 Thread Massimiliano
Thank you very much Antony!


On Thu, Dec 11, 2014 at 5:01 PM, Anthony  wrote:

> Maybe something like this:
>
> def query_fields(query):
> from gluon.dal import Query
> fields = []
> for element in (query.first, query.second):
> if isinstance(element, Field):
> fields.append(element)
> elif isinstance(element, Query):
> fields.extend(query_fields(element))
> return fields
>
> The above will return a list of field objects. You could instead have it
> return a list of field names (either using field.name, which returns only
> the field name, or using str(field), which returns 'tablename.fieldname'
> format), or directly check for the existence of a particular field.
>
> Note, when checking for a field match, don't do something like:
>
> db.mytable.myfield in list_of_field_objects
>
> or:
>
> any(db.mytable.myfield == field for field in list_of_field_objects)
>
> In both cases, the comparison operator will result in a Query object
> (because of the ==), which will always yield True. Instead, use "is" or
> compare the field names/string representations:
>
> any(db.mytable.myfield is field for field in list_of_field_objects)
>
> or:
>
> any(str(db.mytable.myfield) == str(field) for field in
> list_of_field_objects)
>
> Anthony
>
>
> On Thursday, December 11, 2014 9:51:44 AM UTC-5, Massimiliano wrote:
>>
>> Is there a way to know if a field is involved in a query inspecting the
>> query object?
>>
>> Thank you
>> --
>> Massimiliano
>>
>  --
> 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.
>



-- 
Massimiliano

-- 
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] append script with no extension

2014-12-24 Thread Massimiliano
Maybe using a block in the head of template?

On Wed, Dec 24, 2014 at 10:54 AM, Manuele Pesenti  wrote:

>  Hi!
> Is there a way to include this url as a script using response.files.append
> method (or something similar)?
>
> http://maps.google.com/maps/api/js?v=3&amp;sensor=false"</a>;
> <<a  rel="nofollow" href="http://maps.google.com/maps/api/js?v=3&amp;sensor=false">http://maps.google.com/maps/api/js?v=3&amp;sensor=false</a>>>
>
> The problem seams to be that it got no extension so it's not recognized
> from the include_files method of the response.
>
> Thanks
>
> Manuele
>
> --
> 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.
>



-- 
Massimiliano

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


  1   2   3   >