[web2py] Re: Web2py and multiple controller

2018-02-09 Thread Anthony
On Friday, February 9, 2018 at 11:22:45 AM UTC-5, Leonel Câmara wrote:
>
> No I would like multiple controller functions per file, but I would like 
> to be able to have directories inside the controllers directory, basically 
> have controller packages.
>

Got it. My question was actually addressed to Alessio, though.

Anthony 

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


[web2py] Re: Intersection of rows

2018-02-09 Thread Anthony

>
> Anyway, given your code, it looks like we would not expect any results in 
>> the intersection of the two Rows objects, as the conditions of each query 
>> are mutually exclusive (i.e., "waypoint" either equals X or Y). Of course, 
>> if X == Y, then the two sets of Rows are identical, but I assume that isn't 
>> generally the case.
>>
>>
> A segment row will only have one waypoint, but multiple segment rows may 
> have the same parent run.  I chose to make the run table very simple (and 
> in particular, not to have a list of children), but the segment table 
> points upward to the run.
>

Your code doesn't show which columns are selected -- I suppose you are 
saying the "waypoint" column is *not *selected.

Anthony

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


Re: [web2py] Re: SERVICE_PAUSED

2018-02-09 Thread Jim Steil
Great news

Just noticed a message at the top of the nssm download page saying that if
you're using windows 10 Creators Update that you need to use the
pre-release build.

http://www.nssm.cc/download

I'm guessing that might have something to do with your problem.

-Jim



On Fri, Feb 9, 2018 at 2:38 PM, Andrea Fae'  wrote:

> It seems that the version \nssm-2.24-101-g897c7ad\win64\ is working
>
>
>
> Il giorno venerdì 9 febbraio 2018 20:49:01 UTC+1, Andrea Fae' ha scritto:
>>
>> I tried with the version suggested in the nssm site. I have the last
>> version of windows 10.
>> But the problem remains the same...can anyone help me to fix?
>> Thank you
>>
>> Il giorno giovedì 8 febbraio 2018 21:34:30 UTC+1, Andrea Fae' ha scritto:
>>>
>>> c:\data\nssm-2.24\win64>nssm.exe start web2py_scheduler_test
>>> web2py_scheduler_test: START: Operazione completata.
>>>
>>> c:\data\nssm-2.24\win64>nssm.exe status web2py_scheduler_test
>>> SERVICE_PAUSED
>>>
>>> c:\data\nssm-2.24\win64>
>>>
>>> Why? I'm following exactly the instructions given in the web2py guide...
>>>
>>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/ZntIw_YZyDI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [web2py] Re: code written by Massimo Di Pierro in the web2py video tutorial

2018-02-09 Thread Jim Steil
Ok, that helps.  Are you having a particular problem?

-Jim

On Fri, Feb 9, 2018 at 2:36 PM, Andrea Fae'  wrote:

> https://www.youtube.com/watch?v=dHu8O1gZOl0
>
> there are 4 parts in youtube
>
> Il giorno venerdì 9 febbraio 2018 20:51:11 UTC+1, Jim S ha scritto:
>>
>> Could you provide a link to the tutorials that you're talking about?
>>
>> -Jim
>>
>> On Fri, Feb 9, 2018 at 1:47 PM, Andrea Fae'  wrote:
>>
>>> every
>>>
>>> Il giorno giovedì 8 febbraio 2018 21:44:13 UTC+1, Jim S ha scritto:

 Which tutorials?

 Are you running into a particular problem?

 I'm thinking most of those tutorials are getting a little old but
 should still work.

 -Jim

 On Wednesday, February 7, 2018 at 1:52:28 PM UTC-6, Andrea Fae' wrote:
>
> Hello, it would be a great thing to have a document with the code
> written by Massimo in the video tutorials...
> 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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/web2py/CeXLuF6S1FE/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/CeXLuF6S1FE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: SERVICE_PAUSED

2018-02-09 Thread Andrea Fae'
It seems that the version \nssm-2.24-101-g897c7ad\win64\ is working



Il giorno venerdì 9 febbraio 2018 20:49:01 UTC+1, Andrea Fae' ha scritto:
>
> I tried with the version suggested in the nssm site. I have the last 
> version of windows 10.
> But the problem remains the same...can anyone help me to fix?
> Thank you
>
> Il giorno giovedì 8 febbraio 2018 21:34:30 UTC+1, Andrea Fae' ha scritto:
>>
>> c:\data\nssm-2.24\win64>nssm.exe start web2py_scheduler_test
>> web2py_scheduler_test: START: Operazione completata.
>>
>> c:\data\nssm-2.24\win64>nssm.exe status web2py_scheduler_test
>> SERVICE_PAUSED
>>
>> c:\data\nssm-2.24\win64>
>>
>> Why? I'm following exactly the instructions given in the web2py guide...
>>
>>

-- 
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: code written by Massimo Di Pierro in the web2py video tutorial

2018-02-09 Thread Andrea Fae'
https://www.youtube.com/watch?v=dHu8O1gZOl0

there are 4 parts in youtube

Il giorno venerdì 9 febbraio 2018 20:51:11 UTC+1, Jim S ha scritto:
>
> Could you provide a link to the tutorials that you're talking about?
>
> -Jim
>
> On Fri, Feb 9, 2018 at 1:47 PM, Andrea Fae'  > wrote:
>
>> every
>>
>> Il giorno giovedì 8 febbraio 2018 21:44:13 UTC+1, Jim S ha scritto:
>>>
>>> Which tutorials?  
>>>
>>> Are you running into a particular problem?
>>>
>>> I'm thinking most of those tutorials are getting a little old but should 
>>> still work.
>>>
>>> -Jim
>>>
>>> On Wednesday, February 7, 2018 at 1:52:28 PM UTC-6, Andrea Fae' wrote:

 Hello, it would be a great thing to have a document with the code 
 written by Massimo in the video tutorials...
 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/CeXLuF6S1FE/unsubscribe.
>> To unsubscribe from this group and all its topics, 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.


[web2py] Re: SERVICE_PAUSED

2018-02-09 Thread Jim S
What did you use for:

-Application
Path
Startup Directory
Arguments

-Log on

When you ran:

nssm install web2py_scheduler_test

-Jim



On Friday, February 9, 2018 at 1:49:01 PM UTC-6, Andrea Fae' wrote:
>
> I tried with the version suggested in the nssm site. I have the last 
> version of windows 10.
> But the problem remains the same...can anyone help me to fix?
> Thank you
>
> Il giorno giovedì 8 febbraio 2018 21:34:30 UTC+1, Andrea Fae' ha scritto:
>>
>> c:\data\nssm-2.24\win64>nssm.exe start web2py_scheduler_test
>> web2py_scheduler_test: START: Operazione completata.
>>
>> c:\data\nssm-2.24\win64>nssm.exe status web2py_scheduler_test
>> SERVICE_PAUSED
>>
>> c:\data\nssm-2.24\win64>
>>
>> Why? I'm following exactly the instructions given in the web2py guide...
>>
>>

-- 
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: code written by Massimo Di Pierro in the web2py video tutorial

2018-02-09 Thread Jim Steil
Could you provide a link to the tutorials that you're talking about?

-Jim

On Fri, Feb 9, 2018 at 1:47 PM, Andrea Fae'  wrote:

> every
>
> Il giorno giovedì 8 febbraio 2018 21:44:13 UTC+1, Jim S ha scritto:
>>
>> Which tutorials?
>>
>> Are you running into a particular problem?
>>
>> I'm thinking most of those tutorials are getting a little old but should
>> still work.
>>
>> -Jim
>>
>> On Wednesday, February 7, 2018 at 1:52:28 PM UTC-6, Andrea Fae' wrote:
>>>
>>> Hello, it would be a great thing to have a document with the code
>>> written by Massimo in the video tutorials...
>>> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/CeXLuF6S1FE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: SERVICE_PAUSED

2018-02-09 Thread Andrea Fae'
I tried with the version suggested in the nssm site. I have the last 
version of windows 10.
But the problem remains the same...can anyone help me to fix?
Thank you

Il giorno giovedì 8 febbraio 2018 21:34:30 UTC+1, Andrea Fae' ha scritto:
>
> c:\data\nssm-2.24\win64>nssm.exe start web2py_scheduler_test
> web2py_scheduler_test: START: Operazione completata.
>
> c:\data\nssm-2.24\win64>nssm.exe status web2py_scheduler_test
> SERVICE_PAUSED
>
> c:\data\nssm-2.24\win64>
>
> Why? I'm following exactly the instructions given in the web2py guide...
>
>

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


[web2py] Re: Intersection of rows

2018-02-09 Thread Dave S


On Thursday, February 8, 2018 at 6:23:59 PM UTC-8, Anthony wrote:
>
> Looks like the book is wrong -- according to the code, rows1 & rows2 
> simply combines the records from each Rows object -- it does not find the 
> intersection.
>

Okay, then my results match that!
 

> Anyway, given your code, it looks like we would not expect any results in 
> the intersection of the two Rows objects, as the conditions of each query 
> are mutually exclusive (i.e., "waypoint" either equals X or Y). Of course, 
> if X == Y, then the two sets of Rows are identical, but I assume that isn't 
> generally the case.
>
>
A segment row will only have one waypoint, but multiple segment rows may 
have the same parent run.  I chose to make the run table very simple (and 
in particular, not to have a list of children), but the segment table 
points upward to the run.

If you do really have non-mutually-exclusive results, why not just generate 
> the intersection with the SQL query (i.e., query1 & query2)?
>
>
I'm not very sophisticated at joining in.
 

> Also, note, you queries should use "==", not a single "=".
>
>
erk
 

> Anthony
>
>
/dps
 

> On Tuesday, February 6, 2018 at 4:57:29 PM UTC-5, Dave S wrote:
>>
>> I have an application (used for comparing routes) with 2 tables relevant 
>> to this question.  (Paraphrasing; code is at home,
>> where the router jammed.)
>>
>> db.define_table('run',
>>Field('when', 'date'),
>>Field('description', 'string))
>>
>> db.define_table('segment',
>>Field('waypoint', 'string'),
>> Field('timeofday', 'time'),
>>Field('odometer', 'decimal'),
>>Field('partof', 'reference run'))
>>
>> I wanted to find the runs that had X as a waypoint and also had Y as a 
>> waypoint, so I looked at
>> > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Combining-rows
>> >
>> and wrote:
>>
>> def fromto():
>> # not shown -- X and Y from request.vars
>> q1 = db.segment.waypoint = X
>> q2 = db.segment.waypoint = Y
>> runs1 = db(run.id == segment.partof & q1).select(...,distinct=True)
>> runs2 = db(run.id == segment.partof & q2).select(...,distinct=True)
>> theruns = runs1 & runs2
>> print len(runs1) + len(runs2) + len(theruns)
>> return ("runs" = theruns)
>>
>> For the first waypoints I tried, the print produced counts of 111 10  121
>> which is clearly NOT the intersection.  (I have verified that theruns 
>> includes  runs where Y is not included,
>> and the page shows the Y runs at the end of the X runs (that is, 
>> appended).)
>>
>> If I go for union ('|' in line 7), the counts are 111 10 112.
>> (1 Y run did not go through X).
>>
>> I add the "distinct=True" after the first attempt, in case multiple 
>> appearances of a row was confusing things.   It made no apparent difference.
>>
>> I think this is on 2.14.6; I may be able to test newer web2py's tonight.  
>> Am I doing something wrong, or was there a hiccup in intersection?
>>
>> Dave S
>> /dps
>>
>>

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


[web2py] Re: code written by Massimo Di Pierro in the web2py video tutorial

2018-02-09 Thread Andrea Fae'
every

Il giorno giovedì 8 febbraio 2018 21:44:13 UTC+1, Jim S ha scritto:
>
> Which tutorials?  
>
> Are you running into a particular problem?
>
> I'm thinking most of those tutorials are getting a little old but should 
> still work.
>
> -Jim
>
> On Wednesday, February 7, 2018 at 1:52:28 PM UTC-6, Andrea Fae' wrote:
>>
>> Hello, it would be a great thing to have a document with the code written 
>> by Massimo in the video tutorials...
>> thank you
>>
>

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


[web2py] Re: date picker in modal not work

2018-02-09 Thread Luis Sucuc

The best solution will be to use another library. I tried it and it works 
correctly.
¡Thank you!
El viernes, 9 de febrero de 2018, 10:42:50 (UTC-6), Leonel Câmara escribió:
>
> It's appending the calendar element to the body instead of the form-group, 
> you will probably have to fix the included calendar not to do that or use 
> another calendar (like bootstrap datepicker) if you're going to use it in a 
> modal..
>

-- 
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] Auto authentification using PAM or LDAP

2018-02-09 Thread J-Michel Angers
I'm developping an workflow application, to create documents (or needs or 
purchase requests..) that have to be validated by many users.
This appli will work in an intranet. The user are authentified thru an AD.

I have 2 questions, 2 needs :
First one, due to the AD and internal policy, users always work with an 
authentification ; they start the PC and type login, and so on. Impossible 
to start a tool without authenticate. This appli is an internal appli, not 
reachable form outside.
Question : is it possible to run the appli, create document, validate 
document by getting the ID of the user on the network ( on the AD), 
without displaying a "login" screen ?
We already have to type login and password again for each tool we run, 
login again and again, while we are already authenticated.

Second one : for each step of this process (on documents), the system has 
to send email to many users (the one who created the document, the next one 
that will have to validate). I already know the ID of all users of this 
workflow, I have to request the AD to know the email address.
... today it works thru a view in SQL-server ==> 
  SELECT sAMAccountName AS Login, Name AS Nom_Complet, mail AS Adresse_Mail 
FROM OPENQUERY(ADSI, 
 'SELECT sAMAccountName, Name ,mail,  userAccountControl   FROM  
''LDAP://xxx.dom/OU="Comptes XXX",DC=xxx,DC=dom'' WHERE objectClass =  
''User'' ')
  AS tblADSI
 WHERE(userAccountControl = 512)
 I'd prefer do this directly from my app.

Thanks in advance 

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


[web2py] Re: date picker in modal not work

2018-02-09 Thread Leonel Câmara
It's appending the calendar element to the body instead of the form-group, 
you will probably have to fix the included calendar not to do that or use 
another calendar (like bootstrap datepicker) if you're going to use it in a 
modal..

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


[web2py] Re: Web2py and multiple controller

2018-02-09 Thread Leonel Câmara
No I would like multiple controller functions per file, but I would like to 
be able to have directories inside the controllers directory, basically 
have controller packages.

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


[web2py] Re: date picker in modal not work

2018-02-09 Thread Luis Sucuc
This does not work, I get the same result. :(




El viernes, 9 de febrero de 2018, 9:54:48 (UTC-6), Leonel Câmara escribió:
>
> This is a css problem, the calendar is positioning absolutely relative to 
> the body instead of to where you placed the widget. Try a 
> style="position:relative;" on that form group.
>

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


[web2py] Re: date picker in modal not work

2018-02-09 Thread Leonel Câmara
This is a css problem, the calendar is positioning absolutely relative to 
the body instead of to where you placed the widget. Try a 
style="position:relative;" on that form group.

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


[web2py] Re: Web2py and multiple controller

2018-02-09 Thread Anthony
On Friday, February 9, 2018 at 4:18:19 AM UTC-5, Alessio Varalta wrote:
>
> Yes you have many controller if you have for example index, show, delete, 
> update in one file for one entity for example person eccbut many files 
> controller in folder is not a problem..for example you can have the folder 
> person with all file relates to person contact, address ecc...so is not a 
> problem to have many files because you have a logic order and a tree view
>

Are you saying you would want just one controller function per controller 
file?

-- 
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: Bug with auth.settings.table_user_name and auth.signature?

2018-02-09 Thread Marvi Benedet
found the solutions:

in* auth.extra_fields* there are some tables that are reference to other
tables.
so I moved this settings and the

auth.define_tables(username=False, signature=False)

at the bottom. Seems that resolved all the troubles.




2018-02-09 13:42 GMT+01:00 Marvi Benedet :

> I'm trying it on a more complex application, where I have also some extra
> fields in the users table:
>
> auth.settings.extra_fields['users']= [.]
>
> but unfortunatly  this could be the cause that lead to problems...
>
> By the way, is there a way to check if the current state of tables/fields
> on the db is matching what is defined in the web2py model?
> After some tests with "fake_migrate" It's easy to loose the match..
>
> Thanks!
>
> 2018-02-08 16:55 GMT+01:00 Marvi Benedet :
>
>> Yes, It worked!
>>
>> thanks!
>>
>> 2018-02-07 17:14 GMT+01:00 Leonel Câmara :
>>
>>> This is sort of a bug, but one that is probably kept for backwards
>>> compatibility reasons.
>>>
>>> You can make your example code work by doing this:
>>>
>>> auth = Auth(db, host_names=configuration.get('host.names'), signature=
>>> False)
>>> auth.settings.table_user_name = 'users'
>>> auth.define_tables(username=False, signature=False) # this also calls
>>> define_signature
>>>
>>> db.define_table('tests',
>>> Field('name', length=100, requires=IS_NOT_EMPTY()),
>>> auth.signature,
>>> format='%(name)s',
>>> )
>>>
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

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


[web2py] date picker in modal not work

2018-02-09 Thread Luis Sucuc

I have a LOAD with a modal. But when using the input with class = "... 
date" the following happens.





I tried to use the elements directly within the modal without the LOAD. But 
I get the same result.

This is the input code.




 {{=T('Finish date')}}
 
 
 






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


[web2py] Re: $.web2py.componet not work

2018-02-09 Thread Luis Sucuc
My element had

  

That was the problem. 
I think he was very stressed and tired to see something so obvious.


El viernes, 9 de febrero de 2018, 5:23:01 (UTC-6), Leonel Câmara escribió:
>
> You don't have an html element with id="contain-to-order" when you are 
> running this code.
>

-- 
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: Bug with auth.settings.table_user_name and auth.signature?

2018-02-09 Thread Marvi Benedet
I'm trying it on a more complex application, where I have also some extra
fields in the users table:

auth.settings.extra_fields['users']= [.]

but unfortunatly  this could be the cause that lead to problems...

By the way, is there a way to check if the current state of tables/fields
on the db is matching what is defined in the web2py model?
After some tests with "fake_migrate" It's easy to loose the match..

Thanks!

2018-02-08 16:55 GMT+01:00 Marvi Benedet :

> Yes, It worked!
>
> thanks!
>
> 2018-02-07 17:14 GMT+01:00 Leonel Câmara :
>
>> This is sort of a bug, but one that is probably kept for backwards
>> compatibility reasons.
>>
>> You can make your example code work by doing this:
>>
>> auth = Auth(db, host_names=configuration.get('host.names'), signature=
>> False)
>> auth.settings.table_user_name = 'users'
>> auth.define_tables(username=False, signature=False) # this also calls
>> define_signature
>>
>> db.define_table('tests',
>> Field('name', length=100, requires=IS_NOT_EMPTY()),
>> auth.signature,
>> format='%(name)s',
>> )
>>
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


[web2py] Re: $.web2py.componet not work

2018-02-09 Thread Leonel Câmara
You don't have an html element with id="contain-to-order" when you are 
running this code.

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


[web2py] Re: Web2py and multiple controller

2018-02-09 Thread Leonel Câmara
Anthony generally I like to separate backoffice/management functions from 
front office actions. So one hierarchy I like to do is to have a "manage" 
controller, then I have a controller for each entity that will be managed. 
So I would like to do something like:

# these are all controller functions for front office actions
persons.py
cars.py
# then I would like to have the controllers for back office stuff
manage/persons.py
manage/cars.py

It's true that one can always move the back office to completely separate 
application, but that introduces problems of code duplication or deploy 
complexity when almost everything is shared between the backoffice and the 
front.

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


[web2py] Re: Problem with cookies shared through multiple domains and multiple apps

2018-02-09 Thread Lisandro
I marked this thread as "no action needed", because I opened another thread 
where I reproduce the problem from scratch, using a fresh new web2py 
install and a couple of example apps:
https://groups.google.com/forum/#!topic/web2py/ZfmJnyNvmio

Notice the issue could be related to this:
https://groups.google.com/forum/#!msg/web2py/SuOW_6bDOfA/hnmWRvsKFQAJ

El miércoles, 7 de febrero de 2018, 21:11:07 (UTC-3), Lisandro escribió:
>
> Hi there! I'm having this issue I would like to share with you, I hope to 
> find a solution.
>
> *This is the scenario*:
>
>  - Two different apps, let's call them *development* and 
> *development_panel*
> * - *Both apps uses the *same model* (shared through symlinks)
>  - *development* app is served at *development.com 
> *
> * - **development**_panel* app is served at *panel.**development**.com*
>  - Login is done in *development**_panel* app and cookie is shared for 
> *development* app (so, the visitor logs in at *panel.**development**.com* and 
> that cookie is shared also with *development**.com*)
>
>
> *How does it work?*
>
> First, I have the domains mapped to apps within my routes.py
>
> routers = dict(
>   BASE=dict(
> default_controller='default',
> default_function='index',
> domains={
> 'development.com': 'development',
> 'panel.development.com': development_panel,
> },
> map_static=True,
> exclusive_domain=True,
>   )
> )
>
> Notice exclusive_domain=True, meaning that each app can be accessed only 
> through the specificed domain, and not from another one. This works like a 
> charm.
>
>
> Second, the db.py file is defined in one app, and symlinked from the other 
> one. The "databases" folder was moved out from inside the app folder, so it 
> is specified when instantiating DAL:
>
> db = DAL(
> 'postgres://%s:%s@%s/%s' % (CONFIG.db_user, CONFIG.db_user_password,
>  CONFIG.db_host, CONFIG.db_name),
> migrate=False,
> lazy_tables=True,
> folder=CONFIG.databases_folder)
>
>
> Third, both apps connect to the session specifying *development* as the 
> *masterapp*:
>
> session.connect(request, response, db=db, masterapp='development')
>
>
> Fourth and last, this code is right after session.connect, and it's the 
> one that makes the magic. 
> This two lines of code are the ones needed in order to share the login 
> session between the two apps:
>
> if response.session_id_name in response.cookies:
> response.cookies[response.session_id_name]['domain'] = 'development
> .com'
>
>
> Now, remember the login is done in *development_panel* and *development* is 
> defined as the masterapp. Well, all this is working ok, I have several 
> websites running this way (every website has its own domain and its 
> couple of apps installed, served the same way as the example I exposed). 
> However, *very few customers are reporting they can't login*. Actually, 
> they login successfully to the panel, but then they go to the main domain 
> and they aren't logged in anymore. That is, the cookie is being written but 
> not read (not shared across domains). This happens only on a specific 
> subset of devices and browsers (so far, it's been reported to happen a lot 
> in Safari for iPhone).
>
> As I said, the current approach is working for the vast majority of 
> customers. However, as some of them reported the problem, I wanted to check 
> the cookies. And that's when I saw all this mess, or at least I think it's 
> a mess.
> Having erased all cookies from the browser, without being logged in, I go 
> to the login page at *panel.development.com 
> * and this is what I see in the cookies:
>
>
> 
>
>
>
> I can already see a strange cookie "*session_id_development_panel*" that 
> I don't know where it comes from.
>
> I checked the gluon/globals.py code to see where is that name generated:
>
> https://github.com/web2py/web2py/blob/master/gluon/globals.py#L846
>
>
> Notice it uses the *masterapp* to generate that name, and if you check my 
> previous code, you will see that I connect to the session using 
> masterapp='development'.
>
> So where does *session_id_development_panel* comes from?
>
>
> What is more weird is this: after a successfull login, the app takes me to 
> the main domain, and there I see these cookies:
>
>
>
> 
>
>
>
> *Notice the duplicated cookie name with different values*. Where does it 
> come from?
>
>
> Now that I see all this, I'm starting to think that the problem reported 
> by some customers is produced by this cookie mess. 
>
> Somehow Chrome, Firefox and Edge don't complain about this and it works 
> ok. However some browsers don't like this, and refuse to share the cookie.
>
>
> Any 

[web2py] Incorrect cookie being sent when mapping domains into apps (possible bug?)

2018-02-09 Thread Lisandro
Hi there! I've run into this situation that looks like a bug. 
I've found the problem when trying to make two apps share the sessions 
(storing sessions in files or in database). But the problem only happens 
when I use parametter-based router in order to exclusively map domains to 
apps. 
I've been able to reproduce it from scratch using web2py last stable 
version (2.16.1). Here are the steps I follow to reproduce the problem:


1) Download and unzip web2py

2) From the admin app, create two new apps: *test* and *test_panel*

3) As we need the two apps to use the same database, delete 
applications/test_panel/models/db.py and replace it by a symlink pointing 
to applications/test/models/db.py

4) In models/db.py add this line right after instantiating DAL, in order to 
connect to the session:

session.connect(request, response, cookie_key='mycookiekey', masterapp=
'test')

Notice the "masterapp" argument is pointing to the "test". 
Remember both apps use the same model (symlinked). 

5) The login/register/logout will be done in "test" app. For the sake of 
this example, we won't make anymore changes to the apps (we would have to 
delete the login/register/logout functions at *test_panel* app, as the 
login will be done only in *test* app, but it's not necessary for this 
example). Notice the only change we did is "session.connect" in the model, 
nothing more.


*Up to here, it works like a charm*. I can login in *test* app, and then I 
go to *test_panel* app and I can see that I'm logged in.
If I inspect the request cookies when accessing *test_panel* app, I can see 
there are a couple of cookies sent:

session_id_test
session_data_test
session_id_test_panel
session_id_admin

The important part here is that the "session_data_test" cookie is sent, 
that is, the cookie that was written when I logged in at *test* app.

So, everything works ok here. Both apps are sharing cookie sessions.
However, *the problem appears if we want to access test app in the main 
domain and test_app in a subdomain*.
Here is the steps to reproduce the problem:


6) Create a routes.py file at the web2py root folder, and put this content:

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

routers = dict(
  BASE=dict(
default_controller='default',
default_function='index',
domains={
'test.com':'test',
'panel.test.com': 'test_panel'
},
exclusive_domain=True,
  )
)


7) Edit the /etc/hosts file and add both domains as localhost: *test.com* 
and *panel.test.com*. This way, each app can be accessed only through the 
specified domain.

*This is where the problem appears.* Apps no longer share sessions. 
I login at test.com (remember to use the 8000 port or whatever port you 
used to start web2py's embedded server).
Then I go to panel.test.com, inspect the request cookies and I see this 
cookies are being sent:

session_id_test
session_id_test_panel

Notice there is no "session_data_test" cookie being sent, that's why I'm 
not logged in when I go to panel.test.com.


*This problem is the same when the sessions are stored in database*. In 
order to make that test, just replace session.connect with this:

session.connect(request, response, db=db, masterapp='test')

The problem is the same. Sessions are correctly shared, but in the moment 
you configure routes.py to map each app to a specific domain, cookies 
aren't shared anymore.
Is this the expected behaviour or could it be a bug?

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


[web2py] Re: Help with cascading drop down list

2018-02-09 Thread 'Matthew J Watts' via web2py-users
Thanks for your reponse David!

On Thursday, February 8, 2018 at 8:56:19 PM UTC+1, Dave S wrote:
>
>
>
> On Thursday, February 8, 2018 at 9:55:25 AM UTC-8, Matthew J Watts wrote:
>>
>> Hi community
>>
>> I'm having a few problems trying to understand how create a cascading 
>> drop down list. I've followed this recipe -
>>
>>
>> http://www.web2pyslices.com/slice/show/1526/cascading-drop-down-lists-with-ajax-2
>>
>> i've managed to adapt it slightly, but i'm having trouble trying to add 
>> more tables to the cascade/sequence 
>>
>
> I'm not much of a menu person (I make use of ordinary anchor links for the 
> most part), but that example was probably written when BootStrap2 was the 
> css/javascript in use.  Currently,  web2py ships with BootStrap3, which 
> doesn't support more than 1 level of submenus.  If you use stupid.css (as 
> in applications/example), you might not have that limitation, but I can't 
> show you what you want.
>
>
>> It is quite difficult for me (a beginner) to suss out the logic behind it
>>
>>
> Menus typically control what is shown by using javascript to manipulate 
> CSS.  Simple menus may be CSS only, but then they'd be statically defined.  
>
> Good luck!
>
> /dps
>
>  
>
>> So at the moment i have the code below, what i'm trying to do is return a 
>> list of values from  the "tax_class" table, based  on a selection from 
>> the "tax_phylum" table( based on sececting an entry  from the kingdom 
>> table)
>>
>> *model*
>>
>> db.define_table('tax_kingdom',
>> Field('name'))
>>
>> db.define_table('tax_phylum',
>> Field('name', 'string'),
>> Field('kingdom_id'))
>> db.tax_phylum.kingdom_id.requires = IS_IN_DB(db, db.tax_kingdom.id, 
>> '%(name)s')
>>
>> db.define_table('tax_class',
>> Field('name', 'string'),
>> Field('phylum_id'))
>> db.tax_class.phylum_id.requires = IS_IN_DB(db, db.tax_phylum.id, '%(name)s')
>>
>>
>> *Controller*
>>
>> def index():
>> kingdoms = db().select(db.tax_kingdom.ALL)
>>
>> if request.vars.kingdom_name:
>> phylum_select = db(db.tax_phylum.id == 
>> request.vars.kingdom_name).select(db.tax_phylum.ALL)
>> else:
>> phylum_select = db(db.tax_phylum.id == 1).select(db.tax_phylum.ALL)
>> return dict(kingdoms=kingdoms, phylum_select=phylum_select)
>>
>>
>> def phylum():
>> phylums = db(db.tax_phylum.kingdom_id == 
>> request.vars.kingdom_name).select(db.tax_phylum.ALL)
>> result = ""
>> for p in phylums:
>> result += "" + p.name + ""
>> return XML(result)
>>
>>
>>
>> *view*
>>
>>
>>
>> {{extend 'layout.html'}}
>>
>> 
>> > onchange="jQuery('#kingdom_name').empty();
>> ajax('phylum', ['kingdom_name'], 'phylum_name');">
>> {{for kingdom in kingdoms:}}
>> > {{=" selected='selected'" if 
>> str(kingdom.id)==request.vars.kingdom_name else ""}}>
>> {{=kingdom.name}}
>> 
>> {{pass}}
>> 
>>
>>
>> 
>> 
>> {{for phylum in phylum_select:}}
>> > {{=XML(" selected='selected'") if 
>> str(phylum.id)==request.vars.phylum_name else ""}}>
>> {{=phylum.name}}
>> {{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.


[web2py] Just a silly thread to say... thanks to all web2py developers team

2018-02-09 Thread Jaime Sempere
Hi,

this is gonna sound a littile silly, but I have been wanting to publish a 
thread like this from years ago.

I just wanna say to Massimo and all the web2py developers one thing: 
thanks. Thanks a lot.

I love web2py and I enjoy programming and developing with it.

I can notice all the effort and all the work you have made to create a 
super simple, easy, fun, and good programmed framework for web2py.

Everytime I need to develop a new personal project, I always choose web2py 
if I can.

I see magic and simplicity in every aspect of web2py. I could not imagine a 
quicker framework than web2py.

And everytime I need to do something new, when I look to the book, I always 
find a very easy and simple way to do it. And that's something I love: I 
find that you have worked a lot to build something simple and powerful. 
Programming should be like that: simple, non verbose, and fun.

And by the way, vim and web2py make a wonderful team. I feel like a super 
fanatic boy of both of them...

Well I do not know if this sounds too foolish, but I just want to say to 
all the members that made and make web2py a solid framework that: thanks, 
my respects and keep making this framework a reality.

Plus, this group is wonderful support.

Well, that's enough. For a last time, thanks to all of you.

Jaime

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


[web2py] Re: Web2py and multiple controller

2018-02-09 Thread Alessio Varalta
Yes you have many controller if you have for example index, show, delete, 
update eccbut many files controller in folder is not a problem..for 
example you have the folder person with all file relates to person contact, 
address ecc...so is not a problem to have many files because you have a 
logic order

On Friday, 9 February 2018 02:59:43 UTC+1, Anthony wrote:
>
> On Thursday, February 8, 2018 at 4:00:48 AM UTC-5, Alessio Varalta wrote:
>>
>> I have a new project and I have to choose if web2py is the right 
>> framework.
>> My doubt is about the structure of a web2py application.
>> You canno't have subfolder right?
>> So you can put the major of the code in the module and this is ok, but a 
>> the controller level you have:
>>
>> Many and Many Controller in one files that can have nothing in common
>>
>> or 
>>
>> Many and Many files for multiple controller all in the root directory
>>
>
> The idea is that a controller includes a set of actions that are somehow 
> related (in particular, a set of actions that you might want nested within 
> a particular URL path). If you took that approach, how many controller 
> files do you think you would end up with? What is an example module 
> hierarchy that you would want that you don't think you could achieve with a 
> reasonable combination of controller files, actions, and optionally URL 
> args within actions?
>
> Anthony
>

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