[web2py] Re: how to LOAD a form with all the necessary details

2020-01-23 Thread mostwanted
So i have decided to use a session to carry the request id to the LOAD page 
to open the form with the name of the company whose link was clicked! I do 
not know if this is the best solution or i'm just reaching but it is 
working right now! I just dont know if in the long run it will fall apart 
maye because of something i dont know about sessions & I have applied them 
in the wrong way! Please advice me if i'm doing nonsense, your guidance 
will be most appreciated!

This is what i did in the controller:
def quotation():
response.flash = T("PLEASE UNDERSTAND THAT ALL THE QUOTED ITEMS WILL BE 
ENTERED AND QUOTED ONE ITEM AT A TIME")
*session.quotation=db.Client_Details(request.args(0, cast=int))*
return locals()

def quotationLoad():
*db.quotation.customer.default=session.quotation.id*
form=SQLFORM(db.quotation)
if form.process().accepted:
response.flash=T('Client Quoted')
return locals()


The views remained the same
*VIEW*
{{extend 'layout.html'}}


$(document).ready(function() {
var interval = setInterval(function() {
var momentNow = moment();
$('#date-part').html(momentNow.format('DD  ') + ' '+ 
momentNow.format('').substring(0,3).toUpperCase());
$('#time-part').html(momentNow.format('hh:mm:ss A'));
}, 100);
});


{{block header}}

  
  PIQ v1.0
  
   |  | Logged In User: {{if auth.user:}}{{=auth.user.first_name}} {{=
auth.user.last_name}} {{=A('LOGOUT', _id="logingOut", _class="btn btn-info 
btn-lg", _href=URL('default', 'user', args='logout'))}}
{{pass}}


  

{{end}}


*{{=A('View Quotation', _href=URL('View_Quotation', 
args=session.quotation.id))}}*

 QUOTE A CLIENT


You are advised to Quote up to a maximum of 20 items in a 
single Quotation for a clear and readable Quotation.


*{{=LOAD('default', 'quotationLoad.load', ajax=True)}}*

TOP


*LOAD*



*{{=form}}*Regards;

Mostwanted






On Thursday, January 23, 2020 at 9:00:37 PM UTC+2, mostwanted wrote:
>
> What i'm trying to achieve is to select a company by clicking a link and 
> have a form open up with thee selected company name for the client to fill 
> up the form for that company & submit it. But I am using LOAD to take 
> advantage of ajax and prevent a page reload. The problem i am facing is 
> that in using LOAD the form does not open with the company name, it says a 
> company has not been selected and company name in the DB is set to NULL! 
>
> *CONTROLLER*
> def quotation():
> response.flash = T("PLEASE UNDERSTAND THAT ALL THE QUOTED ITEMS WILL 
> BE ENTERED AND QUOTED ONE ITEM AT A TIME")
> quotation=db.Client_Details(request.args(0, cast=int))
> db.quotation.customer.default=quotation.id
> return locals()
>
> def quotationLoad():
> form=SQLFORM(db.quotation)
> if form.process().accepted:
> response.flash=T('Client Quoted')
> return locals()
>
>
> *LOAD PAGE*
> {{=form}}
>
>
> *VIEWS*
> {{extend 'layout.html'}}
>
> 
> $(document).ready(function() {
> var interval = setInterval(function() {
> var momentNow = moment();
> $('#date-part').html(momentNow.format('DD  ') + ' '+ 
> momentNow.format('').substring(0,3).toUpperCase());
> $('#time-part').html(momentNow.format('hh:mm:ss A'));
> }, 100);
> });
> 
>
> {{block header}}
> 
>   
>   PIQ v1.0
>   
>|  |  id="user" >Logged In User: {{if auth.user:}}{{=auth.user.first_name}} {{=
> auth.user.last_name}} {{=A('LOGOUT', _id="logingOut", _class="btn btn-info 
> btn-lg", _href=URL('default', 'user', args='logout'))}}
> {{pass}}
>
> 
>   
> 
> {{end}}
> 
>  QUOTE A CLIENT
> 
> You are advised to Quote up to a maximum of 20 items in a 
> single Quotation for a clear and readable Quotation.
> 
> 
> *{{=LOAD('default', 'quotationLoad.load', ajax=True)}}*
> TOP
>
>  I am not sure if my question is clear, but if I could achieve this it 
> would be great for my application. Or alternatively help me find a way to 
> prevent my page from scrolling back to top everytime a page refreshes after 
> submitting a form.
>
> 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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1278759b-a226-4cbd-b4db-478166e3d833%40googlegroups.com.


[web2py] how to LOAD a form with all the necessary details

2020-01-23 Thread mostwanted
What i'm trying to achieve is to select a company by clicking a link and 
have a form open up with thee selected company name for the client to fill 
up the form for that company & submit it. But I am using LOAD to take 
advantage of ajax and prevent a page reload. The problem i am facing is 
that in using LOAD the form does not open with the company name, it says a 
company has not been selected and company name in the DB is set to NULL! 

*CONTROLLER*
def quotation():
response.flash = T("PLEASE UNDERSTAND THAT ALL THE QUOTED ITEMS WILL BE 
ENTERED AND QUOTED ONE ITEM AT A TIME")
quotation=db.Client_Details(request.args(0, cast=int))
db.quotation.customer.default=quotation.id
return locals()

def quotationLoad():
form=SQLFORM(db.quotation)
if form.process().accepted:
response.flash=T('Client Quoted')
return locals()


*LOAD PAGE*
{{=form}}


*VIEWS*
{{extend 'layout.html'}}


$(document).ready(function() {
var interval = setInterval(function() {
var momentNow = moment();
$('#date-part').html(momentNow.format('DD  ') + ' '+ 
momentNow.format('').substring(0,3).toUpperCase());
$('#time-part').html(momentNow.format('hh:mm:ss A'));
}, 100);
});


{{block header}}

  
  PIQ v1.0
  
   |  | Logged In User: {{if auth.user:}}{{=auth.user.first_name}} {{=
auth.user.last_name}} {{=A('LOGOUT', _id="logingOut", _class="btn btn-info 
btn-lg", _href=URL('default', 'user', args='logout'))}}
{{pass}}


  

{{end}}

 QUOTE A CLIENT

You are advised to Quote up to a maximum of 20 items in a 
single Quotation for a clear and readable Quotation.


*{{=LOAD('default', 'quotationLoad.load', ajax=True)}}*
TOP

 I am not sure if my question is clear, but if I could achieve this it 
would be great for my application. Or alternatively help me find a way to 
prevent my page from scrolling back to top everytime a page refreshes after 
submitting a form.

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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/13980eb1-f54a-4328-a72f-9c95846da037%40googlegroups.com.


Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Jim S
No problem with auth.has_permission web2py.  But I don't think it exists in 
py4web.  Someone please correct me if I'm spreading misinformation.  You 
can write it yourself, but I don't think it's included in py4web.

-Jim

On Thursday, January 23, 2020 at 10:02:00 AM UTC-6, Lovedie JC wrote:
>
> Is there a problem with @auth_has _permission?
> I intend to use it. 
> Regards 
>
> On Thu, Jan 23, 2020, 18:57 Jim S > wrote:
>
>> You'll be fine with the new system I believe as long as you're not 
>> currently using @auth.has_permission.  While you can do it with py4web it 
>> is more challenging than in web2py.
>>
>> -Jim
>>
>> On Thursday, January 23, 2020 at 9:47:43 AM UTC-6, Christian Varas wrote:
>>>
>>> Hi Jim.
>>>
>>> Yes I'm using the auth system permission.
>>> I'm using 2 decorators in fact
>>> @auth.requires_membership() and @auth.requires_login()
>>>
>>> I'm gonna port my app to py4web then :) 
>>>
>>> Thanks
>>>
>>> Cheers.
>>> Chris 
>>>
>>> El jue., 23 de ene. de 2020 11:27, Jim Steil  
>>> escribió:
>>>
 Sounds like a great app to do in py4web.  

1. You are already comfortable with javascript.  
2. You're not using grid/smartgrid.  
3. Are you using the web2py auth system with permissions?  If only 
using groups (roles) then this would be great to do with py4web.  
4. Much faster and you get to use Python3.

 -Jim


 On Thu, Jan 23, 2020 at 6:44 AM Christian Varas  
 wrote:

> Thanks for all that you share guys.
>
> I would like to ask for a recommendation.
>
> I have a web interface made with web2py, this interface manage a web 
> application firewall (nginx and modsecurity). It does commands and file 
> modifications in the system to manage properly the WAF, the database is 
> SQLite.
> I don't use sqlform.grid, most of the things in the view are made with 
> pure JavaScript and Html, and all the commands to the system are with 
> subprocess.
> Works pretty fast and without any issue.
>
> My question is if py4web is ok to do this tasks too, like editing 
> files in system, executing commands and task more oriented to the system 
> and not to a db.
>
>
> Now I have to a small adpatation to my app because modsecurity has a 
> new version and they changed some things, and I was thinking that maybe I 
> can port all to py4web and have a fresh new start, but I'm not sure..., I 
> love web2py and now is easy to me to do things with him.
>
> Should I stay in web2py? 
> Or I should start using py4web for this kind of project?
>
> Cheers!
> Chris.
>
>
> El mié., 22 de ene. de 2020 20:29, Carlos Costa  
> escribió:
>
>> Thanks for sharing you experience with py4web, Jim.
>>
>>
>> Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller  
>> escreveu:
>>
>>> The datatables integration for web2py would be super useful. I'm 
>>> sure we could port it over to py4web easily.
>>>
>>> I just feel like with all the stuff web2py gave us to get something 
>>> quickly going missing, it'd just another api framework and there are 
>>> fastapi and apistar as well falcon out..
>>>
>>> I think having these ease of use stuff back would really hit home 
>>> and would also make it easier to port from web2py.
>>>
>>> And we would be pretty much the Jhipster  of the python world no?
>>>
>>>
>>>
>>> On Wed, 22 Jan 2020, 23:50 Jim S,  wrote:
>>>
 Yes, I will post my main utils.py when I have it working better.  I 
 still have to clean up a couple pieces.  It would be up to Massimo if 
 he 
 wanted to add it.  But in response to one of my earlier questions I 
 was 
 told Massimo kept a utility like this out of py4web so people might 
 use 
 better tools like datatables.  And, I doubt my code is 
 'framework-ready'.  
 But it could give others insight into how you can work with py4web.

 Speaking of datatables, I wrote a datatables integration for web2py 
 last summer.  I think I could also add that to my utils.py pretty 
 easily.  
 Actually, the datatables piece would be easier that what I've done 
 writing 
 my own.  Would you use datatables for complete CRUD, or just to list 
 your 
 table for record selection, etc.?

 Now that you mentioned mtable, I too recall hearing that before, 
 but haven't gotten in to it at all.  Like I said, I haven't jumped in 
 to 
 the client-side javascript much yet, other than jquery.

 -Jim

 On Wednesday, January 22, 2020 at 4:31:11 PM UTC-6, Kevin Keller 
 wrote:
>
> Jim,
>
> Could your helpers be considered to be added to thr py4web code 

Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Kevin Keller
I havent looked at py4web so far, because I dont get how it does permission
in general.

Is there an easy way to use JWT tokens and OIDC/OAUTH2 with Vue.js easily?

I think its quite a pain to go through this in general.
This is why I really liked about rendered HTML page apps.

If its not a complex app for a long term project I lied the OOTB auth and
crud mechanism.

Making every app a SPA app now I have to deal with REST payloads,
seriazlzing, de-serializing, JWT tokens, OAUTH/OIDC etc.
And for my apps I dont need the increase in loading times or less calls to
the back end so much.

But maybe there are ways to make this simple as well with py4web and
vue.js.





On Thu, Jan 23, 2020 at 5:02 PM Lovedie JC  wrote:

> Is there a problem with @auth_has _permission?
> I intend to use it.
> Regards
>
> On Thu, Jan 23, 2020, 18:57 Jim S  wrote:
>
>> You'll be fine with the new system I believe as long as you're not
>> currently using @auth.has_permission.  While you can do it with py4web it
>> is more challenging than in web2py.
>>
>> -Jim
>>
>> On Thursday, January 23, 2020 at 9:47:43 AM UTC-6, Christian Varas wrote:
>>>
>>> Hi Jim.
>>>
>>> Yes I'm using the auth system permission.
>>> I'm using 2 decorators in fact
>>> @auth.requires_membership() and @auth.requires_login()
>>>
>>> I'm gonna port my app to py4web then :)
>>>
>>> Thanks
>>>
>>> Cheers.
>>> Chris
>>>
>>> El jue., 23 de ene. de 2020 11:27, Jim Steil 
>>> escribió:
>>>
 Sounds like a great app to do in py4web.

1. You are already comfortable with javascript.
2. You're not using grid/smartgrid.
3. Are you using the web2py auth system with permissions?  If only
using groups (roles) then this would be great to do with py4web.
4. Much faster and you get to use Python3.

 -Jim


 On Thu, Jan 23, 2020 at 6:44 AM Christian Varas 
 wrote:

> Thanks for all that you share guys.
>
> I would like to ask for a recommendation.
>
> I have a web interface made with web2py, this interface manage a web
> application firewall (nginx and modsecurity). It does commands and file
> modifications in the system to manage properly the WAF, the database is
> SQLite.
> I don't use sqlform.grid, most of the things in the view are made with
> pure JavaScript and Html, and all the commands to the system are with
> subprocess.
> Works pretty fast and without any issue.
>
> My question is if py4web is ok to do this tasks too, like editing
> files in system, executing commands and task more oriented to the system
> and not to a db.
>
>
> Now I have to a small adpatation to my app because modsecurity has a
> new version and they changed some things, and I was thinking that maybe I
> can port all to py4web and have a fresh new start, but I'm not sure..., I
> love web2py and now is easy to me to do things with him.
>
> Should I stay in web2py?
> Or I should start using py4web for this kind of project?
>
> Cheers!
> Chris.
>
>
> El mié., 22 de ene. de 2020 20:29, Carlos Costa 
> escribió:
>
>> Thanks for sharing you experience with py4web, Jim.
>>
>>
>> Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller 
>> escreveu:
>>
>>> The datatables integration for web2py would be super useful. I'm
>>> sure we could port it over to py4web easily.
>>>
>>> I just feel like with all the stuff web2py gave us to get something
>>> quickly going missing, it'd just another api framework and there are
>>> fastapi and apistar as well falcon out..
>>>
>>> I think having these ease of use stuff back would really hit home
>>> and would also make it easier to port from web2py.
>>>
>>> And we would be pretty much the Jhipster  of the python world no?
>>>
>>>
>>>
>>> On Wed, 22 Jan 2020, 23:50 Jim S,  wrote:
>>>
 Yes, I will post my main utils.py when I have it working better.  I
 still have to clean up a couple pieces.  It would be up to Massimo if 
 he
 wanted to add it.  But in response to one of my earlier questions I was
 told Massimo kept a utility like this out of py4web so people might use
 better tools like datatables.  And, I doubt my code is 
 'framework-ready'.
 But it could give others insight into how you can work with py4web.

 Speaking of datatables, I wrote a datatables integration for web2py
 last summer.  I think I could also add that to my utils.py pretty 
 easily.
 Actually, the datatables piece would be easier that what I've done 
 writing
 my own.  Would you use datatables for complete CRUD, or just to list 
 your
 table for record selection, etc.?

 Now that you mentioned mtable, I too recall hearing that before,
 but haven't gotten in 

Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Lovedie JC
Is there a problem with @auth_has _permission?
I intend to use it.
Regards

On Thu, Jan 23, 2020, 18:57 Jim S  wrote:

> You'll be fine with the new system I believe as long as you're not
> currently using @auth.has_permission.  While you can do it with py4web it
> is more challenging than in web2py.
>
> -Jim
>
> On Thursday, January 23, 2020 at 9:47:43 AM UTC-6, Christian Varas wrote:
>>
>> Hi Jim.
>>
>> Yes I'm using the auth system permission.
>> I'm using 2 decorators in fact
>> @auth.requires_membership() and @auth.requires_login()
>>
>> I'm gonna port my app to py4web then :)
>>
>> Thanks
>>
>> Cheers.
>> Chris
>>
>> El jue., 23 de ene. de 2020 11:27, Jim Steil 
>> escribió:
>>
>>> Sounds like a great app to do in py4web.
>>>
>>>1. You are already comfortable with javascript.
>>>2. You're not using grid/smartgrid.
>>>3. Are you using the web2py auth system with permissions?  If only
>>>using groups (roles) then this would be great to do with py4web.
>>>4. Much faster and you get to use Python3.
>>>
>>> -Jim
>>>
>>>
>>> On Thu, Jan 23, 2020 at 6:44 AM Christian Varas 
>>> wrote:
>>>
 Thanks for all that you share guys.

 I would like to ask for a recommendation.

 I have a web interface made with web2py, this interface manage a web
 application firewall (nginx and modsecurity). It does commands and file
 modifications in the system to manage properly the WAF, the database is
 SQLite.
 I don't use sqlform.grid, most of the things in the view are made with
 pure JavaScript and Html, and all the commands to the system are with
 subprocess.
 Works pretty fast and without any issue.

 My question is if py4web is ok to do this tasks too, like editing files
 in system, executing commands and task more oriented to the system and not
 to a db.


 Now I have to a small adpatation to my app because modsecurity has a
 new version and they changed some things, and I was thinking that maybe I
 can port all to py4web and have a fresh new start, but I'm not sure..., I
 love web2py and now is easy to me to do things with him.

 Should I stay in web2py?
 Or I should start using py4web for this kind of project?

 Cheers!
 Chris.


 El mié., 22 de ene. de 2020 20:29, Carlos Costa 
 escribió:

> Thanks for sharing you experience with py4web, Jim.
>
>
> Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller 
> escreveu:
>
>> The datatables integration for web2py would be super useful. I'm sure
>> we could port it over to py4web easily.
>>
>> I just feel like with all the stuff web2py gave us to get something
>> quickly going missing, it'd just another api framework and there are
>> fastapi and apistar as well falcon out..
>>
>> I think having these ease of use stuff back would really hit home and
>> would also make it easier to port from web2py.
>>
>> And we would be pretty much the Jhipster  of the python world no?
>>
>>
>>
>> On Wed, 22 Jan 2020, 23:50 Jim S,  wrote:
>>
>>> Yes, I will post my main utils.py when I have it working better.  I
>>> still have to clean up a couple pieces.  It would be up to Massimo if he
>>> wanted to add it.  But in response to one of my earlier questions I was
>>> told Massimo kept a utility like this out of py4web so people might use
>>> better tools like datatables.  And, I doubt my code is 
>>> 'framework-ready'.
>>> But it could give others insight into how you can work with py4web.
>>>
>>> Speaking of datatables, I wrote a datatables integration for web2py
>>> last summer.  I think I could also add that to my utils.py pretty 
>>> easily.
>>> Actually, the datatables piece would be easier that what I've done 
>>> writing
>>> my own.  Would you use datatables for complete CRUD, or just to list 
>>> your
>>> table for record selection, etc.?
>>>
>>> Now that you mentioned mtable, I too recall hearing that before, but
>>> haven't gotten in to it at all.  Like I said, I haven't jumped in to the
>>> client-side javascript much yet, other than jquery.
>>>
>>> -Jim
>>>
>>> On Wednesday, January 22, 2020 at 4:31:11 PM UTC-6, Kevin Keller
>>> wrote:

 Jim,

 Could your helpers be considered to be added to thr py4web code
 base?

 If you say you have a sqlform.grid equivalent or something in that
 direction?

 I think there was mtable that should take the spot, but haven't
 seen any examples yet or at least none thst would replace a sqlform or
 smartgrid.

 If it is not coming I would probaly consider using datatables js in
 the future.




 On Wed, 22 Jan 2020, 21:47 Jim S,  wrote:

> For me, 

Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Jim S
You'll be fine with the new system I believe as long as you're not 
currently using @auth.has_permission.  While you can do it with py4web it 
is more challenging than in web2py.

-Jim

On Thursday, January 23, 2020 at 9:47:43 AM UTC-6, Christian Varas wrote:
>
> Hi Jim.
>
> Yes I'm using the auth system permission.
> I'm using 2 decorators in fact
> @auth.requires_membership() and @auth.requires_login()
>
> I'm gonna port my app to py4web then :) 
>
> Thanks
>
> Cheers.
> Chris 
>
> El jue., 23 de ene. de 2020 11:27, Jim Steil  > escribió:
>
>> Sounds like a great app to do in py4web.  
>>
>>1. You are already comfortable with javascript.  
>>2. You're not using grid/smartgrid.  
>>3. Are you using the web2py auth system with permissions?  If only 
>>using groups (roles) then this would be great to do with py4web.  
>>4. Much faster and you get to use Python3.
>>
>> -Jim
>>
>>
>> On Thu, Jan 23, 2020 at 6:44 AM Christian Varas > > wrote:
>>
>>> Thanks for all that you share guys.
>>>
>>> I would like to ask for a recommendation.
>>>
>>> I have a web interface made with web2py, this interface manage a web 
>>> application firewall (nginx and modsecurity). It does commands and file 
>>> modifications in the system to manage properly the WAF, the database is 
>>> SQLite.
>>> I don't use sqlform.grid, most of the things in the view are made with 
>>> pure JavaScript and Html, and all the commands to the system are with 
>>> subprocess.
>>> Works pretty fast and without any issue.
>>>
>>> My question is if py4web is ok to do this tasks too, like editing files 
>>> in system, executing commands and task more oriented to the system and not 
>>> to a db.
>>>
>>>
>>> Now I have to a small adpatation to my app because modsecurity has a new 
>>> version and they changed some things, and I was thinking that maybe I can 
>>> port all to py4web and have a fresh new start, but I'm not sure..., I love 
>>> web2py and now is easy to me to do things with him.
>>>
>>> Should I stay in web2py? 
>>> Or I should start using py4web for this kind of project?
>>>
>>> Cheers!
>>> Chris.
>>>
>>>
>>> El mié., 22 de ene. de 2020 20:29, Carlos Costa >> > escribió:
>>>
 Thanks for sharing you experience with py4web, Jim.


 Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller >>> > escreveu:

> The datatables integration for web2py would be super useful. I'm sure 
> we could port it over to py4web easily.
>
> I just feel like with all the stuff web2py gave us to get something 
> quickly going missing, it'd just another api framework and there are 
> fastapi and apistar as well falcon out..
>
> I think having these ease of use stuff back would really hit home and 
> would also make it easier to port from web2py.
>
> And we would be pretty much the Jhipster  of the python world no?
>
>
>
> On Wed, 22 Jan 2020, 23:50 Jim S, > 
> wrote:
>
>> Yes, I will post my main utils.py when I have it working better.  I 
>> still have to clean up a couple pieces.  It would be up to Massimo if he 
>> wanted to add it.  But in response to one of my earlier questions I was 
>> told Massimo kept a utility like this out of py4web so people might use 
>> better tools like datatables.  And, I doubt my code is 
>> 'framework-ready'.  
>> But it could give others insight into how you can work with py4web.
>>
>> Speaking of datatables, I wrote a datatables integration for web2py 
>> last summer.  I think I could also add that to my utils.py pretty 
>> easily.  
>> Actually, the datatables piece would be easier that what I've done 
>> writing 
>> my own.  Would you use datatables for complete CRUD, or just to list 
>> your 
>> table for record selection, etc.?
>>
>> Now that you mentioned mtable, I too recall hearing that before, but 
>> haven't gotten in to it at all.  Like I said, I haven't jumped in to the 
>> client-side javascript much yet, other than jquery.
>>
>> -Jim
>>
>> On Wednesday, January 22, 2020 at 4:31:11 PM UTC-6, Kevin Keller 
>> wrote:
>>>
>>> Jim,
>>>
>>> Could your helpers be considered to be added to thr py4web code 
>>> base? 
>>>
>>> If you say you have a sqlform.grid equivalent or something in that 
>>> direction? 
>>>
>>> I think there was mtable that should take the spot, but haven't seen 
>>> any examples yet or at least none thst would replace a sqlform or 
>>> smartgrid. 
>>>
>>> If it is not coming I would probaly consider using datatables js in 
>>> the future. 
>>>
>>>
>>>
>>>
>>> On Wed, 22 Jan 2020, 21:47 Jim S,  wrote:
>>>
 For me, there is no porting, it is re-writing.  While a lot of the 
 capabilities are there in py4web not all are part of py4web.  Due to 
 the 
 nature of how things work, a lot of the 

Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Christian Varas
Hi Jim.

Yes I'm using the auth system permission.
I'm using 2 decorators in fact
@auth.requires_membership() and @auth.requires_login()

I'm gonna port my app to py4web then :)

Thanks

Cheers.
Chris

El jue., 23 de ene. de 2020 11:27, Jim Steil  escribió:

> Sounds like a great app to do in py4web.
>
>1. You are already comfortable with javascript.
>2. You're not using grid/smartgrid.
>3. Are you using the web2py auth system with permissions?  If only
>using groups (roles) then this would be great to do with py4web.
>4. Much faster and you get to use Python3.
>
> -Jim
>
>
> On Thu, Jan 23, 2020 at 6:44 AM Christian Varas 
> wrote:
>
>> Thanks for all that you share guys.
>>
>> I would like to ask for a recommendation.
>>
>> I have a web interface made with web2py, this interface manage a web
>> application firewall (nginx and modsecurity). It does commands and file
>> modifications in the system to manage properly the WAF, the database is
>> SQLite.
>> I don't use sqlform.grid, most of the things in the view are made with
>> pure JavaScript and Html, and all the commands to the system are with
>> subprocess.
>> Works pretty fast and without any issue.
>>
>> My question is if py4web is ok to do this tasks too, like editing files
>> in system, executing commands and task more oriented to the system and not
>> to a db.
>>
>>
>> Now I have to a small adpatation to my app because modsecurity has a new
>> version and they changed some things, and I was thinking that maybe I can
>> port all to py4web and have a fresh new start, but I'm not sure..., I love
>> web2py and now is easy to me to do things with him.
>>
>> Should I stay in web2py?
>> Or I should start using py4web for this kind of project?
>>
>> Cheers!
>> Chris.
>>
>>
>> El mié., 22 de ene. de 2020 20:29, Carlos Costa 
>> escribió:
>>
>>> Thanks for sharing you experience with py4web, Jim.
>>>
>>>
>>> Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller 
>>> escreveu:
>>>
 The datatables integration for web2py would be super useful. I'm sure
 we could port it over to py4web easily.

 I just feel like with all the stuff web2py gave us to get something
 quickly going missing, it'd just another api framework and there are
 fastapi and apistar as well falcon out..

 I think having these ease of use stuff back would really hit home and
 would also make it easier to port from web2py.

 And we would be pretty much the Jhipster  of the python world no?



 On Wed, 22 Jan 2020, 23:50 Jim S,  wrote:

> Yes, I will post my main utils.py when I have it working better.  I
> still have to clean up a couple pieces.  It would be up to Massimo if he
> wanted to add it.  But in response to one of my earlier questions I was
> told Massimo kept a utility like this out of py4web so people might use
> better tools like datatables.  And, I doubt my code is 'framework-ready'.
> But it could give others insight into how you can work with py4web.
>
> Speaking of datatables, I wrote a datatables integration for web2py
> last summer.  I think I could also add that to my utils.py pretty easily.
> Actually, the datatables piece would be easier that what I've done writing
> my own.  Would you use datatables for complete CRUD, or just to list your
> table for record selection, etc.?
>
> Now that you mentioned mtable, I too recall hearing that before, but
> haven't gotten in to it at all.  Like I said, I haven't jumped in to the
> client-side javascript much yet, other than jquery.
>
> -Jim
>
> On Wednesday, January 22, 2020 at 4:31:11 PM UTC-6, Kevin Keller wrote:
>>
>> Jim,
>>
>> Could your helpers be considered to be added to thr py4web code base?
>>
>> If you say you have a sqlform.grid equivalent or something in that
>> direction?
>>
>> I think there was mtable that should take the spot, but haven't seen
>> any examples yet or at least none thst would replace a sqlform or
>> smartgrid.
>>
>> If it is not coming I would probaly consider using datatables js in
>> the future.
>>
>>
>>
>>
>> On Wed, 22 Jan 2020, 21:47 Jim S,  wrote:
>>
>>> For me, there is no porting, it is re-writing.  While a lot of the
>>> capabilities are there in py4web not all are part of py4web.  Due to the
>>> nature of how things work, a lot of the 'global' structures in web2py 
>>> have
>>> to be handled differently in py4web.
>>>
>>> SQLFORM.grid is gone.  FORM replaces SQLFORM but doesn't have all
>>> the features -
>>> https://py4web.com/_documentation/static/index.html#chapter-10
>>> auth_group and auth_membership and auth_permission are gone -
>>> authentication/authorization have changed -
>>> https://py4web.com/_documentation/static/index.html#chapter-11
>>>
>>> With those things being what they are, I've 

Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Jim Steil
Sounds like a great app to do in py4web.

   1. You are already comfortable with javascript.
   2. You're not using grid/smartgrid.
   3. Are you using the web2py auth system with permissions?  If only using
   groups (roles) then this would be great to do with py4web.
   4. Much faster and you get to use Python3.

-Jim


On Thu, Jan 23, 2020 at 6:44 AM Christian Varas 
wrote:

> Thanks for all that you share guys.
>
> I would like to ask for a recommendation.
>
> I have a web interface made with web2py, this interface manage a web
> application firewall (nginx and modsecurity). It does commands and file
> modifications in the system to manage properly the WAF, the database is
> SQLite.
> I don't use sqlform.grid, most of the things in the view are made with
> pure JavaScript and Html, and all the commands to the system are with
> subprocess.
> Works pretty fast and without any issue.
>
> My question is if py4web is ok to do this tasks too, like editing files in
> system, executing commands and task more oriented to the system and not to
> a db.
>
>
> Now I have to a small adpatation to my app because modsecurity has a new
> version and they changed some things, and I was thinking that maybe I can
> port all to py4web and have a fresh new start, but I'm not sure..., I love
> web2py and now is easy to me to do things with him.
>
> Should I stay in web2py?
> Or I should start using py4web for this kind of project?
>
> Cheers!
> Chris.
>
>
> El mié., 22 de ene. de 2020 20:29, Carlos Costa 
> escribió:
>
>> Thanks for sharing you experience with py4web, Jim.
>>
>>
>> Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller 
>> escreveu:
>>
>>> The datatables integration for web2py would be super useful. I'm sure we
>>> could port it over to py4web easily.
>>>
>>> I just feel like with all the stuff web2py gave us to get something
>>> quickly going missing, it'd just another api framework and there are
>>> fastapi and apistar as well falcon out..
>>>
>>> I think having these ease of use stuff back would really hit home and
>>> would also make it easier to port from web2py.
>>>
>>> And we would be pretty much the Jhipster  of the python world no?
>>>
>>>
>>>
>>> On Wed, 22 Jan 2020, 23:50 Jim S,  wrote:
>>>
 Yes, I will post my main utils.py when I have it working better.  I
 still have to clean up a couple pieces.  It would be up to Massimo if he
 wanted to add it.  But in response to one of my earlier questions I was
 told Massimo kept a utility like this out of py4web so people might use
 better tools like datatables.  And, I doubt my code is 'framework-ready'.
 But it could give others insight into how you can work with py4web.

 Speaking of datatables, I wrote a datatables integration for web2py
 last summer.  I think I could also add that to my utils.py pretty easily.
 Actually, the datatables piece would be easier that what I've done writing
 my own.  Would you use datatables for complete CRUD, or just to list your
 table for record selection, etc.?

 Now that you mentioned mtable, I too recall hearing that before, but
 haven't gotten in to it at all.  Like I said, I haven't jumped in to the
 client-side javascript much yet, other than jquery.

 -Jim

 On Wednesday, January 22, 2020 at 4:31:11 PM UTC-6, Kevin Keller wrote:
>
> Jim,
>
> Could your helpers be considered to be added to thr py4web code base?
>
> If you say you have a sqlform.grid equivalent or something in that
> direction?
>
> I think there was mtable that should take the spot, but haven't seen
> any examples yet or at least none thst would replace a sqlform or
> smartgrid.
>
> If it is not coming I would probaly consider using datatables js in
> the future.
>
>
>
>
> On Wed, 22 Jan 2020, 21:47 Jim S,  wrote:
>
>> For me, there is no porting, it is re-writing.  While a lot of the
>> capabilities are there in py4web not all are part of py4web.  Due to the
>> nature of how things work, a lot of the 'global' structures in web2py 
>> have
>> to be handled differently in py4web.
>>
>> SQLFORM.grid is gone.  FORM replaces SQLFORM but doesn't have all the
>> features -
>> https://py4web.com/_documentation/static/index.html#chapter-10
>> auth_group and auth_membership and auth_permission are gone -
>> authentication/authorization have changed -
>> https://py4web.com/_documentation/static/index.html#chapter-11
>>
>> With those things being what they are, I've been playing with py4web
>> for a few days now and really am liking it.  It is crazy fast.  You may
>> have to write some more helpers to do some things that web2py did for 
>> you,
>> but that's half the fun, isn't it?  For instance, I used the grid that
>> web2py's SQLFORM.grid provides for lots of listing pages.  py4web doesn't
>> have one so I've written a 

[web2py] Re: Displaying for loop results only once

2020-01-23 Thread mostwanted
Thanks alot Tim, this is all i did:

{{for bookings in bookings:}}
*Quoted*
{{pass}} 
The red line above replaced alot of clearly unnecessary code!

Regards;

Mostwanted



On Tuesday, January 21, 2020 at 2:26:35 PM UTC+2, Tim Nyborg wrote:
>
> Simplest fix: use "any" instead:
>
> {{for bookings in bookings:}}
>
>   {{if any(bookings.company in q.customer.company for q in quotes):}}
> Quoted
>   {{pass}}
>
> {{pass}}
>
>
> To avoid all this looping, you could have a separate query join the two 
> tables and count the matches.
>
> On Saturday, 18 January 2020 23:00:04 UTC, mostwanted wrote:
>>
>> In my quotation system I have come up with a way to remind users of 
>> UN-deleted quotations. This helps them from creating new quotations on top 
>> of old quotations.
>> How it works is that when a company has been quoted its name is added to 
>> a list called the control list and a selected company's name is checked 
>> against this control list, if it is in the control list it will mean that 
>> it has been quoted and a blue badge titled quoted will be displayed next to 
>> the company's name. The problem I am facing now is that if the company has 
>> several items quoted under it it means that its name will appear several  
>> times in the control list, this causes the green badge to appear as many 
>> times as the company name appears in the control list, I want avoid this, 
>> is there a way to get the badge to appear only once regardless of the 
>> number of times the company name appears in the control list?
>>
>> *CONTROLLER*
>> def registeredClients():
>> bookings=db(db.Client_Details).select(db.Client_Details.ALL, orderby=
>> db.Client_Details.company)
>> quotes=db(db.quotation).select()
>> return locals()
>>
>> *CSS*
>> .disc
>> {
>> border: solid 2px transparent;
>> border-radius: 50%;
>> width: 40px;
>> padding: 5px;
>> }
>>
>> .blue
>> {
>> background-color: blue;
>> color: white;
>> font-weight: bold;
>> font-size: x-small;
>> }
>>
>> *VIEW*
>> {{for bookings in bookings:}}
>>
>> {{for q in quotes:}}
>> {{quoted=[q.customer.company]}}
>> Quoted
>> {{pass}}
>>
>> {{pass}}
>>
>> Please help!!!
>>
>> 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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/76ecf62c-d95c-4ede-85d1-5a4638cd3d95%40googlegroups.com.


Re: [web2py] Re: Web2py or py4web for a brand new project

2020-01-23 Thread Christian Varas
Thanks for all that you share guys.

I would like to ask for a recommendation.

I have a web interface made with web2py, this interface manage a web
application firewall (nginx and modsecurity). It does commands and file
modifications in the system to manage properly the WAF, the database is
SQLite.
I don't use sqlform.grid, most of the things in the view are made with pure
JavaScript and Html, and all the commands to the system are with subprocess.
Works pretty fast and without any issue.

My question is if py4web is ok to do this tasks too, like editing files in
system, executing commands and task more oriented to the system and not to
a db.


Now I have to a small adpatation to my app because modsecurity has a new
version and they changed some things, and I was thinking that maybe I can
port all to py4web and have a fresh new start, but I'm not sure..., I love
web2py and now is easy to me to do things with him.

Should I stay in web2py?
Or I should start using py4web for this kind of project?

Cheers!
Chris.


El mié., 22 de ene. de 2020 20:29, Carlos Costa 
escribió:

> Thanks for sharing you experience with py4web, Jim.
>
>
> Em qua., 22 de jan. de 2020 às 20:04, Kevin Keller 
> escreveu:
>
>> The datatables integration for web2py would be super useful. I'm sure we
>> could port it over to py4web easily.
>>
>> I just feel like with all the stuff web2py gave us to get something
>> quickly going missing, it'd just another api framework and there are
>> fastapi and apistar as well falcon out..
>>
>> I think having these ease of use stuff back would really hit home and
>> would also make it easier to port from web2py.
>>
>> And we would be pretty much the Jhipster  of the python world no?
>>
>>
>>
>> On Wed, 22 Jan 2020, 23:50 Jim S,  wrote:
>>
>>> Yes, I will post my main utils.py when I have it working better.  I
>>> still have to clean up a couple pieces.  It would be up to Massimo if he
>>> wanted to add it.  But in response to one of my earlier questions I was
>>> told Massimo kept a utility like this out of py4web so people might use
>>> better tools like datatables.  And, I doubt my code is 'framework-ready'.
>>> But it could give others insight into how you can work with py4web.
>>>
>>> Speaking of datatables, I wrote a datatables integration for web2py last
>>> summer.  I think I could also add that to my utils.py pretty easily.
>>> Actually, the datatables piece would be easier that what I've done writing
>>> my own.  Would you use datatables for complete CRUD, or just to list your
>>> table for record selection, etc.?
>>>
>>> Now that you mentioned mtable, I too recall hearing that before, but
>>> haven't gotten in to it at all.  Like I said, I haven't jumped in to the
>>> client-side javascript much yet, other than jquery.
>>>
>>> -Jim
>>>
>>> On Wednesday, January 22, 2020 at 4:31:11 PM UTC-6, Kevin Keller wrote:

 Jim,

 Could your helpers be considered to be added to thr py4web code base?

 If you say you have a sqlform.grid equivalent or something in that
 direction?

 I think there was mtable that should take the spot, but haven't seen
 any examples yet or at least none thst would replace a sqlform or
 smartgrid.

 If it is not coming I would probaly consider using datatables js in the
 future.




 On Wed, 22 Jan 2020, 21:47 Jim S,  wrote:

> For me, there is no porting, it is re-writing.  While a lot of the
> capabilities are there in py4web not all are part of py4web.  Due to the
> nature of how things work, a lot of the 'global' structures in web2py have
> to be handled differently in py4web.
>
> SQLFORM.grid is gone.  FORM replaces SQLFORM but doesn't have all the
> features -
> https://py4web.com/_documentation/static/index.html#chapter-10
> auth_group and auth_membership and auth_permission are gone -
> authentication/authorization have changed -
> https://py4web.com/_documentation/static/index.html#chapter-11
>
> With those things being what they are, I've been playing with py4web
> for a few days now and really am liking it.  It is crazy fast.  You may
> have to write some more helpers to do some things that web2py did for you,
> but that's half the fun, isn't it?  For instance, I used the grid that
> web2py's SQLFORM.grid provides for lots of listing pages.  py4web doesn't
> have one so I've written a helper that displays  pages the way my app 
> wants
> to see them.
>
> I believe py4web is going to make it easier to use Vue.js in your
> pages, but I haven't made the just to using Vue yet so I can't really
> comment on that part.
>
> -Jim
>
> On Wednesday, January 22, 2020 at 12:33:10 PM UTC-6, Carlos Costa
> wrote:
>>
>> Hey Massimo, thanks for the great info.
>>
>> How about porting apps from web2py to py4web?
>>
>> What steps would you recommend?
>>

[web2py] Massimo SpaceX contribution and web2py future

2020-01-23 Thread António Ramos
Hi all
First i would like to congratulate Massimo for his participation in SPACEX
since 2018.
My concern is about web2py and py4web support from Massimo. I know he is
not the only one, but he is certainly the best value for the future of
these 2 frameworks.
My question is to Massimo:
-Do SPACEX use web2py or py4web?
-Do you plan on continuing your contribution to these 2 frameworks or do
you see yourself retiring in a short/medium period of time because your
participation in other projects like SPACEX?

Regards
António

-- 
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/CAEM0BxNVm9Gq1wq3r7AsUfkqOZdwe1pMpr7j1B2XBmJmD0zywA%40mail.gmail.com.


[web2py] Re: How to run a specific application instead of welcome in Pycharm Pro

2020-01-23 Thread Dave S


On Wednesday, January 22, 2020 at 11:11:07 PM UTC-8, Davidiam wrote:
>
> I am using Pycharm Professional for web2py development.  When I create a 
> project with an application "XYZ" and I click run, web2py is started and 
> goes directly to the "welcome" app, and not the app "XYZ".  I can navigate 
> to the application "XYZ", but I would like it to go directly to this app 
> when I click the run button.
>
> I see that I can modify the command line for used for running eb2py, but I 
> can't find any parameter combination to force it t go directly to the 
> application "XYZ".
>
> Does anyone know this can be accomplished without having to modify the 
> code or routes.py ?
>
> Thanks in advance!
>

Routes.py is the best way ... even if all you do is set the default 
application to be "XYZ".

That will work across enviornments and not be limited to pycharm.

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/17d1a81a-0f16-4736-8c40-bc102c7440fc%40googlegroups.com.