[web2py] Is it safe to use plain XMLHttpRequest instead of ajax() function?

2016-09-15 Thread Przemysław Loesch
I'm wondering if using plain javascript XMLHttpRequest object instead of web2py ajax() can cause any problem or might be unsafe. The reason I've decided to do so is that I need to pass the server response (json object) to a js function as an argument. My js code looks like this: var query = docu

[web2py] Re: Is it safe to use plain XMLHttpRequest instead of ajax() function?

2016-09-16 Thread Przemysław Loesch
Massimo thank you very much for your answer. I have one more question a bit out of the topic. Is it a way to increase web2py efficiency when it is used only for database transactions and user authorization? I don't use web2py html helpers, forms, views processing etc. Complete GUI of my app is c

[web2py] Re: Is it safe to use plain XMLHttpRequest instead of ajax() function?

2016-09-17 Thread Przemysław Loesch
Anthony thank you very much for your hints. I've started to learn the web2py workflow from the Book and directly from the web2py source but your advises are priceless and save a lot of my time. Przemek -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.co

[web2py] Any way for placing many views in one html file?

2015-01-01 Thread Przemysław Loesch
Hallo to everybody. I'm a newbie web2py user but I'm in love with it already. One thing which I'm not comfortable with is the amount of html views files. Is there a way to place many views in one file just like one controler file handles many functions? I'm still using the default web based IDE

[web2py] How to display columns of data without abbreviation in the database aministrative interface?

2015-01-03 Thread Przemysław Loesch
Hallo! Is there a way to see the content of each column with data from a table without abbreviation? Currently I use administrative interface to put same initial data for my project (like entity types) which definitely won't change in the future so there is no need of creating better interface f

[web2py] Re: Any way for placing many views in one html file?

2015-01-05 Thread Przemysław Loesch
Solved. Just to give a tip to another newbie: 1. In "mycontroler.py" place the code "response.view = 'myview.html' " to force executing "myview.html" regardless of a function name. 2. In "myview.html" use {{if request.function==anyviewname:}} to execute just a block of code designed for a certain

[web2py] Re: How to display columns of data without abbreviation in the database aministrative interface?

2015-01-05 Thread Przemysław Loesch
Thank you very much Dave! The "truncate" parameter works perfect. Additionally I've just learned how to place many views in one html file what was the subject of my second question on this group. Thanks a lot! PS. Przemek from Gonzaga University is not me - I live in Poland. -- Resources: - htt

[web2py] How to do one-to-many selection for all records in the most efficient way?

2015-01-06 Thread Przemysław Loesch
Hallo! Lets say we have a table called 'cities' and another one called 'institutions' with a field referencing to cities: db.define_table('cities', Field('name')) db.define_table('institutions', Field('name'), Field('city', 'reference cities') Field('type', 'reference types')) d

[web2py] Re: How to do one-to-many selection for all records in the most efficient way?

2015-01-07 Thread Przemysław Loesch
I've made some experiments with "groupby" but every time it has reduced the selection to one 'city' and one 'institution'. The other 'institutions' belonging to the 'city' are omitted. The same situation is when using pure SQL query via database browser so it is a matter of the functionality of

[web2py] What is the best way to add an extra input on the client side?

2015-01-11 Thread Przemysław Loesch
Hi! I need to add extra fields to my custom form generated from some fields of different tables. These extra fields are are additional phone numbers for the institution. The code looks like this (here simplified for better readability): In model: db.define_table ('institutions', Field('name

[web2py] Re: What is the best way to add an extra input on the client side?

2015-01-11 Thread Przemysław Loesch
Massimo, thank you very much for your answer. List type widget works just great. I didn't know web2py already has the feature which I tried to implement in the complicated way. I'm wondering how many such goodies are waiting for me to discover in this great framework. Now going back to forms. T

[web2py] Re: What is the best way to add an extra input on the client side?

2015-01-12 Thread Przemysław Loesch
ed runtime. I'll be grateful for any help or advise. Przemek W dniu niedziela, 11 stycznia 2015 22:46:48 UTC+1 użytkownik Przemysław Loesch napisał: > > Massimo, thank you very much for your answer. List type widget works just > great. I didn't know web2py already has the featu

[web2py] Re: What is the best way to add an extra input on the client side?

2015-01-16 Thread Przemysław Loesch
Thank you very much Derek. I've adapted your solution and it works very well. Thanks a lot! Przemek >> -- 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) ---