Re: [web2py] Timeout for data entry screens: Help!

2021-01-29 Thread John Bannister
What database are you using?

On Fri, 29 Jan 2021 at 16:12, Massimiliano  wrote:

> Reading better you message, I'm not sure that auth.settings.expiration is
> what you need.
> Sorry
>
> Il giorno ven 29 gen 2021 alle ore 16:10 Massimiliano 
> ha scritto:
>
>> You can set:
>>
>> auth.settings.expiration
>>
>> Value are in seconds. So 86400 is one day,
>>
>>
>>
>> Il giorno ven 29 gen 2021 alle ore 14:42 Davidiam <
>> david.rosa...@gmail.com> ha scritto:
>>
>>> 2.18.5-stable+timestamp.2019.04.08.04.22.03
>>> (Running on Microsoft-IIS/10.0, Python 3.6.8)
>>>
>>> Hello,
>>>
>>> We built some web2py applications and we are now getting feedback from
>>> the users that if they don't save their data entry screen data within about
>>> 10 minutes, that the save fails and they have to re-enter all their data.
>>> As they often get interruptions while entering data, this is becoming a bit
>>> of a problem.
>>>
>>> Can this "timeout" be modified to give them more time?  Is this coming
>>> from web2py or would this me more an infrastructure issue?
>>>
>>> Thanks in advance for any replies!
>>> David
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/c389ecc4-0693-438d-ae89-ef01660dfb34n%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CANPTPxJ3YT9onfb2nfb%3D%3D5OSbxpgQoyJbGvg_u6bV2ha-ND1XA%40mail.gmail.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAGvnVuYHmEnPjQY1cm5gsdESqw%2B6MAnKh6dh1B8rS4jAnCZzOA%40mail.gmail.com.


[web2py] Re: Why web2py App performance has degraded all of sudden with SQLLITE

2020-05-02 Thread John Bannister
Hi Sandeep,

Would be good if you can supply a bit more information in order to help you 
find the solution.

questions:
1: Has your database grown recently?
2: Is web2py slow on all queries or just on some tables? 
3: Can you use _lasesql to see your sql calls and timings?
4: Are you using SQLFORM.grid or custom forms to do your queries?
5: Some genric idea of what you are trying to do?

BR
John 



On Saturday, 2 May 2020 12:20:44 UTC+2, Sandeep Bondre wrote:
>
> I do not see a solution to this problem .
>
> Can some one really help what is the solution to this 
>
> Regards
>
> Sandeep
> sandee...@gmail.com 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c0e4a748-b21a-4fcf-9afb-ab1206da0218%40googlegroups.com.


RE: [web2py] Re: Py4web readonly Form

2020-03-21 Thread John Bannister
Hi Massimo,

 

My use case is really to give the user the option to view data stored in a 
table without the ability to change anything hence readonly. Once they have 
finished viewing the form (normally by hitting the submit button) they will be 
redirected to whatever.

 

Hope it makes sense

John

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 21 March 2020 07:36
To: web2py-users
Subject: [web2py] Re: Py4web readonly Form

 

You may be right but what is the meaning of submitting and accepting a readonly 
form? What is a use case?


On Friday, 6 March 2020 00:53:17 UTC-8, John Bannister wrote:

Hi All,

 

I have been testing Py4web and have the following to produce basically a 'view 
record' option :-

 

def view_test():

form=Form(db.auth_user, record=1, readonly=True, deletable=False, 
formstyle=FormStyleBulma)

if form.accepted:

redirect(URL('index'))

return dict(form=form)

 

This will redirect if I remove the readonly=True from the form but basically 
form is just displayed (all fields are readonly) and you can hit the submit 
button as many times as you like and nothing will happen.

 

Any ideas??

 

BR

John

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2089781a-8a2e-4b62-90d4-98a6183b375b%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/2089781a-8a2e-4b62-90d4-98a6183b375b%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/033e01d5ff58%2453f3f700%24fbdbe500%24%40gmail.com.


[web2py] Py4Web fields of type 'upload' not working

2020-03-09 Thread John Bannister
Hi All,

Still struggling a lot with fields of type 'upload'. Whatever I try the 
field remains None. Any help greatly appreciated.

Typical use case is as follows:

Model:
db.define_table('test',
Field('f_name'),
Field('l_name'),
Field('image', 'upload', default='test'))

Controller:
@action('test', method=['GET','POST'])
@action.uses('generic.html', session, db, T)
def test():
page_title = 'Test'
messages=[]
my_dict = request.query.decode()
post_vars = request.forms
form=Form(db.test)
print ('Form vars before are %s' % form.vars)
if form.accepted:
print('inside form accepted')
print ('Form vars are %s' % form.vars)
elif form.errors:
messages.append('form %s has errors: %s ' % (form.form_name, 
form.errors))
return dict(form=form, page_title=page_title, messages=messages)

All fields/form.vars etc are okay except for image which is always None.

All help greatly appreciated
John

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/727d310d-2284-431e-9535-d80693756db0%40googlegroups.com.


[web2py] Py4web working with images

2020-03-07 Thread John Bannister
Hi All,

Has anyone got a working exsmple of working with images in Py4Web 
preferrably with thumbnails as well?

Thanks in advance 
John

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1fce59dd-ff63-4b5d-83ef-d99363e59f90%40googlegroups.com.


[web2py] Py4web readonly Form

2020-03-06 Thread John Bannister
Hi All,

I have been testing Py4web and have the following to produce basically a 
'view record' option :-

def view_test():
form=Form(db.auth_user, record=1, readonly=True, deletable=False, 
formstyle=FormStyleBulma)
if form.accepted:
redirect(URL('index'))
return dict(form=form)

This will redirect if I remove the readonly=True from the form but 
basically form is just displayed (all fields are readonly) and you can hit 
the submit button as many times as you like and nothing will happen.

Any ideas??

BR
John

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/75b018fb-f3b6-47a4-8b50-fec32d8740ae%40googlegroups.com.


RE: [web2py] Displaying only certain fields of choice with SQLFORM(...) update

2020-01-28 Thread John Bannister
If you don’t want the field to be displayed in the SQLFORM() you need to set as 
follows:

db.table.fieldname.readable = db.table.fieldname.writable=False before the form 
initialisation.

 

So something like :-

db.dog.owner.readable=db.dog.owner.writable=False

form = SQLFORM(db.dog)

if form.process().accepted:

…..

….

return dict(form=form)

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
António Ramos
Sent: 28 January 2020 14:49
To: web2py@googlegroups.com
Subject: Re: [web2py] Displaying only certain fields of choice with 
SQLFORM(...) update

 

did you also tried writable=False 

When a field is marked with writable=False, the field is not shown in create 
forms, and it is shown readonly in update forms. If a field is marked as 
writable=False and readable=False, then the field is not shown at all, not even 
in update forms. 

 

db.table.var.readable= db.table.var.writable=False 

 

Em ter., 28 de jan. de 2020 às 13:21, mostwanted  
escreveu:

I did employ this method (db.quotation.beforeVat.readable=False!!! ) in my 
controller but it didnt respond, its actually the first thing i tried! Its just 
that i was hoping SQLFORM() may have some helpers as part of its signature that 
i dont know about that I could use.

On Tuesday, January 28, 2020 at 12:50:31 PM UTC+2, Ramos wrote:

Look in the docs 

 

http://web2py.com/books/default/chapter/29/07/forms-and-validators 

in your controller before showing your form,

 

db.yourtable.yourfield.readable=False!!! 

 

Em ter., 28 de jan. de 2020 às 10:29, mostwanted  escreveu:

I was wondering if there is a way to show the SQLFORM() with only certain 
fields for the user during a form update & not show all the fields. 
SQLFORM.grid(...) has the field=None argument which enables one to select the 
fields to be displayed in the view, is there something like that for 
SQLFORM()?

I have some fields which only do calculations in my db tables & those are the 
fields I wanna hide during updates.

 

Regards;

 

Mostwanted

-- 
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 web...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/281ed3a3-66df-4eae-8768-1b9618c6093a%40googlegroups.com
 

 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0320799e-d6df-4e35-880e-26b902511278%40googlegroups.com
 

 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxPAez734JH9mwpBbKkecjV5WS6dKSJMTbDEB5Q9HrUyEw%40mail.gmail.com
 

 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/013601d5d5e5%24f583cba0%24e08b62e0%24%40gmail.com.


RE: [web2py] Re: Saving a view as an file/image

2020-01-28 Thread John Bannister
Hey thanks a lot will try it out!!

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
mostwanted
Sent: 27 January 2020 15:47
To: web2py-users
Subject: [web2py] Re: Saving a view as an file/image

 

Hey John, I dont know if this will help you but there was a time when i needed 
to convert a view to PDF & I used 2 l js libraries, html2canvas & jsPDF, they 
enabled me to achieve my goal that time, you can find the jsPDF package here: 
https://github.com/MrRio/jsPDF  <https://github.com/MrRio/jsPDF> 


and the html2canvas package here: 
https://github.com/niklasvh/html2canvas/releases

After extracting all the files from the compressed folders look for these 2 js 
files in jsPDF;  jspdf.debug.js, jspdf.min.js, and the html2canvas.js in the 
html2pdf folder, upload them into your application's static/js directory, from 
there call them in your application's layout page like this:






 

In the view that you want to convert to PDF have this javascript code:


function genPDF()
{
let pdfName = "licencia";
var doc = new jsPDF({
format: "a4"
});

  html2canvas(document.getElementById("invoicing"), {
scale: "5"
  }).then(canvas => {
console.log("Capturando");
this.imgFile = canvas;
doc.addImage(this.imgFile, "JPEG", 5, 5, 200, 250);
doc.save('filename.pdf');
  });
}


 

In the same view have a link that when clicked calls the above js function like 
this:

Click to Download as PDF


This should convert you view into PDF or Image as per the usage of both 
liraries.

 

I hope the maintainers of the jsPDF & html2pdf libraries have not made 
adjustmets that may cause this not to work;

 

Regards

 

Mostwanted



On Sunday, January 26, 2020 at 4:25:47 PM UTC+2, John Bannister wrote:

Hi All,

 

I have hit a bit of a stumbling block and would like to know if anyone else has 
come across this and how to resolve it.

 

Situation is as follows:-

 

I am generating tickets/coupons for users once they have entered all the 
appropriate info which I am doing via normal controller/view using html for 
styling. Coupon consists of 2 images plus some text (nothing really fancy at 
all).

 

Everything looks okay and as it should in the view with all the correct 
information etc.

 

I now what to email the coupon to the user. This is where I am a bit stumped.

 

I am assuming that I will need to save the rendered view as an image/file/.pdf 
if I want the styling, logos, qrcodes etc to be in the email that I will send 
as well as for all the formatting to be as per the view.

 

Is there any easy way or any way at all to do this?

 

In the controller I can use the response.render(view, args) but still cant see 
how to create a pdf file from the actual view before sending the email.

Hopefilly I ma missing something simple  

 

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7643b84a-9fa5-490a-9a47-d5775f859b27%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/7643b84a-9fa5-490a-9a47-d5775f859b27%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/00b701d5d5b8%2491584e80%24b408eb80%24%40gmail.com.


RE: [web2py] Re: Saving a view as an file/image

2020-01-28 Thread John Bannister
I have no issue styling the vouchers in HTML  (this is already done in a view) 
my issue  is how to capture that view and send it via email either as message 
or attachment.

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
villas
Sent: 27 January 2020 13:26
To: web2py-users
Subject: [web2py] Re: Saving a view as an file/image

 

Generating PDFs can be a challenge, so it would be much easier to style the 
vouchers in HTML.

 

Re: QRcodes.  You can even generate QRcodes using Markmin, or, just use the 
Google Charts API directly. Search web for other solutions.

 

 


On Sunday, 26 January 2020 14:25:47 UTC, John Bannister wrote:

Hi All,

 

I have hit a bit of a stumbling block and would like to know if anyone else has 
come across this and how to resolve it.

 

Situation is as follows:-

 

I am generating tickets/coupons for users once they have entered all the 
appropriate info which I am doing via normal controller/view using html for 
styling. Coupon consists of 2 images plus some text (nothing really fancy at 
all).

 

Everything looks okay and as it should in the view with all the correct 
information etc.

 

I now what to email the coupon to the user. This is where I am a bit stumped.

 

I am assuming that I will need to save the rendered view as an image/file/.pdf 
if I want the styling, logos, qrcodes etc to be in the email that I will send 
as well as for all the formatting to be as per the view.

 

Is there any easy way or any way at all to do this?

 

In the controller I can use the response.render(view, args) but still cant see 
how to create a pdf file from the actual view before sending the email.

Hopefilly I ma missing something simple  

 

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/020c2eb9-f2b9-494e-901d-8990853b79d7%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/020c2eb9-f2b9-494e-901d-8990853b79d7%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/00aa01d5d5b8%2435a34950%24a0e9dbf0%24%40gmail.com.


[web2py] Saving a view as an file/image

2020-01-26 Thread John Bannister
Hi All,

I have hit a bit of a stumbling block and would like to know if anyone else 
has come across this and how to resolve it.

Situation is as follows:-

I am generating tickets/coupons for users once they have entered all the 
appropriate info which I am doing via normal controller/view using html for 
styling. Coupon consists of 2 images plus some text (nothing really fancy 
at all).

Everything looks okay and as it should in the view with all the correct 
information etc.

I now what to email the coupon to the user. This is where I am a bit 
stumped.

I am assuming that I will need to save the rendered view as an 
image/file/.pdf if I want the styling, logos, qrcodes etc to be in the 
email that I will send as well as for all the formatting to be as per the 
view.

Is there any easy way or any way at all to do this?

In the controller I can use the response.render(view, args) but still cant 
see how to create a pdf file from the actual view before sending the email.
Hopefilly I ma missing something simple  

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fc768134-c453-4b94-838b-f4ee96d932bc%40googlegroups.com.


RE: [web2py] Looking for web2py developer for Italian small company

2020-01-22 Thread John Bannister
Dear Ivan,

 

Would be interested if you are looking to use py4web and vue.js

 

John

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Ivan Gazzola
Sent: 21 January 2020 16:40
To: web2py-users
Subject: [web2py] Looking for web2py developer for Italian small company

 

We are a small company in Italy, we need a new developer for our project 
(xortho.it)

 

The web app is developed with jquery mobile and web2py, we are planning to move 
to angular and web2py or better py4web.

 

If you're interested please contact us.

 

Ciao

 

Ivan

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9b87d283-adc7-4fbb-830a-8f3a3a45eddf%40googlegroups.com
 

 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/026e01d5d123%24fa0bde40%24ee239ac0%24%40gmail.com.


[web2py] Py4web Auth Equivalent

2019-12-27 Thread John Bannister
Hi All,
I have played with py4web for a while now and one thing I cannot get my 
head around is how to set up the equivalent web2py auth groups, memberships 
in py4web?

Are there any examples or documentation on how to use tags to set up the 
equivalent?

Thanks in advance
John 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1acef142-5b23-4023-947d-e9b3b263c293%40googlegroups.com.


RE: [web2py] Re: Web2py arabic translations not working

2019-10-28 Thread John Bannister
Hi Massimo,

 

Deleted ar.py and recreated it and seems fine now. 

 

BR

John

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 28 October 2019 05:23
To: web2py-users
Subject: [web2py] Re: Web2py arabic translations not working

 

Can you provide more info? Does it not identify the translation file? Does it 
not read it? Does it not translate properly? There should not be anything 
special about arabic other the it is Right to Left.

On Tuesday, 22 October 2019 06:36:27 UTC-7, John Bannister wrote:

Tried to use the ar.py file (usng T()) to translate some text to arabic. Seems 
that this does not work wheras the likes of Italian (it) does. Has anyone come 
acrross this issue with 2.18.5?

 

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5c45213a-a9d7-46e1-8f56-ec51ad25520e%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/5c45213a-a9d7-46e1-8f56-ec51ad25520e%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/00d501d58d71%244c7f7520%24e57e5f60%24%40gmail.com.


[web2py] Web2py arabic translations not working

2019-10-22 Thread John Bannister
Tried to use the ar.py file (usng T()) to translate some text to arabic. 
Seems that this does not work wheras the likes of Italian (it) does. Has 
anyone come acrross this issue with 2.18.5?


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c8deb05c-58f3-41e5-a900-176bf83ae569%40googlegroups.com.


RE: [web2py] Re: py4web Auth

2019-10-01 Thread John Bannister
Hi Massimo,

 

Got around to playing with Tags today (as per the new section you added to the 
py4web docs). Comments/feedback as follows:

 

As per the docs: 

 

groups=Tags(db.auth_user)

groups.add(user.id, 'Dancer')

 

1: nothing is added from inside an action

2: if I add the line groups.add(1, 'Dancer') right after the groups 
initialization it adds the record to the auth_user_tag_default table

 

That’s about as far as I have got.

 

Some grammatical stuff on the English but it is easily understandable for those 
that want to understand and certainly a lot better than I could do in Italian J

 

If have also noticed looking at the auth plugins that the port from web2py 
hasn’t quite been finalised with things like current and storage() still in the 
code. 

 

If you need a hand with proof reading/ correcting the docs you have done so far 
I am more than willing to help out.

 

Will continue to test and play and hopefully provide constructive feedback as 
part of the process.

 

Keep up the good work it is looking really cool !!!

 

Best Regards

John  

 

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 01 October 2019 05:43
To: web2py-users
Subject: Re: [web2py] Re: py4web Auth

 

I understand what you are  asking. Something like the ability of web2py to 
define stuff in a models file and it would be available to the views. Problem 
with that design is the overhead. With py4web we are trying to be more 
efficient. 

 

There are many ways to do this:

 

1) create a function that returns the info you need and pass this function to 
the layout. For example:

 

def get_info(auth):

  return {... whatever you need ...}

 

@action('index')

@action.uses(auth)

def index():

return dict(info=get_info(auth))

 

2) create a new fixture that injects data in the template

 

from py4web.core import Fixture

class InfoInjector(Fixture)

  def transform(self, output):

   if isinstance(output, dict) and 'info' not in output:

output['info'] = get_info(auth) 

   return output

 

@action('index')

@action.uses(auth, InfoInjector())

def index():

return dict() # info is automatically injected

 

3) add logic directly to the template as in:

 

[[from app.thisapp.common import get_info, auth]][[info = get_info(auth)]] 
... [[=info]]

 

I like solution 2 best

 

On Monday, 30 September 2019 09:50:07 UTC-7, John Bannister wrote:

Hi Massimo,

 

Not quite what I am after. Scenario which I have is that I have a number of 
different models each has a number of different atctions. I have a menu defined 
in layout.html which is included in each view. I would like to display the 
logged in user name in the menu (so something like Welcome John) if the user is 
logged in or LOGIN if they are not.

 

I understand that I can use auth.get_user in the action to access any auth user 
info I need but the question is do I need to pass back the user information to 
each and every view for layout.html to have access to the information or is 
there some way to set a global/application wide variable so that can be access 
by all views(templates). Ideally I would like to be able to access 
auth.get_user() from layout.html

 

BR

John

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 30 September 2019 17:12
To: web2py-users
Subject: Re: [web2py] Re: py4web Auth

 

In any action decorated with @action.uses(auth.user) you can do

 

first_name = auth.get_user()['first_name']

 

Is this what you are asking?


On Monday, 30 September 2019 01:07:23 UTC-7, John Bannister wrote:

Hi Massimo,

 

Thanks very much. Will test and give you some feedback hopefully today.

 

Is there some sort of way to access user info from layout.html for example 
across multiple modules without having to pass the user from each eaction in 
each module? I want to be able to display the user name as part of the menu 
something like Welcome John (if the user is logged in) irrespective of module 
or action??

 

Best Regards

John

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 30 September 2019 06:39
To: web2py-users
Subject: [web2py] Re: py4web Auth

 

I added a page to the documentation:

 

http://py4web.com/_documentation/static/index.html#chapter-11

 

I am sure it if full of spelling errors and I am making a fool of myself (my 
keyboard is acting up and my mother language is not english)

Also the examples could use an independent tester as I typed them without 
running them.

 

Anyway I thought this was better than nothing. :-)

 

Massimo

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

RE: [web2py] Re: py4web Auth

2019-10-01 Thread John Bannister
Thanks for the info. Have tried option 2 (which I also like the most) but 
problem I am having is as soon as I try to include a view i.e generic.html in 
the action the info is not being added to the output.

 

So 

from py4web.core import Fixture

class InfoInjector(Fixture):

  def transform(self, output):

   if isinstance(output, dict) and 'info' not in output:

output['info'] = get_info(auth) 

   return output

 

@action('index')

@action.uses(auth, InfoInjector())

def index():

message=’Hello there’

return dict(message=message ) # info is automatically injected I see 
the injected info + message

 

Output:-

{

  "info": {

"info": {

  "email": "eudoraj...@gmail.com",

  "first_name": "John",

  "id": 1,

  "last_name": "Bannister",

  "username": "jab"

}

  },

  "message": "Hello there"

}

 

 

@action('index')

@action.uses(auth, InfoInjector())

@action.uses(‘generic.html’)

 

def index():

messate=”Hello there”

return dict(message=message) # info is automatically injected 
InfoInjector() is not called ! and no info injected

 

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 01 October 2019 05:43
To: web2py-users
Subject: Re: [web2py] Re: py4web Auth

 

I understand what you are  asking. Something like the ability of web2py to 
define stuff in a models file and it would be available to the views. Problem 
with that design is the overhead. With py4web we are trying to be more 
efficient. 

 

There are many ways to do this:

 

1) create a function that returns the info you need and pass this function to 
the layout. For example:

 

def get_info(auth):

  return {... whatever you need ...}

 

@action('index')

@action.uses(auth)

def index():

return dict(info=get_info(auth))

 

2) create a new fixture that injects data in the template

 

from py4web.core import Fixture

class InfoInjector(Fixture)

  def transform(self, output):

   if isinstance(output, dict) and 'info' not in output:

output['info'] = get_info(auth) 

   return output

 

@action('index')

@action.uses(auth, InfoInjector())

def index():

return dict() # info is automatically injected

 

3) add logic directly to the template as in:

 

[[from app.thisapp.common import get_info, auth]][[info = get_info(auth)]] 
... [[=info]]

 

I like solution 2 best

 

On Monday, 30 September 2019 09:50:07 UTC-7, John Bannister wrote:

Hi Massimo,

 

Not quite what I am after. Scenario which I have is that I have a number of 
different models each has a number of different atctions. I have a menu defined 
in layout.html which is included in each view. I would like to display the 
logged in user name in the menu (so something like Welcome John) if the user is 
logged in or LOGIN if they are not.

 

I understand that I can use auth.get_user in the action to access any auth user 
info I need but the question is do I need to pass back the user information to 
each and every view for layout.html to have access to the information or is 
there some way to set a global/application wide variable so that can be access 
by all views(templates). Ideally I would like to be able to access 
auth.get_user() from layout.html

 

BR

John

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 30 September 2019 17:12
To: web2py-users
Subject: Re: [web2py] Re: py4web Auth

 

In any action decorated with @action.uses(auth.user) you can do

 

first_name = auth.get_user()['first_name']

 

Is this what you are asking?


On Monday, 30 September 2019 01:07:23 UTC-7, John Bannister wrote:

Hi Massimo,

 

Thanks very much. Will test and give you some feedback hopefully today.

 

Is there some sort of way to access user info from layout.html for example 
across multiple modules without having to pass the user from each eaction in 
each module? I want to be able to display the user name as part of the menu 
something like Welcome John (if the user is logged in) irrespective of module 
or action??

 

Best Regards

John

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 30 September 2019 06:39
To: web2py-users
Subject: [web2py] Re: py4web Auth

 

I added a page to the documentation:

 

http://py4web.com/_documentation/static/index.html#chapter-11

 

I am sure it if full of spelling errors and I am making a fool of myself (my 
keyboard is acting up and my mother language is not english)

Also the examples could use an independent tester as I typed them without 
running the

RE: [web2py] Re: py4web Auth

2019-09-30 Thread John Bannister
Hi Massimo,

 

Not quite what I am after. Scenario which I have is that I have a number of 
different models each has a number of different atctions. I have a menu defined 
in layout.html which is included in each view. I would like to display the 
logged in user name in the menu (so something like Welcome John) if the user is 
logged in or LOGIN if they are not.

 

I understand that I can use auth.get_user in the action to access any auth user 
info I need but the question is do I need to pass back the user information to 
each and every view for layout.html to have access to the information or is 
there some way to set a global/application wide variable so that can be access 
by all views(templates). Ideally I would like to be able to access 
auth.get_user() from layout.html

 

BR

John

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 30 September 2019 17:12
To: web2py-users
Subject: Re: [web2py] Re: py4web Auth

 

In any action decorated with @action.uses(auth.user) you can do

 

first_name = auth.get_user()['first_name']

 

Is this what you are asking?


On Monday, 30 September 2019 01:07:23 UTC-7, John Bannister wrote:

Hi Massimo,

 

Thanks very much. Will test and give you some feedback hopefully today.

 

Is there some sort of way to access user info from layout.html for example 
across multiple modules without having to pass the user from each eaction in 
each module? I want to be able to display the user name as part of the menu 
something like Welcome John (if the user is logged in) irrespective of module 
or action??

 

Best Regards

John

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 30 September 2019 06:39
To: web2py-users
Subject: [web2py] Re: py4web Auth

 

I added a page to the documentation:

 

http://py4web.com/_documentation/static/index.html#chapter-11

 

I am sure it if full of spelling errors and I am making a fool of myself (my 
keyboard is acting up and my mother language is not english)

Also the examples could use an independent tester as I typed them without 
running them.

 

Anyway I thought this was better than nothing. :-)

 

Massimo

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e525e23a-199b-4b9b-83f6-ced97e1efaff%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/e525e23a-199b-4b9b-83f6-ced97e1efaff%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/44a408dc-40cc-4bf7-b599-05b3f2b66289%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/44a408dc-40cc-4bf7-b599-05b3f2b66289%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/045201d577af%241a0d7790%244e2866b0%24%40gmail.com.


RE: [web2py] Re: py4web Auth

2019-09-30 Thread John Bannister
Hi Massimo,

 

Thanks very much. Will test and give you some feedback hopefully today.

 

Is there some sort of way to access user info from layout.html for example 
across multiple modules without having to pass the user from each eaction in 
each module? I want to be able to display the user name as part of the menu 
something like Welcome John (if the user is logged in) irrespective of module 
or action??

 

Best Regards

John

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 30 September 2019 06:39
To: web2py-users
Subject: [web2py] Re: py4web Auth

 

I added a page to the documentation:

 

http://py4web.com/_documentation/static/index.html#chapter-11

 

I am sure it if full of spelling errors and I am making a fool of myself (my 
keyboard is acting up and my mother language is not english)

Also the examples could use an independent tester as I typed them without 
running them.

 

Anyway I thought this was better than nothing. :-)

 

Massimo

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e525e23a-199b-4b9b-83f6-ced97e1efaff%40googlegroups.com
 

 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/039401d57766%24125d6da0%24371848e0%24%40gmail.com.


RE: [web2py] py4web questions

2019-09-26 Thread John Bannister
Thanks Massimo much appreciated and looking forward to the tutorial. Will check 
out the tag API in the meantime.

-Original Message-
From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 26 September 2019 09:02
To: web2py-users
Subject: [web2py] py4web questions

Good question. I will try post a tutorial in the next few days. But the idea is 
you associate tags to a user and then give permissions based on the tags. The 
tag API is very simple so I recommend you meanwhile look at the source.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b6009627-7b67-405f-a98e-1dbcb5dbb1e2%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/018701d57440%24c135dfc0%2443a19f40%24%40gmail.com.


[web2py] py4web questions

2019-09-25 Thread John Bannister
Hi All,

Today have managed to play a bit with py4web with the view to developing a 
real-life app using the framework.

In so doing I have hit a few 'challenges' which I am hoping someone will be 
able to help me with.

1: User will log in via default controller and based on access rights will 
get appropriate menus/level of access. How to do this in py4web? I see 
there is a tags db generated as part of the auth initialisation but I 
cannot see how to utilise this to set up user/ groups /roles etc. Some 
guidance or direction would be most useful.

Looks like I am missing something really simple and/or have probably been 
spoilt by Web2Py

Thanks in advance
John


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5e793193-9150-4e6b-82f9-8853b007448d%40googlegroups.com.


RE: [web2py] Re: py4web pythonanywhere bottle_app.py configuration

2019-09-24 Thread John Bannister
Great stuff thanks

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 24 September 2019 05:24
To: web2py-users
Subject: [web2py] Re: py4web pythonanywhere bottle_app.py configuration

 

I posted it in trunk/bottle_app.py 

On Monday, 23 September 2019 02:29:49 UTC-7, John Bannister wrote:

Hi All,

 

Just watched the py4web video and would like to know if anyone has the 
bottle_app.py config that needs to be used in order to get the desired 
resuolts. Hard to make out in the video 

 

BR

John

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a68bdf5c-e324-4262-8712-acfbc136492c%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/a68bdf5c-e324-4262-8712-acfbc136492c%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/016801d572af%24ccf5ed10%2466e1c730%24%40gmail.com.


[web2py] py4web pythonanywhere bottle_app.py configuration

2019-09-23 Thread John Bannister
Hi All,

Just watched the py4web video and would like to know if anyone has the 
bottle_app.py config that needs to be used in order to get the desired 
resuolts. Hard to make out in the video 

BR
John

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/521dcae6-4579-4c43-8579-98920f906823%40googlegroups.com.


RE: [web2py] py4web has now a grid ...

2019-09-12 Thread John Bannister
Hi Massimo,

 

Some feedback for you on the new grid (which is looking very cool) and which I 
played with  a bit today.

Basically I  connected  to a  MySQL db and loaded some existing medium sized 
tables (~400K records) and sort of compared it with web2py grid (standard 
web2py)  and also datatables (using server side processing on py4web which is 
still at an experimental stage) .

 

Assuming that any grid component should  be able to load, display, paginate, 
search, filter, import, export and have CRUD functionality, I ran a small 
comparison.   

 

Main things I was looking for were:-

1:  Initial load times (crucial for larger tables) 

2:  End user experience (look and feel, filtering, useablitly etc.)

3: Functionality

 

(1)For initial  load times (and I haven’t put in any timing stats) for sure 
the new py4web grid wins hands down followed closely by datatables and finally 
web2py grid. As the web2py grid doesn’t run on py4web we cannot really compare 
apples and pears but all tests were run on same machine using same database.

(2)This is slightly subjective but for now I would go with datatables 
followed by web2py.grid and finally py4web.grid for the following reasons:-

a.   Datatables (to me) looks a lot better than the web2py.grid even after 
restyling it to get is as close (looks wise) to datatables. 

b.  Web2py.grid filtering/extended search (to me) is streaks ahead of the 
other two. It is probably one of the most usefull tools when working with big 
tables (even though the load time if you have a table with many referenced 
fields is a bit tedious). Datatable search(ing) is pretty good though a bit 
hungry when doing the searching server side and I still haven’t managed get the 
server side to filter properly on referenced fields but in general it works 
pretty much okay.  The filtering on the new grid is very unintuitive by 
comparison and I was not able to build any sort of query (but that could just 
be me).

c.Pagination/Load More doesn’t work for me particularly for larger 
tables where it is much easier (in my opinion) to use standard pagination with 
first and last etc unless there is a query builder similar to web2py.grid 
available to filter out a set of records. Even then first and last are still 
very useful for larger sets

(3)   Here web2py.grid has to win hands down J followed closely by 
datatables (after a lot of hair pulling). Whilst I understand this is v1.0 of 
the py4web.grid, there are a few (in my opinion) fundamental things that need 
addressing.

a.   Referenced fields in the grid are displayed as [linked id’s]. Clicking 
on them does nothing. Would be good to show the referenced records _format and 
clicking on the link should display the record (either in view or edit mode). 
This is semi-working in the _dashboard app but there is no way (apart from the 
back arrow) to get back to the original table/record.

b.  Adding a new record that has referenced fields does not work yet 
(certainly there is no dropdown list to chose from)

c.   Similarly changing a record with a referenced field needs a bit of 
work.

d.  Import/Export functionality 

 

Conclusion:-

I think for a v1.0  the grid is very cool and shows a huge amount  of 
potential. 

Having said that (for me) the ideal grid for py4web would be something that has 
the following :-

1: Web2py.grid type extended search form.

2: Look and feel of (slightly extended) datatables

3: Speed of py4web.grid as is currently is. 

 

Disclaimer:-

 

Please note that the above is purely my opinion and is intended purely to 
provide my own feedback on the py4web new grid.

 

(bucket list is running over) J

 

Best Regards

John

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 12 September 2019 08:32
To: web2py-users
Subject: [web2py] py4web has now a grid ...

 

... it is incomplete. It is experimental. The API is subject to change. But I 
could use some community feedback:

 


from py4web.utils.publisher import Publisher, ALLOW_ALL_POLICY



 




 


# exposes services necessary to access the db via ajax



 


publisher = Publisher(db, policy=ALLOW_ALL_POLICY)



 




 




 


# expose as /examples/grid



 


@action('grid')



 


@action.uses('grid.html')



 


def example_grid():



 return dict(grid=publisher.grid(db.person)) 



embed in template with [[=grid]] in templates/grid.html as in web2py. 
The difference from web2py is that the grid communicate with the server via 
ajax and the style is in static/components/mtable.html
Still does not access authentication based access control but will add it very 
soon.



 

You can try it.

https://github.com/web2py/py4web/blob/master/apps/examples/__init__.py#L41

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- 

RE: [web2py] py4web YATL equivalent of SCRIPT

2019-09-07 Thread John Bannister
Thanks Massimo,

Will definitely take a look and do the necessary.  With regards the general 
Auth functionalitly, do you have some example or guidelines as to how this will 
work?

Thanks in advance 

-Original Message-
From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 06 September 2019 18:20
To: web2py-users
Subject: [web2py] py4web YATL equivalent of SCRIPT

Py4web does not require that you use Vue or the vue router. The auth page uses 
Vue but you do not necessary need to touch it.

Yes yatl has less helpers than web2py but you make your own.

See how they are defined:

https://github.com/web2py/yatl/blob/2eb050b8e251813e905ecbabba839ca578901a3a/yatl/helpers.py#L112

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7c1e0efc-e534-437e-9875-8649c1f6431f%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/03a201d5654d%245c013d90%241403b8b0%24%40gmail.com.


[web2py] py4web YATL equivalent of SCRIPT

2019-09-06 Thread John Bannister
Hi All,

Have finally had a bit of time to play again with py4web the objective 
being to port a smallish app from web2py to py4web (very much as a learning 
and familiarisation/evaluation exercise).

The main objective is to see if I can create the equivalent of a working 
web2py app with py4web without having to learn a new language/languages or 
install a range of additional packages to achieve similar functionality / 
UI that I have in web2py with a similar amount of code (or less would be 
good as well).

I am no expert in JS and the vue route looks pretty complex compared to the 
standard HTML forms.

In the instances where I do need to use JS I generally tend to create the 
script inside a controller and use the SCRIPT or ASSIGNJS helper to pass it 
to the view. 

Using yatl (py4web) these helpers seem to be missing or maybe I am missing 
something?

Any ideas on what the equivalent yatl (if any) would be or if what I am 
trying to do is defeating the object of the exercise?

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/161d6ec0-273c-4692-906c-ead56f21ca10%40googlegroups.com.


RE: [web2py] Re: Anthony was right... web3py has a big naming conflict

2019-07-22 Thread John Bannister
Why not something as simple as py3web

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Leonel Câmara
Sent: 22 July 2019 16:26
To: web2py-users
Subject: [web2py] Re: Anthony was right... web3py has a big naming conflict

 

I would call it pywebal "python web abstraction layer"

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b6450298-575f-4274-9708-4dd85c7097a2%40googlegroups.com
 

 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/09e101d54099%24e94b5560%24bbe20020%24%40gmail.com.


RE: [web2py] web2py dynamic queries

2019-06-17 Thread John Bannister
Hi Cristina,

 

Can you show us your view code as well?

 

Assuming you are trying to use datatables instead of web2py Grid or Smartgrid 
(which gives you ability to build dynamic queries), you will probably need to 
loop through all the fields in the table (server side) and build your query 
based on the value entered in the serach box.

 

Referenced fields will generally be displayed as the id of the referencing 
field depending on how you pass the information back to your view (i.e rendered 
or not) so you will only be able to search on the value in the view.

 

Alternatively you can look at the individual field.type (which will tell you 
the type of field you are dealing with) and treat each field type accordingly.

 

Hope this helps

John

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Cristina Sig
Sent: 17 June 2019 03:36
To: web2py-users
Subject: [web2py] web2py dynamic queries

 

Hello,

 

I'm a newbie on python language so I'm struggling to do some queries.

I have a table Student which I use to fill a table on view, above that table, I 
have a search box, where I would like to provide the option to search in 
multiple columns (phone, last name, first name, or nationality).

I don't know how exactly do a dynamic query in this case because I have some 
fields which are references from other tables.

 

This is my Db

db.define_table('Nationality',
Field('descripcion', 'string'),
   )

db.define_table('Grade',
Field('level', 'string'),
   )

db.define_table('Student',
Field('lastname', 'string'),
Field('firstname', 'string'),
Field('nationality','reference Nationality'),
Field('phone', 'integer'),
Field('email', 'string'),
Field('gradelevel','reference Grade'),
   )

 

and this is my try so far

queries = [(db.Student.id > 0)]
if search_value and search_value != '' and search_value != 0:
queries.append(db.Student(search_value))  
query = reduce(lambda a,b:(a),queries) 

query.select()

 

 

I found a generic way to do it but still don't know how to deal with references.
Any suggestion/idea would be very appreciated :)

 

queries=[]
if arg1 == "xyz": queries.append(db.abc.id > 0)
if arg2 == "xyz": queries.append(db.def.id > 0)
query = reduce(lambda a,b:(a),queries)
query.select()

 

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/54dc8ca8-bebe-4604-8e4e-a89c254ed944%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/050901d524e4%24075852f0%241608f8d0%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: [web2py] Re: Web3py FORM referenced fields

2019-06-13 Thread John Bannister
Hi Massimo,

 

Issue is not the dropdown for referenced fields on an Add rec as  that works 
fine. Issue is when you want to edit a record with a referenced field so 

 

form=Form(db.order, record=id)

 

Referenced field is blank (although dropdown is available). All other fields 
are populated with db values.

 

BR

John

 

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 13 June 2019 05:09
To: web2py-users
Subject: [web2py] Re: Web3py FORM referenced fields

 

I added an example that works for me.

Maybe can help you debug the problem:

 

http://127.0.0.1:8000/examples/dbform2


On Wednesday, 12 June 2019 04:02:18 UTC-7, John Bannister wrote:

Hi All,

 

Does anyone have a working example of web3py Form using referenced fields?

 

I have created the standard person / pets tables with pets referencing person 
as 'reference person' in the table definition.

 

Using form=Form(db.pet) I get the dropdown of persons for the add no worries 
but on the form=Form(db.pet, record=id) for the edit form .. neither the id of 
the person or the persons name (format='%(name)s' is displayed even though I 
can still select from the dropdown list. The id is definately stored in the db.

 

BR

John

 

 

 

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d40dcdf9-96c9-43a3-a9ab-d1c3090c7ed1%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/d40dcdf9-96c9-43a3-a9ab-d1c3090c7ed1%40googlegroups.com?utm_medium=email_source=footer>
 .
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/005701d521b0%24c44dc750%244ce955f0%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Web3py FORM referenced fields

2019-06-12 Thread John Bannister
Hi All,

Does anyone have a working example of web3py Form using referenced fields?

I have created the standard person / pets tables with pets referencing 
person as 'reference person' in the table definition.

Using form=Form(db.pet) I get the dropdown of persons for the add no 
worries but on the form=Form(db.pet, record=id) for the edit form .. 
neither the id of the person or the persons name (format='%(name)s' is 
displayed even though I can still select from the dropdown list. The id is 
definately stored in the db.

BR
John




-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/676f67a8-1431-4fe3-9766-9272701f4a69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Datatables serverside JSON/Ajax

2019-06-11 Thread John Bannister
@Leonel .. I think this will work well with client side but not serverside 
datables but may be wrong.

@Cristina:

My understanding of serverside processing is that you will need to have a 
few more items returned to datatables as outlined in the DT docs for 
serverside processing.

Your response to the request from DataTables should look something like 
this for serverside processing:

return dict(draw=sEcho, recordsTotal=iTotalRecords, 
recordsFiltered=iTotalRecords, data=aaData)

You will also need to move your sorting, filtering and ordering to the 
server (which is a bit more complicated) but doable.

As said I could be wrong.

BR
John


On Tuesday, 11 June 2019 10:52:42 UTC+2, Leonel Câmara wrote:
>
> It's because you're not using the generic.json view and you're also not 
> setting the response.headers content-type to json. I would simply change 
> your function to this which will do everything for you:
>
> def manageCareer():
> rows = db((db.Career.faculty == db.Faculty.id)&(db.Career.degree == 
> db.Degree.id)).select()
> return response.json({'results': rows}) 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b93b0fa1-ad0e-4b32-9ead-173c9b23b161%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: [web2py] Re: Web3py

2019-06-09 Thread John Bannister
I tried  both with and without. Same or very similar result. It is only 
complaining about the auth_user_tag table which is defined in the auth module.

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 08 June 2019 07:19
To: web2py-users
Subject: [web2py] Re: Web3py

 

try a db.commit() after your define_table(s).

On Monday, 3 June 2019 08:16:27 UTC-7, John Bannister wrote:

Hi All,

 

Finally gotten round to playing again on the latest Web3py.

 

On _scaffold app .. if I add new tables to model file and then reload from the 
dashboard .. I get errors as follows:-

File "C:\Users\johhb\py3\lib\site-packages\pydal\base.py", line 581, in 
define_table
raise SyntaxError('table already defined: %s' % tablename)
  File "", line None
SyntaxError: table already defined: auth_user_tag_groups

Only way around it seems to be to delete contents of database folder and 
restart.

 

Dashboard app hangs on reload sometimes (I think it has to do the with same 
issue above) and only way to get round it is to restart the server and refresh 
the _dashboard app. 

 

I really want to start using it to create a few new apps I am due to start 
working on shortly even though I am well aware that it is not yet production 
ready so will keep testing and assist wherever I can. Thanks again for all the 
hard work put in so far I am sure its gonna be a really cool solution.

 

Best Regards

John

 

 

On Thursday, 16 May 2019 17:15:44 UTC+2, John Bannister wrote:

Hi All,

 

Had a first real 'play' with web3py' today and have a few questions the biggest 
of which I am hoping the gurus will be able to answer:-

 

1: Is there any way to not to have to restart the app every time changes are 
made to actions in the controller or new actions added etc? I understand that 
controllers are basically being imported when the app fires up but is any there 
any way to occasionally reload instead of having to restart the app? This is a 
fairly big one for me as sometimes tweaks will need to be made in production 
and restarting the web server is not really an option so hopefully I am missing 
something really simple.

 

Thanks in advance

John

 

 

 

 

 

 

  

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/33476d6d-05dd-4452-a67b-e919b06d08b6%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/33476d6d-05dd-4452-a67b-e919b06d08b6%40googlegroups.com?utm_medium=email_source=footer>
 .
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/00d501d51e9c%248f360030%24ada20090%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web3py

2019-06-03 Thread John Bannister
Hi All,

Finally gotten round to playing again on the latest Web3py.

On _scaffold app .. if I add new tables to model file and then reload from 
the dashboard .. I get errors as follows:-

File "C:\Users\johhb\py3\lib\site-packages\pydal\base.py", line 581, in 
define_table
raise SyntaxError('table already defined: %s' % tablename)
  File "", line None
SyntaxError: table already defined: auth_user_tag_groups

Only way around it seems to be to delete contents of database folder and 
restart.

Dashboard app hangs on reload sometimes (I think it has to do the with same 
issue above) and only way to get round it is to restart the server and 
refresh the _dashboard app. 

I really want to start using it to create a few new apps I am due to start 
working on shortly even though I am well aware that it is not yet 
production ready so will keep testing and assist wherever I can. Thanks 
again for all the hard work put in so far I am sure its gonna be a really 
cool solution.

Best Regards
John


On Thursday, 16 May 2019 17:15:44 UTC+2, John Bannister wrote:
>
> Hi All,
>
> Had a first real 'play' with web3py' today and have a few questions the 
> biggest of which I am hoping the gurus will be able to answer:-
>
> 1: Is there any way to not to have to restart the app every time changes 
> are made to actions in the controller or new actions added etc? I 
> understand that controllers are basically being imported when the app fires 
> up but is any there any way to occasionally reload instead of having to 
> restart the app? This is a fairly big one for me as sometimes tweaks will 
> need to be made in production and restarting the web server is not really 
> an option so hopefully I am missing something really simple.
>
> Thanks in advance
> John
>
>
>
>
>
>
>   
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/bff5857a-e7a8-417e-a973-4f588bb19cdd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: [web2py] Re: Web2py: Update table content after submit action

2019-05-26 Thread John Bannister
Hi Lovedie JC,

 

Is there any reason why you don’t just use the SQLFORM.gird? You can check for 
the ‘new’ , ‘edit’ etc in request.args in the view and put the form in a modal 
or whatever styling you want to use.

 

The alternative if you need to use the LOAD helper is probably to put both the 
form and the grid in the same function you are loading from the view. 

 

My personal preference is to use the standard Web2py SQLFORM.grid which has all 
the crud functionality already embedded which greatly simplifies coding.

 

BR

John 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Lovedie JC
Sent: 26 May 2019 14:00
To: web2py@googlegroups.com
Subject: Re: [web2py] Re: Web2py: Update table content after submit action

 

I tried with www.web2py.com/AlterEgo/default/show/252

I have to keep refreshing the page for the form to reappear. 

 

 

On Sun, 26 May 2019, 14:43 Lovedie JC  wrote:

Hi Dave. I have struggled with this for long but never got a good answer.

Do you have an example where in the view page:

{{=form}}

in the primary page is used but the page is not refreshing 

 

On Sun, 26 May 2019, 11:16 Dave S  wrote:



On Saturday, May 25, 2019 at 6:59:44 PM UTC-7, Cristina Sig wrote:

Hello everyone,

I have a table filled with records from a database. 

Also, I have a button to add a new record. Once I enter all the data for the 
new record and press the submit button, I want to update the content of the 
table without reloading the page (without F5).

I'm struggling to find a solution to this so any suggestions would be welcomed.

 

 

Sounds like a job for jQuery or for the LOAD() helper .  I use one to have a 
secondary form on the same page as another; the DIV used by the LOAD gets 
refreshed when I submit the secondayr form, but the page doesn't relaod.

 

https://web2py.com/books/default/chapter/29/11/jquery-and-ajax# 
 >

https://web2py.com/books/default/chapter/29/12/components-and-plugins#Components-LOAD-and-Ajax>

 

Good luck!

 

/dps

 

[original post continues]

 

Database

db.define_table('Student',
Field('name', 'string', label='Name'),
Field('last_Name', 'string', label='Last Name'),
Field('age', 'integer', label='Age'),
Field('nationality', 'string', label='Nationality'),
   )

 

Controller (Tools.py)

def studentNew():
formStudent=crud.create(db.Student)
if formStudent.accepted:
response.js = '(function($) 
{$("#myModalADD").modal("hide");}(jQuery));'  //hide modal after press submit 
button
response.flash = 'Record added successfully!' //displays message after 
press submit
return dict(formStudent=formStudent)

 

View


$(document).ready(function(){
   tabla= $('#table').DataTable( {
   'scrollX': true,
   'responsive':true,
   'sRowSelect': "single",
  });


Add New Student


   
   
  Name
  Last Name
  Age
  Nationality
   


{{for student in formListar:}}

{{=student.Student.name}}
{{=student.Student.last_name}}
{{=student.Student.age}}
{{=student.Student.nationality}}

{{pass}}



 //Modal that contains the Add New 
Student Form and Submit button
  

  
   Add New Student
  
   {{=LOAD('Tools','studentNew', ajax=True, 
ajax_trap=True)}}
  
  
Cancel
 
  

  


 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/aa06f194-1787-4551-abc0-204e03b15146%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAAcHJF934Qw%2BpLYwKDTRMVxuZ38aFbnafWSS%2BDMrcM7Rp3WGdA%40mail.gmail.com
 

[web2py] Re: IS_NOT_EMPTY() "takes away" a dropbox with a list of items referenced by a foreign key -

2019-05-19 Thread John Bannister
Hi Vlad,

I think I have come across this issue as well some time ago. Can you try 
IS_NOT_EMPY() OR IS_IN_DB(id ...)

This should hopefully bring back your drop down list.

BR
John

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/947a6613-5c2e-4bc3-b129-d3ae8d56c7ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-05-19 Thread John Bannister
Just an update to the below.

It seems that the from . import 'whatever' is where the issue is with the 
reloader as if I do for example import os  or import datetime in the 
__init__.py they both show up in the list of dependencies. Anything with a 
from . import 'whatever'  just lists the apps/myapp as a dependency

BR
John

On Sunday, 19 May 2019 11:38:07 UTC+2, John Bannister wrote:
>
> Hi Guys,
>
> Couple of things. 
>
> 1: I added a print('Dependancies %s ' % reloader.get_dependencies(module)) 
> just before the output to console in web3py/core.py.
>
> Here is the output (not formatted):-
>
> Dashboard is at: http://127.0.0.1:8000/_dashboard
> [  ] loading examples ...
> Dependancies None
> [A[OK] loaded examples
> [  ] loading myapp ...
> Dependancies None
> [A[OK] loaded myapp
> [  ] loading superheroes ...
> Dependancies None
> [A[OK] loaded superheroes
> [  ] loading todo ...
> Dependancies None
> [A[OK] loaded todo
> [  ] loading _dashboard ...
> Dependancies None
> [A[OK] loaded _dashboard
> [  ] loading _scaffold ...
> Dependancies None
> [A[OK] loaded _scaffold
> Bottle v0.12.16 server starting up (using TornadoServer())...
> Listening on http://127.0.0.1:8010/
> Hit Ctrl-C to quit.
>
> As expected no dependancies on initial load
>
> After reload :-
>
> [  ] reloading examples ...
> Dependancies [ 'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\os.py'>, 
> , 
>  'C:\\Users\\johhb\\web3py\\web3py\\utils\\form.py'>,  'pydal.validators' from 
> 'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\validators.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\yatl\\helpers.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\drivers.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\adapters\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\dialects\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\parsers\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\representers\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\base.py'>]
> [A[OK] reloaded examples
> [  ] reloading myapp ...
> Dependancies [ 'C:\\Users\\johhb\\web3py\\apps\\myapp\\__init__.py'>,  from 'C:\\Users\\johhb\\web3py\\apps\\myapp\\__init__.py'>]
> [A[OK] reloaded myapp
> [  ] reloading superheroes ...
> Dependancies [ 'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\os.py'>, 
> , 
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\drivers.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\adapters\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\dialects\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\parsers\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\representers\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\base.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\base.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\base.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\base.py'>]
> [A[OK] reloaded superheroes
> [  ] reloading todo ...
> Dependancies [ 'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\os.py'>, 
> , 
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\drivers.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\adapters\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\dialects\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\parsers\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\representers\\__init__.py'>,
>  
>  'C:\\Users\\johhb\\AppData\\Local\\Programs\\Python\\Python3\\lib\\site-packages\\pydal\\ba

Re: [web2py] Re: Web3py

2019-05-19 Thread John Bannister
Hi Guys,

Couple of things. 

1: I added a print('Dependancies %s ' % reloader.get_dependencies(module)) 
just before the output to console in web3py/core.py.

Here is the output (not formatted):-

Dashboard is at: http://127.0.0.1:8000/_dashboard
[  ] loading examples ...
Dependancies None
 [A[OK] loaded examples
[  ] loading myapp ...
Dependancies None
 [A[OK] loaded myapp
[  ] loading superheroes ...
Dependancies None
 [A[OK] loaded superheroes
[  ] loading todo ...
Dependancies None
 [A[OK] loaded todo
[  ] loading _dashboard ...
Dependancies None
 [A[OK] loaded _dashboard
[  ] loading _scaffold ...
Dependancies None
 [A[OK] loaded _scaffold
Bottle v0.12.16 server starting up (using TornadoServer())...
Listening on http://127.0.0.1:8010/
Hit Ctrl-C to quit.

As expected no dependancies on initial load

After reload :-

[  ] reloading examples ...
Dependancies [, 
, 
, ,
 
,
 
,
 
,
 
,
 
,
 
,
 
]
 [A[OK] reloaded examples
[  ] reloading myapp ...
Dependancies [, ]
 [A[OK] reloaded myapp
[  ] reloading superheroes ...
Dependancies [, 
, 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
,
 
]
 [A[OK] reloaded superheroes
[  ] reloading todo ...
Dependancies [, 
, 
,
 
,
 
,
 
,
 
,
 
]
 [A[OK] reloaded todo
[  ] reloading _dashboard ...
Dependancies [, 
,
 
, 
, 
]
 [A[OK] reloaded _dashboard
[  ] reloading _scaffold ...
Dependancies [, ]
 [A[OK] reloaded _scaffold

I was actually expecting to see the models and controllers as dependancies 
as they are imported via __init__.py but they are not listed (dont know if 
this is taken care of by __init__.py. @Massimo ??

So for the sake of completeness I add a print() message to the last line of 
myapp/__init__.py and to controllers.py and on reload I see the output from 
__init__.py but not the print() I put in controllers.py which to me 
indicates that neither the controllers.py nor the models.py are being 
reloaded.

Hope this helps
BR
John



On Sunday, 19 May 2019 02:37:38 UTC+2, 黄祥 wrote:
>
> understood, my bad, just test it n report it what think related with the 
> problem
> @massimo
> should this thing address an issue in github, so that you can focus 
> release the first version of web3py ?
>
> best regards,
> stifan
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0232fca6-1278-4ae7-9d16-271a44043355%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-05-18 Thread John Bannister
No I initally tried from web3py folder to import apps.myapp.controllers.py 
but paths are relative and globals like evrirnment/gloabls like 
'WEB3PY_APPS_FOLDER' are not available in the shell. (also tried from apps 
and myapp folder but same). Probably need to write a little script.

So .. I literally created a example.py with a print statement .. loaded it, 
changed it and reloaded it .. changes were there which tends to indicate 
that reloader is working.

I am also not too familiar at all with reloader unfortunately but am sure 
we will find the solution.

BR
John


On Saturday, 18 May 2019 14:43:22 UTC+2, 黄祥 wrote:
>
> already checked : https://pypi.org/project/reload
> did you test :
> reload ./web3py-start apps
> ?
>
> want to learning about reload, but not sure how to do it
>
> best regards,
> stifan
>

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


Re: [web2py] Re: Web3py

2019-05-18 Thread John Bannister
Hi Stifan,

I basically followed the example on the PyPi site which works fine. NB I 
did not manage to reload the modules in apps/myapp manually (from shell).

Have not had too much time today to get into it deeply as have other 
commitments.

I did however try to force the load_app to load as opposed to reload when 
the button is clecked but still same result. 

Really weird.

BR
John


On Saturday, 18 May 2019 13:36:34 UTC+2, 黄祥 wrote:
>
> *web3py/web3py/core.py*
> tried
> bottle.run(server='tornado', host=host, port=int(port), reloader=True)
> and 
> bottle.run(host=host, port=int(port), reloader=True)
> got same result, edit and add new function, routes for  not work
>
> tested work for edit and add new function (but still routes for  
> still not work)
> *web3py/web3py/core.py*
> bottle.run(server='gevent', host=host, port=int(port), reloader=True)
>
> but the log run strangely (loaded web apps twice):
> $ ./web3py-start apps
>     __  __
> |  / / / / __ |/___ \/ __ \ \/ /
> | | / / /_  / /_/ /___/ / /_/ /\  /
> | | /| / / __/ / __  //__  / / / /
> | |/ |/ / /___/ /_/ /___/ / / / /
> |___/|_/_/_/_/_/ /_/
> It is still experimental...
>
> Dashboard is at: http://127.0.0.1:8000/_dashboard
> [OK] loaded _dashboard 
> [OK] loaded _scaffold 
> [OK] loaded examples 
> [OK] loaded myapp 
> [OK] loaded superheroes 
> [OK] loaded todo 
>  ___      __  __
> |  / / / / __ |/___ \/ __ \ \/ /
> | | / / /_  / /_/ /___/ / /_/ /\  /
> | | /| / / __/ / __  //__  / / / /
> | |/ |/ / /___/ /_/ /___/ / / / /
> |___/|_/_/_/_/_/ /_/
> It is still experimental...
>
> Dashboard is at: http://127.0.0.1:8000/_dashboard
> [OK] loaded _dashboard 
> [OK] loaded _scaffold 
> [OK] loaded examples 
> [OK] loaded myapp 
> [OK] loaded superheroes 
> [OK] loaded todo 
> Bottle v0.12.16 server starting up (using GeventServer())...
> Listening on http://127.0.0.1:8000/
> Hit Ctrl-C to quit.
>
> @john, perhaps you can share how to run reloader manually ?
>
> thx n best regards,
> stifan
>

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


RE: [web2py] Re: Web3py

2019-05-18 Thread John Bannister
Hi Stifan,

 

What OS are you testing on?

 

BR

John

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of ??
Sent: 18 May 2019 08:14
To: web2py-users
Subject: Re: [web2py] Re: Web3py

 

Also, web3py uses this: 

https://pypi.org/project/reloader/

The docs have an example. Does this module work for you?

 

yes reloader already installed, since it's written on requirements.txt

git clone https://github.com/web2py/web3py
cd web3py
pip install -r requirements.txt

 

perhaps some files on your side not commited on github because of .gitignore
not sure just guess

 

best regards,

stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/46e203b8-b11d-4abd-96b9-99a26ef2b802%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/01b401d50d6d%241ee6b490%245cb41db0%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-05-18 Thread John Bannister
Running reload manually works as advertised on PyPi


On Saturday, 18 May 2019 13:03:59 UTC+2, John Bannister wrote:
>
> Same result unfortunately
>
> On Saturday, 18 May 2019 10:50:34 UTC+2, Massimo Di Pierro wrote:
>>
>> what if you do not user tornado and replace
>>
>> bottle.run(server='tornado', host=host, port=int(port))
>>
>> with
>>
>> bottle.run(host=host, port=int(port))
>>
>> it is very strange. Please try test the reloader module on its own.
>>
>> On Friday, 17 May 2019 23:09:49 UTC-7, 黄祥 wrote:
>>>
>>> Does it print this when you press [reload]?
>>>>
>>>
>>> yes it is
>>> $ ./web3py-start apps
>>>  ___      __  __ 
>>>
>>> |  / / / / __ |/___ \/ __ \ \/ / 
>>>
>>> | | / / /_  / /_/ /___/ / /_/ /\  / 
>>>
>>> | | /| / / __/ / __  //__  / / / / 
>>>
>>> | |/ |/ / /___/ /_/ /___/ / / / / 
>>>
>>> |___/|_/_/_/_/_/ /_/ 
>>>
>>> It is still experimental... 
>>>
>>> Dashboard is at: http://127.0.0.1:8000/_dashboard 
>>> [OK] loaded _dashboard  
>>> [OK] loaded _scaffold  
>>> [OK] loaded examples  
>>> [OK] loaded myapp  
>>> [OK] loaded superheroes  
>>> [OK] loaded todo  
>>> Bottle v0.12.16 server starting up (using TornadoServer())... 
>>> Listening on http://127.0.0.1:8000/ 
>>> Hit Ctrl-C to quit. 
>>>
>>> WARNING:tornado.access:404 GET /myapp/static/favicon.ico (127.0.0.1) 
>>> 2.32ms 
>>> WARNING:tornado.access:404 GET /examples/static/favicon.ico (127.0.0.1) 
>>> 2.35ms 
>>> WARNING:tornado.access:404 GET /todo/static/favicon.ico (127.0.0.1) 
>>> 2.07ms 
>>> WARNING:tornado.access:404 GET /_scaffold/static/favicon.ico (127.0.0.1) 
>>> 1.89ms 
>>> WARNING:tornado.access:404 GET /superheroes/static/favicon.ico (127.0.
>>> 0.1) 1.65ms 
>>> WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 1.57ms 
>>> [OK] reloaded _dashboard  
>>> [OK] reloaded _scaffold  
>>> [OK] reloaded examples  
>>> [OK] reloaded myapp  
>>> [OK] reloaded superheroes  
>>> [OK] reloaded todo
>>>
>>>
>>> but 
>>> - 'routes for '
>>> - edit or add new function on web apps
>>> is not work
>>>
>>>
>>> best regards,
>>> stifan 
>>>
>>

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


Re: [web2py] Re: Web3py

2019-05-18 Thread John Bannister
Same result unfortunately

On Saturday, 18 May 2019 10:50:34 UTC+2, Massimo Di Pierro wrote:
>
> what if you do not user tornado and replace
>
> bottle.run(server='tornado', host=host, port=int(port))
>
> with
>
> bottle.run(host=host, port=int(port))
>
> it is very strange. Please try test the reloader module on its own.
>
> On Friday, 17 May 2019 23:09:49 UTC-7, 黄祥 wrote:
>>
>> Does it print this when you press [reload]?
>>>
>>
>> yes it is
>> $ ./web3py-start apps
>>  ___      __  __ 
>>
>> |  / / / / __ |/___ \/ __ \ \/ / 
>>
>> | | / / /_  / /_/ /___/ / /_/ /\  / 
>>
>> | | /| / / __/ / __  //__  / / / / 
>>
>> | |/ |/ / /___/ /_/ /___/ / / / / 
>>
>> |___/|_/_/_/_/_/ /_/ 
>>
>> It is still experimental... 
>>
>> Dashboard is at: http://127.0.0.1:8000/_dashboard 
>> [OK] loaded _dashboard  
>> [OK] loaded _scaffold  
>> [OK] loaded examples  
>> [OK] loaded myapp  
>> [OK] loaded superheroes  
>> [OK] loaded todo  
>> Bottle v0.12.16 server starting up (using TornadoServer())... 
>> Listening on http://127.0.0.1:8000/ 
>> Hit Ctrl-C to quit. 
>>
>> WARNING:tornado.access:404 GET /myapp/static/favicon.ico (127.0.0.1) 
>> 2.32ms 
>> WARNING:tornado.access:404 GET /examples/static/favicon.ico (127.0.0.1) 
>> 2.35ms 
>> WARNING:tornado.access:404 GET /todo/static/favicon.ico (127.0.0.1) 
>> 2.07ms 
>> WARNING:tornado.access:404 GET /_scaffold/static/favicon.ico (127.0.0.1) 
>> 1.89ms 
>> WARNING:tornado.access:404 GET /superheroes/static/favicon.ico (127.0.0.1
>> ) 1.65ms 
>> WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 1.57ms 
>> [OK] reloaded _dashboard  
>> [OK] reloaded _scaffold  
>> [OK] reloaded examples  
>> [OK] reloaded myapp  
>> [OK] reloaded superheroes  
>> [OK] reloaded todo
>>
>>
>> but 
>> - 'routes for '
>> - edit or add new function on web apps
>> is not work
>>
>>
>> best regards,
>> stifan 
>>
>

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


RE: [web2py] Re: Web3py

2019-05-18 Thread John Bannister
I am getting the below reload console output when I fire up tornado as well as 
when I hit the reload all button on both windows and Ubuntu installations.

BR

John

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 18 May 2019 07:20
To: web2py-users
Subject: Re: [web2py] Re: Web3py

 

Also, web3py uses this: 

https://pypi.org/project/reloader/

The docs have an example. Does this module work for you?

 


On Friday, 17 May 2019 22:12:39 UTC-7, Massimo Di Pierro wrote:

Does it print this when you press [reload]?

 

[OK] reloaded _dashboard 
[OK] reloaded myapp 
[OK] reloaded todo 
[OK] reloaded superheroes 
[OK] reloaded examples 
[OK] reloaded _scaffold


On Friday, 17 May 2019 16:03:18 UTC-7, John Bannister wrote:

For me I have not installed any npm or other. Clean python 3 virtual 
environment into which I installed web3py on Ubuntu. Base install on windows 10 
as well same. All works fine apart from the reloading. I can try to set up on 
one of my Centos 7 servers later tomorrow but am pretty sure its gonna be the 
same.

 

Best Regards

John

 


On Friday, 17 May 2019 23:47:38 UTC+2, 黄祥 wrote:

Editing apps and reloading forks for me. Please try again and let's try figure 
out why does not work for you.

 

after tried latest commit (110), guess when it's work on you, but not work on 
us, perhaps related with module installed (python or js via npm) on your side, 
but not installed on us. not sure just guess.

 

best regards,

stifan 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/456b6c96-fac7-456f-bcdb-8df87464af31%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/456b6c96-fac7-456f-bcdb-8df87464af31%40googlegroups.com?utm_medium=email_source=footer>
 .
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/015601d50d4b%24a6a57ff0%24f3f07fd0%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-05-17 Thread John Bannister
For me I have not installed any npm or other. Clean python 3 virtual 
environment into which I installed web3py on Ubuntu. Base install on 
windows 10 as well same. All works fine apart from the reloading. I can try 
to set up on one of my Centos 7 servers later tomorrow but am pretty sure 
its gonna be the same.

Best Regards
John


On Friday, 17 May 2019 23:47:38 UTC+2, 黄祥 wrote:
>
> Editing apps and reloading forks for me. Please try again and let's try 
>> figure out why does not work for you.
>>
>
> after tried latest commit (110), guess when it's work on you, but not work 
> on us, perhaps related with module installed (python or js via npm) on your 
> side, but not installed on us. not sure just guess.
>
> best regards,
> stifan 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3b2a4b86-330c-4cf5-a883-83068d3626f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web3py

2019-05-17 Thread John Bannister
Update on this :-

Just tried it on native windows10  python3.7 and same results. New 
functions return error 404 until server restart.

BR
John

On Friday, 17 May 2019 18:49:28 UTC+2, 黄祥 wrote:
>
> problem still exist (in commits 110) only superheroes app traceback error 
> is gone when hit 'reload apps':
> 1. 'routes for ' disappears after hit 'reload apps' for : 
> - scaffold
> - myapp
> but for _dashboard, example, todo still exist (appears as expected)
> 2. editing and adding new function in controller apps/myapp/controller.py
> @action('helloworld') # exposes http://127.0.0.1:8000/myapp/helloworld
> @action.uses(db, 'helloworld.html')
> def helloworld(): return dict(name=request.forms.get('name', 'visitoras'))
>
> @action('helloworld1') # exposes http://127.0.0.1:8000/myapp/helloworld
> @action.uses(db, 'helloworld.html')
> def helloworld1(): return dict(name=request.forms.get('name', 'visitorasd'
> ))
>
> *result (not expected) when hit : *http://localhost:8000/myapp/helloworld
> Hello Dear visitor
>
> *result (not expected) when hit : *http://localhost:8000/myapp/helloworld1
> 404
> not found
>
> *steps*
> rm -rf web3py
> git clone https://github.com/web2py/web3py
> cd web3py
> source activate python3_test
> pip install -U -r requirements.txt
> ./web3py-start apps
>
> also seen you've had mailer.py, is still not tested yet, no example or no 
> doc available
>
> best regards,
> stifan
>

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


RE: [web2py] Re: new DBAPI in pydal for both web2py and web3py

2019-05-17 Thread John Bannister
As you are da man I would suggest DaQL .. DALQL is a bit of a mouth full J

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimiliano
Sent: 17 May 2019 18:56
To: web2py@googlegroups.com
Subject: Re: [web2py] Re: new DBAPI in pydal for both web2py and web3py

 

DALQL

 

 

On Fri, May 17, 2019 at 5:42 PM Massimo Di Pierro  
wrote:

I am embarrassed I have forgotten all about latin. :-(

 

The italian equivalent would be "accesso" but does not sound nice to me.

 

I am not too concerned about naming conflicts as long as the name is simple to 
remember and conveys what it does.

After all it is the name of a file and a class, not a package.

 

I do not think Gate/ Bus, etc convey it. {something}QL would be nice but 
{anything simple}QL appears to be taken.

Also this is not just a QL as it supports all rest methods with policies.

 

Massimo

 

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/059b32ee-e5f0-45d4-800f-cfee8d353202%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CANPTPxJumAdQ3veA%3Dw76xbrAD-aFLDZoyrzhTQJ9Nu88HzZt9Q%40mail.gmail.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/008001d50cd2%2449f92d70%24ddeb8850%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: [web2py] Re: Web3py

2019-05-17 Thread John Bannister
Hi Massimo,

 

I have downloaded latest web3py and same thing is happening. I can see in the 
console that it is reloading all the apps but for me updates are not happening 
until I restart the server.

 

I am running web3py in a python3 venv  on windows/linux (Ubuntu 18) python 3.6.

 

Myapp/controller.py

 

from web3py import action, request, redirect, abort

from . models import db

 

@action('helloworld') # exposes http://127.0.0.1:8000/myapp/helloworld

@action.uses(db, 'helloworld.html')

def helloworld(): return dict(name=request.forms.get('name', 'visitor'))

 

@action('helloworld1') # exposes http://127.0.0.1:8000/myapp/helloworld1

@action.uses(db, 'helloworld.html')

def helloworld1(): return dict(name=' 1 '+ request.forms.get('name', 'visitor'))

 

@action('helloworld2') # exposes http://127.0.0.1:8000/myapp/helloworld2

@action.uses(db, 'helloworld.html')

def helloworld2(): return dict(name=' 2 ' +request.forms.get('name', 'visitor'))

 

@action('helloworld3') # exposes http://127.0.0.1:8000/myapp/helloworld3

@action.uses(db, 'helloworld.html')

def helloworld3(): return dict(name=' 3 ' + request.forms.get('name', 
'visitor'))  

 

After reload apps only helloworld accessible. After server restart all are.

 

BR

John

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 17 May 2019 17:12
To: web2py-users
Subject: Re: [web2py] Re: Web3py

 

I fixed the database locking problem. missing db.commit()

Editing apps and reloading forks for me. Please try again and let's try figure 
out why does not work for you.

It is intentionally reloading all apps but this can easily be changed. I will 
change it.

 

Massimo

 


On Friday, 17 May 2019 02:10:27 UTC-7, John Bannister wrote:

Hi Massimo,

 

I have tried that but it has no effect. It seems to be doing something for a 
while but the only way I can get changes to appear is to restart the server.

 

Basically what I did was to copy and rename the helloworld action a few times 
so helloworld1 …….helloworld7 (all in same controller.py)  giving appropriate 
return messages.

 

If I reload using the dashboard button I still only see helloworld (the rest 
give me 404 errors) but if I restart the server I can access myapp/helloworld1 
to myapp/helloworld7.

 

Also it seems that the reload apps button is reloading all the apps in the 
applications directory. Is this intentional or is there a way to just reload 
the app currently being developed?

 

BR

John 

 

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 17 May 2019 09:36
To: web2py-users
Subject: [web2py] Re: Web3py

 

yes. There is a button on the top/right of the dashboard "reload apps"

On Thursday, 16 May 2019 08:15:44 UTC-7, John Bannister wrote:

Hi All,

 

Had a first real 'play' with web3py' today and have a few questions the biggest 
of which I am hoping the gurus will be able to answer:-

 

1: Is there any way to not to have to restart the app every time changes are 
made to actions in the controller or new actions added etc? I understand that 
controllers are basically being imported when the app fires up but is any there 
any way to occasionally reload instead of having to restart the app? This is a 
fairly big one for me as sometimes tweaks will need to be made in production 
and restarting the web server is not really an option so hopefully I am missing 
something really simple.

 

Thanks in advance

John

 

 

 

 

 

 

  

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c33707df-ec41-4574-a6a6-54c2905ff10e%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/c33707df-ec41-4574-a6a6-54c2905ff10e%40googlegroups.com?utm_medium=email_source=footer>
 .
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/84b51eaa-209e-45fa-88a3-d4f986f7a441%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/84b51eaa-209e-45fa-88a3-d4f986f7a441%40googlegroups.com?utm_medium=email_so

RE: [web2py] Re: new DBAPI in pydal for both web2py and web3py

2019-05-17 Thread John Bannister
How about Despresso (for database express O ).  J

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 17 May 2019 17:43
To: web2py-users
Subject: [web2py] Re: new DBAPI in pydal for both web2py and web3py

 

I am embarrassed I have forgotten all about latin. :-(

 

The italian equivalent would be "accesso" but does not sound nice to me.

 

I am not too concerned about naming conflicts as long as the name is simple to 
remember and conveys what it does.

After all it is the name of a file and a class, not a package.

 

I do not think Gate/ Bus, etc convey it. {something}QL would be nice but 
{anything simple}QL appears to be taken.

Also this is not just a QL as it supports all rest methods with policies.

 

Massimo

 

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/059b32ee-e5f0-45d4-800f-cfee8d353202%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/001801d50ccb%24a9f72b20%24fde58160%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: [web2py] Re: Web3py

2019-05-17 Thread John Bannister
Hi Massimo,

 

I have tried that but it has no effect. It seems to be doing something for a 
while but the only way I can get changes to appear is to restart the server.

 

Basically what I did was to copy and rename the helloworld action a few times 
so helloworld1 …….helloworld7 (all in same controller.py)  giving appropriate 
return messages.

 

If I reload using the dashboard button I still only see helloworld (the rest 
give me 404 errors) but if I restart the server I can access myapp/helloworld1 
to myapp/helloworld7.

 

Also it seems that the reload apps button is reloading all the apps in the 
applications directory. Is this intentional or is there a way to just reload 
the app currently being developed?

 

BR

John 

 

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 17 May 2019 09:36
To: web2py-users
Subject: [web2py] Re: Web3py

 

yes. There is a button on the top/right of the dashboard "reload apps"

On Thursday, 16 May 2019 08:15:44 UTC-7, John Bannister wrote:

Hi All,

 

Had a first real 'play' with web3py' today and have a few questions the biggest 
of which I am hoping the gurus will be able to answer:-

 

1: Is there any way to not to have to restart the app every time changes are 
made to actions in the controller or new actions added etc? I understand that 
controllers are basically being imported when the app fires up but is any there 
any way to occasionally reload instead of having to restart the app? This is a 
fairly big one for me as sometimes tweaks will need to be made in production 
and restarting the web server is not really an option so hopefully I am missing 
something really simple.

 

Thanks in advance

John

 

 

 

 

 

 

  

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c33707df-ec41-4574-a6a6-54c2905ff10e%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/c33707df-ec41-4574-a6a6-54c2905ff10e%40googlegroups.com?utm_medium=email_source=footer>
 .
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/02ab01d50c90%245b5be270%241213a750%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Web3Py equivalent of SQLFORM.grid

2019-05-16 Thread John Bannister
Hi Massimo,

Had a quick look at the mtable prototype in the _dashboad/dbadmin and 
re-visiting datatables as well. Will need to spend a bit more time on both 
before I can come to any sort of solution but thanks very much for the 
input. 

On Thursday, 16 May 2019 16:50:48 UTC+2, Massimo Di Pierro wrote:
>
> Web3py will have a replacement for smartgrid based on vue. You can look at 
> the mtable component already in there as a prototype. Anyway, nothing wrong 
> with datatables.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ea2307b5-7547-49db-b172-b049b82aace4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Web3py

2019-05-16 Thread John Bannister
Hi All,

Had a first real 'play' with web3py' today and have a few questions the 
biggest of which I am hoping the gurus will be able to answer:-

1: Is there any way to not to have to restart the app every time changes 
are made to actions in the controller or new actions added etc? I 
understand that controllers are basically being imported when the app fires 
up but is any there any way to occasionally reload instead of having to 
restart the app? This is a fairly big one for me as sometimes tweaks will 
need to be made in production and restarting the web server is not really 
an option so hopefully I am missing something really simple.

Thanks in advance
John






  

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/51ba492d-542e-4d2d-a620-1776ca2a5bb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Web3Py equivalent of SQLFORM.grid

2019-05-16 Thread John Bannister
Hi Jose,

Completely understandable on the code side of things and appreciate your 
sharing. I will for sure revisit the Datatables option this week with the 
information you have provided.

Once again thanks for your time and assistance
John

On Thursday, 16 May 2019 13:06:46 UTC+2, José L. wrote:
>
> I can't show you all the code because the property belongs to the person 
> who asked me to do it, 
> This is the part that takes the dataables json requests, fetch the records 
> and format them to be understood by datatables. I am skipping the 
> sorting/filtering part , that builds the  *query_filter* and *orderby* 
> variables
> I have also changed the table name by MY_TABLE and remove one field name. 
>
> Also, beware in this case the total number of records uses count(), you 
> will have to replace it if your table has many records.
>
> Hope it helps you.
> José L.
>
> @service.jsondef logs_table():
> query_filter = None
>
> if request.vars.start is not None:
> iDisplayStart = int(request.vars.start)
> else:
> iDisplayStart = 0
>
> if request.vars.length is not None:
> iDisplayLength = int(request.vars.length)
> else:
> iDisplayLength = 10
>
> if request.vars.draw is not None:
> sEcho = int(request.vars.draw)
> else:
> sEcho = 1
>
> 
>
> 
>
> query = db(query_filter).select(db.MY_TABLE.ALL,
> limitby=(iDisplayStart, iDisplayStart + iDisplayLength),
> orderby=orderby)
>
> iTotalRecords = db(query_filter).count()
>
> # iTotalRecords = 100
> aaData = []
>
> for row in query:
> datarow = {}
> for col in row:
> if row[col] is not None:
> if col == 'MY_TABLE' or '_record' in col:
> # internal dal col names
> continue
> elif col == 'name of field that is a datetime':
> datarow[col] = row[col].strftime('%Y-%m-%d %H:%M:%S')
> else:
> datarow[col] = row[col]
> else:
> datarow[col] = ''
>
>     aaData.append(datarow)
> return dict(draw=sEcho, recordsTotal=iTotalRecords, 
> recordsFiltered=iTotalRecords, data=aaData)
>
>
> El jue., 16 may. 2019 a las 12:51, John Bannister ( >) escribió:
>
>> Hey Jose,
>>
>> Thanks for the quick response. Much appreciated. Do you happen to have a 
>> small working example of Datatables setup in server mode that I could take 
>> a look at to hopefully save some time? I last looked at it a few years ago 
>> as mentioned and any pointers would be great.
>>
>> Thanks in advance
>> John
>>
>> On Thursday, 16 May 2019 12:42:17 UTC+2, José L. wrote:
>>>
>>> Hey John, 
>>>
>>> I have used datatables with web2py in some projects and it was faster 
>>> than smartgrid when used in server mode.
>>> Whenever I had performance problems was because the code used .count() 
>>> to show the total number of records. In my case the tables have several 
>>> millions of records and that was way too slow. 
>>> That's a common problem in many databases engines, not a datatables 
>>> problem.
>>>
>>> When using an aprox. number instead of executing the sql count() 
>>> command, the datatable works fine showing hundred of rows from a table.
>>>
>>> You have to make your own code for the server side, to support filter or 
>>> sort if you need them, but it's quite straightforward.
>>>
>>> José L.
>>>
>>> El jue., 16 may. 2019 a las 11:42, John Bannister () 
>>> escribió:
>>>
>>>> Hi All,
>>>>
>>>> I have a number of web2py applications that use the grid/smartgrid 
>>>> functionality pretty heavily. The majority of the applications are working 
>>>> with large data sets (some tables have > 20M records) and everything runs 
>>>> fine.
>>>>
>>>> With the coming of Web3Py (which looks great) my question is what would 
>>>> be a viable equivalent to web2py's grid/smartgrid?
>>>>
>>>> I looked at Datatables some time back which worked great on smaller 
>>>> datasets but anything over 50K (on my testbed) starts to become unusable. 
>>>> I 
>>>> also implemented some server side processing for Datatables but never 
>>>> quite 
>>>> managed to get a usable solution or at least nothing that could handle big 
>>>> da

Re: [web2py] Web3Py equivalent of SQLFORM.grid

2019-05-16 Thread John Bannister
Hey Jose,

Thanks for the quick response. Much appreciated. Do you happen to have a 
small working example of Datatables setup in server mode that I could take 
a look at to hopefully save some time? I last looked at it a few years ago 
as mentioned and any pointers would be great.

Thanks in advance
John

On Thursday, 16 May 2019 12:42:17 UTC+2, José L. wrote:
>
> Hey John, 
>
> I have used datatables with web2py in some projects and it was faster than 
> smartgrid when used in server mode.
> Whenever I had performance problems was because the code used .count() to 
> show the total number of records. In my case the tables have several 
> millions of records and that was way too slow. 
> That's a common problem in many databases engines, not a datatables 
> problem.
>
> When using an aprox. number instead of executing the sql count() command, 
> the datatable works fine showing hundred of rows from a table.
>
> You have to make your own code for the server side, to support filter or 
> sort if you need them, but it's quite straightforward.
>
> José L.
>
> El jue., 16 may. 2019 a las 11:42, John Bannister ( >) escribió:
>
>> Hi All,
>>
>> I have a number of web2py applications that use the grid/smartgrid 
>> functionality pretty heavily. The majority of the applications are working 
>> with large data sets (some tables have > 20M records) and everything runs 
>> fine.
>>
>> With the coming of Web3Py (which looks great) my question is what would 
>> be a viable equivalent to web2py's grid/smartgrid?
>>
>> I looked at Datatables some time back which worked great on smaller 
>> datasets but anything over 50K (on my testbed) starts to become unusable. I 
>> also implemented some server side processing for Datatables but never quite 
>> managed to get a usable solution or at least nothing that could handle big 
>> data sets as efficiently as web2py.
>>
>> So basically looking for something that can handle large datasets that 
>> will plug into web3py if anyone has any recommendations they would be much 
>> appreciated or if anyone has managed to get Datatables working well with 
>> large data sets some guidance would be great.
>>
>> 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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/8e109e58-f4ac-4272-a835-d86e5101c7fe%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/8e109e58-f4ac-4272-a835-d86e5101c7fe%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/49640192-d789-44e5-a4e9-db852e8d760f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Web3Py equivalent of SQLFORM.grid

2019-05-16 Thread John Bannister
Hi All,

I have a number of web2py applications that use the grid/smartgrid 
functionality pretty heavily. The majority of the applications are working 
with large data sets (some tables have > 20M records) and everything runs 
fine.

With the coming of Web3Py (which looks great) my question is what would be 
a viable equivalent to web2py's grid/smartgrid?

I looked at Datatables some time back which worked great on smaller 
datasets but anything over 50K (on my testbed) starts to become unusable. I 
also implemented some server side processing for Datatables but never quite 
managed to get a usable solution or at least nothing that could handle big 
data sets as efficiently as web2py.

So basically looking for something that can handle large datasets that will 
plug into web3py if anyone has any recommendations they would be much 
appreciated or if anyone has managed to get Datatables working well with 
large data sets some guidance would be great.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8e109e58-f4ac-4272-a835-d86e5101c7fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: [web2py] Confirmation forms. The book is unclear. How can I associate a pop confirmation box with a link?

2019-05-03 Thread John Bannister
I came across the same issue recently and managed to solve it as follows:-

 

lambda row: A(SPAN('Delete', _class="button btn btn-info btn-sm", 
_title='Delete', _onclick = "return confirm('Are you sure?');"), \

 _href=URL("default", 
"delete_company",args=[row.id])),

   

This will give you the standard pop confirmation box with customised text.

 

Hope this helps.

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
dgma...@gmail.com
Sent: 02 May 2019 21:58
To: web2py-users
Subject: [web2py] Confirmation forms. The book is unclear. How can I associate 
a pop confirmation box with a link?

 

This has been asked before but I can't find any usable answers, at least for 
those who aren't experts on css and javascript.

 

Tried to do something along the lines suggested in the book 'Forms and 
Validators/Confirmation Forms' without any success. Either I'm stupid or this 
feature is broken or the explanation is incomplete/unhelpful.

 

Actually, my problem is a bit different. I am using SQLFORM.grid and 
.smartgrid, with additional links specified. On one of these links I would like 
to have a confirming Yes/No when the link is clicked, before following the 
link. It almost looks in the documentation if this could be done using the A() 
helper, but I can't figure it out. My link is a replacement for the standard 
Delete button because there is other stuff that needs to be done BEFORE the 
deletion is performed, rather than after via ondelete.

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

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


RE: [web2py] Re: Modules not loading in python 3

2019-04-11 Thread John Bannister
Thanks to all for the responses. Much appreciated. Will try the .module and 
revert.

 

Thanks once again 

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
etienne
Sent: 11 April 2019 09:07
To: web2py-users
Subject: [web2py] Re: Modules not loading in python 3

 

Hello,

 

The error message is a bit misleading but it is related to the way python 3 is 
managing modules. For files sitting in the same directory you have to modify 
the import from:

 

import mymodule

 

to 

 

import .mymodule

 

and it should work.

 

It turns out that on any import error, custom_import will give this message of  
"applications.app_name.modules.module_name"  not found.

 

 


Le dimanche 7 avril 2019 06:18:03 UTC+2, John Bannister a écrit :

 

 Hi all,

 

I have recently upgraded to python 3.6 from 2.7 running on Centos7 with apache. 
Problem I am having is as follows:-

1: I have a number of apps each of which has a number of modules. Whilst it 
seems that I can import modules from paython (such as pytz etc) and I can also 
import modules into controllers/models what I cant seem to be able to do is to 
import a module into another module.

 

Example :

 

I have 2 modules invoices and invoice in modules directory. I can import either 
or both into a controller but I cannot import invoice module into invoices 
module.

 

I have tried using applications.app_name.modules.invoice as well as just 
invoice (as both are in same directory) but not happening for me. 

 

I get same standard import error traceback whatever I use. i.e custom import 
error .. no module "applications.app_name.modules.module_name"  found

 

Note:- all is working fine in python 2.7

 

Has anyone come across this issue or does anyone have a solution? I have 
reverted back to 2.7 for now   

-- 
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] Modules not loading in python 3

2019-04-06 Thread John Bannister

 Hi all,

I have recently upgraded to python 3.6 from 2.7 running on Centos7 with 
apache. Problem I am having is as follows:-
1: I have a number of apps each of which has a number of modules. Whilst it 
seems that I can import modules from paython (such as pytz etc) and I can 
also import modules into controllers/models what I cant seem to be able to 
do is to import a module into another module.

Example :

I have 2 modules invoices and invoice in modules directory. I can import 
either or both into a controller but I cannot import invoice module into 
invoices module.

I have tried using applications.app_name.modules.invoice as well as just 
invoice (as both are in same directory) but not happening for me. 

I get same standard import error traceback whatever I use. i.e custom 
import error .. no module "applications.app_name.modules.module_name"  found

Note:- all is working fine in python 2.7

Has anyone come across this issue or does anyone have a solution? I have 
reverted back to 2.7 for now   

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