[web2py] optimizing db queries

2018-06-12 Thread Vladimir Makarov
Hi there! I have a few tables: db.trucks(id, num ...) db.operations (id, truck_id ...) db.controls (id, operation_id ...) There is one to many relation: unique db.trucks.num corresponds to many operations and the only db.operations.id corresponds to many controls. I can do search

[web2py] How to add python code to js

2015-09-10 Thread Vladimir Makarov
Hi everyone! Is it a way to add python code to js in view? I have autogenerated amount of checkboxes in the view. I need to check the status of each of them via jquery and then pass values for only checked checkboxes to another controller def. So, this is my little piece of code in view^

[web2py] Re: How to add python code to js

2015-09-10 Thread Vladimir Makarov
UTC+3, Vladimir Makarov wrote: > > Trying to use >window.location.href='{{=URL('promo3')}}' + '?' + $.param({ids: ids}); > > but the code is generated invalid link with additional symbols: >http://__/_/promo3?ids*%5B%5D*=3 > > Some manipulations and th

[web2py] Re: How to add python code to js

2015-09-10 Thread Vladimir Makarov
Trying to use window.location.href='{{=URL('promo3')}}' + '?' + $.param({ids: ids}); but the code is generated invalid link with additional symbols: http://__/_/promo3?ids*%5B%5D*=3 Some manipulations and the code is work perfectly:

[web2py] Re: How to add python code to js

2015-09-10 Thread Vladimir Makarov
ion.href="{{=URL('promo3')}}" + text; }); }); In controller: mmm = [] for i in request.vars.ids: mmm.append(i) rows = db(db.hes.id.belongs(mmm)).select() On Thursday, September 10, 2015 at 2:35:26 PM UTC+3, Vladimir Makarov wrote: > > *Another words, is t

[web2py] Re: what's wrong with printing URL?

2015-01-28 Thread Vladimir Makarov
*Og... well done, well done.* *My problem is settled by css rule:* *@media print { a:after { content: important!; } }* *Thank you very much!* On Tuesday, January 27, 2015 at 11:36:36 PM UTC+3, Leonel Câmara wrote: Bootstrap also has that.rule you need to override it with: @media print {

[web2py] Re: what's wrong with printing URL?

2015-01-27 Thread Vladimir Makarov
On Tuesday, January 27, 2015 at 2:54:05 PM UTC-5, Vladimir Makarov wrote: Hey! So I have this piece of code in my view file: *a href={{=URL('kkm', 'kkm', vars={'kkm':row.id http://row.id, 'client':curClient.id, 'contract':curContract.id})}}{{=row.model}}/a* There is nothing special or magical

[web2py] what's wrong with printing URL?

2015-01-27 Thread Vladimir Makarov
Hey! So I have this piece of code in my view file: *a href={{=URL('kkm', 'kkm', vars={'kkm':row.id, 'client':curClient.id, 'contract':curContract.id})}}{{=row.model}}/a* There is nothing special or magical but if I try to print the page ... ooopppss ...I see this result: *Some_model

[web2py] Re: happy holidays everybody

2014-12-24 Thread Vladimir Makarov
I wish you merry Christmas and happy New Year Massimo and everybody of this community. Web2py changed my mind and now all my projects are lovengly built with web2py! Thank you... On Wednesday, December 24, 2014 4:48:18 PM UTC+3, Massimo Di Pierro wrote: I wish a happy holidays to everybody

[web2py] Re: SQL query to find all records which are not in another table

2014-11-11 Thread Vladimir Makarov
Hi, Leonel. Thank you for taking me to the right way. It works well: rows = db(~db.persons.id.belongs(db()._select(db.tbl.person))).select() And I don't use dots in table names. On Monday, November 10, 2014 10:56:17 PM UTC+3, Leonel Câmara wrote: You can use belongs. You ask for those

[web2py] SQL query to find all records which are not in another table

2014-11-10 Thread Vladimir Makarov
I'm just a little bit confusing because I can't make correct selection to find records that are absent in another (referenced) table. It's clear to me how to make inner join: rows = db(db.persons).select(join=db.tbl.on(db.persons.id==db.tbl.person), groupby=db.persons.f_name,

[web2py] reference select grid links

2014-10-02 Thread Vladimir Makarov
Using the query: *search_text = request.vars.keyword* *_query = ((db.tbl.person == db.persons.id) (db.persons.l_name.like('%'+str(search_text)+'%')))* I can select through the db.tbl that have search_text into db.persons.l_name. It works fine! And why not to use grid? So on: *grid =

[web2py] search with like/contains case sensitive

2014-09-25 Thread Vladimir Makarov
Give me a clue of how to set my search case insensitive for all kind types?!? def search(): lname = request.vars.name #form field q = db.tbl.l_name.like('%'+str(lname)+'%', case_sensitive=False) grid = _grid(q) return locals() This grid returns me all records regardless of case:

[web2py] Re: search with like/contains case sensitive

2014-09-25 Thread Vladimir Makarov
*For cyrillic types I mean for example words in russian language.* On Thursday, September 25, 2014 9:44:31 PM UTC+3, Niphlod wrote: what do cyrillyc types mean ? On Thursday, September 25, 2014 8:27:55 PM UTC+2, Vladimir Makarov wrote: Give me a clue of how to set my search case

[web2py] STYLE for GRID table

2014-08-28 Thread Vladimir Makarov
How to add class attr. for table inside web2py grid div? Is there a way to manage styles for table or I need only duplicate styles in css file (.web2py_gridtable {some styles})? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: STYLE for GRID table

2014-08-28 Thread Vladimir Makarov
:32:40 PM UTC-4, Vladimir Makarov wrote: How to add class attr. for table inside web2py grid div? Is there a way to manage styles for table or I need only duplicate styles in css file (.web2py_gridtable {some styles})? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation

[web2py] Re: Can't run web2py from App Engine Launcher

2014-04-06 Thread Vladimir Makarov
Just copy gaehandler.py from web2py\handlers to the web2py root folder. It works for me. And I use web2py souse instead of web2py win. On Saturday, April 5, 2014 4:54:03 AM UTC+4, gubbanoa wrote: I'm trying to run web2py 2.9.5 from Google App Engine Launcher 1.9.2 on Windows. After modifying

[web2py] Re: multiple controllers under linux environment

2012-09-17 Thread Vladimir Makarov
permissions on files ... so web2py can see read them ... Dne pondělí, 17. září 2012 6:01:09 UTC+2 Vladimir Makarov napsal(a): I use different controller files: + clients.py for some code + contracts.py for another code + ... And I created subdirrectories in view with required html

[web2py] multiple controllers under linux environment

2012-09-16 Thread Vladimir Makarov
I use different controller files: + clients.py for some code + contracts.py for another code + ... And I created subdirrectories in view with required html files. If I work under Windows it's OK and works perfectly but if I use my Ubuntu or LinuxMint stations it seams that view files

[web2py] How to select only 10 last rows in a table?

2012-09-12 Thread Vladimir Makarov
So, I need to select data from the table but the only ten last rows (with highest id). I have already tried with select all records and then use while statement but I think there is another way. Any ideas? Thanks! --

[web2py] Re: How to select only 10 last rows in a table?

2012-09-12 Thread Vladimir Makarov
Thank you all for your hints!!! The easiest way, of course, is to use *orderby *and *limitby*. It works fine. But the MAX method is usefull too. I'll use it in my projects. On Wednesday, September 12, 2012 5:09:07 PM UTC+4, Vladimir Makarov wrote: So, I need to select data from the table

[web2py] *** integer values into string variable ***

2012-08-08 Thread Vladimir Makarov
Hi there! I am a bit puzzled by the following problem. In my db.py file I use *string *type for the field. Field('ras', 'string', label=T('Account'), requires=IS_NOT_EMPTY(error_message='you should enter number of your account')), But when I insert some value into this field, for example *

Re: [web2py] *** integer values into string variable ***

2012-08-08 Thread Vladimir Makarov
and recreate the db, or change the field name. On Wed, Aug 8, 2012 at 4:27 PM, Vladimir Makarov vlad@gmail.comjavascript: wrote: Hi there! I am a bit puzzled by the following problem. In my db.py file I use *string *type for the field. Field('ras', 'string', label=T('Account

[web2py] Re: Time to move from Google Groups to a web2py or python??

2012-04-23 Thread Vladimir Makarov
*+1 for a Stack Overflow Channel! * суббота, 21 апреля 2012 г., 20:24:32 UTC+4 пользователь JoeCodeswell написал: This new look that Google Groups has implemented is seriously debilitating for a borderline dyslexic like me. Also the AJAX panel sizing is not working on my Chrome/WinXP