[web2py] Re: db query

2015-03-09 Thread Garry Smith
Hi Thanks for the reply, I have got query 2 working with the following:- qry = request.vars.upn_no q = (db.pupils.upn_no == qry) s = db(q) row = s.select(db.pupils.upn_no,db.pupils.surname) which gives me the following. pupils.upn_no pupils.surname Dalglish Once in the

[web2py] Re: DAL negate a query - error

2015-03-09 Thread Niphlod
for the same exact reason. NOT field = True in t-sql means just FALSE, not FALSE and NULL On Monday, March 9, 2015 at 2:37:46 PM UTC+1, Dmitry Ermolaev wrote: I use negate - why this not worked? воскресенье, 8 марта 2015 г., 23:15:49 UTC+3 пользователь Niphlod написал: booleans in

[web2py] Dilemma: how to store reports

2015-03-09 Thread Najtsirk
Dear Web2pyers, I have dilemma not connected directly to Web2py. I am running / developing a web application where different projects seek impact investments and donations. Each project is obliged to submit a report by the end of the year. For the first two years we accepted written reports

[web2py] Re: db query

2015-03-09 Thread Jim S
thelist=[row.first_name for row in db(db.user.upn == 444).select()] Have you read chapter 6 from the book? It is well worth your time and should help with most of your questions. http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer -Jim On Monday, March 9, 2015

[web2py] db query

2015-03-09 Thread Garry Smith
I'm new to web2py, but do have a php and mysql background using codeigniter. I'm trying to write a couple of queries but sure how to do them. These are the queries I'm trying to write, query1 SELECT user.s_name, user.f_name, user.year, pe.date, pe.sport, pe.id FROM user INNER JOIN pe ON

Re: [web2py] Re: storing more than 1 millions uploaded files

2015-03-09 Thread Yang
Dear All, I am facing the same problem for storing a large number of data files. My database backend is PostgreSQL. And I am using the default fs with separated folder selected. I would like to know if there is other choices of file system recommended for my case, besides buying Amazon S3

[web2py] Re: Dilemma: how to store reports

2015-03-09 Thread Willoughby
If you just need to store the reports, then just use XML blobs. If you need to do math on data within the reports (i.e. analytics across projects) then break it into a schema. On Monday, March 9, 2015 at 9:48:23 AM UTC-4, Najtsirk wrote: Dear Web2pyers, I have dilemma not connected directly

[web2py] Re: DAL negate a query - error

2015-03-09 Thread Dmitry Ermolaev
I use negate - why this not worked? воскресенье, 8 марта 2015 г., 23:15:49 UTC+3 пользователь Niphlod написал: booleans in T-SQL are not treated the same way as python. in T-SQL, NULL values are neither True or False, they are just NULL. So, if you want closed either None or False, you

Re: [web2py] Bunch/Batch/Bulk insert Re-use db.define_table field definition in SQLFORM.factory() ?

2015-03-09 Thread Richard Vézina
This should do what you want : https://groups.google.com/d/msg/web2py/oiyOIC0IH04/6-NvVOJECU8J I remember having post this solution somewhere else (other thread) and other web2py users had posting many other solution but can find it back... You have at least this solution that work very well and

[web2py] Re: db query

2015-03-09 Thread Garry Smith
Hi My view is basic at the moment just showing the column headings and results from db. {{extend 'layout.html'}} h1Results/h1 {{=row}} The headings show :- pupil.upn_no and pupils.surname with the results underneath. what I would like to do is put the results in my own table. coming

[web2py] Re: db query

2015-03-09 Thread Jim S
What does your view look like? Also, this chapter should be helpful: http://web2py.com/books/default/chapter/29/05/the-views -Jim On Monday, March 9, 2015 at 8:56:38 AM UTC-5, Garry Smith wrote: Hi Thanks for the reply, I have got query 2 working with the following:- qry =

Re: [web2py] {{=LOAD()}} problem with views

2015-03-09 Thread Richard Vézina
Hello Annet, I have hard time follow... It could be easier I think if you just pasting the view with the LOAD() that don't work and both controller the main page and the loaded page... Thanks Richard On Mon, Mar 9, 2015 at 5:45 AM, Annet anneve...@googlemail.com wrote: I have the following

Re: [web2py] Re: IMPORTANT - DROPPING SUPPORT FOR PYTHON 2.5?

2015-03-09 Thread Phyo Arkar
Me and my team is fine since we are always on the edge :) . But i would like to see input from old wizards that uses Old RedHat for servers and Debian 4.x . On Sun, Mar 8, 2015 at 10:04 AM, Ron Chatterjee achatterjee...@gmail.com wrote: I use 2.7.6 from canopy. I will b okay.I think... --

[web2py] Re: db query

2015-03-09 Thread Garry Smith
Hi again after reading chapter 6, I have found what I'm looking for. I did the following and got thre results I wanted. {{for r in row:}} p{{=r.surname}}p {{pass}} One other question I would like to ask. web2py works a lot like codeigniter for php using MVC, does web2py let you use jquery to

[web2py] Global search form example

2015-03-09 Thread Gael Princivalle
Hello all. I would like to add a global search form in a website, the classical one with one field and a search button. I've got some idea's about how doing it, but I would like to know if there's an example on line, or if someone have some suggestions. Thanks. -- Resources: -

[web2py] Re: db query

2015-03-09 Thread Dave S
On Monday, March 9, 2015 at 9:53:42 AM UTC-7, Ron Chatterjee wrote: you need to do {{response.files.append(URL('static','js/java_script_file_I_am_runnning.js))}} in web2py before ajax call layout.html and then use script your function /script Correct me if I am wrong. Someone?

[web2py] Re: list reference with ondelete=set null breaking when delete parent

2015-03-09 Thread Ron Chatterjee
Wonder if he can try to make it a list and do list.remove? Have you tried that? On Thursday, March 20, 2014 at 3:07:47 PM UTC-4, Leonel Câmara wrote: I think you should have a third table anyway or searches for T-shirts of a given colour will be quite slow. -- Resources: -

[web2py] Re: db query

2015-03-09 Thread Ron Chatterjee
you need to do {{response.files.append(URL('static','js/java_script_file_I_am_runnning.js))}} in web2py before ajax call layout.html and then use script your function /script Correct me if I am wrong. Someone? On Monday, March 9, 2015 at 12:12:47 PM UTC-4, Garry Smith wrote: Hi again

[web2py] Re: {{=LOAD()}} problem with views

2015-03-09 Thread JorgeH
Annet Bear in mind that within .load extension files you dont write this line {{extend layout.html}} REMOVE THIS LINE FROM YOUR .LOAD FILE try this. good luck. On Monday, March 9, 2015 at 4:45:39 AM UTC-5, Annet wrote: I have the following page/index.html view: {{extend

Re: [web2py] Re: list reference with ondelete=set null breaking when delete parent

2015-03-09 Thread Francisco Costa
Hi ANdré, did you find a way to solve this? On Thursday, 20 March 2014 22:10:33 UTC, André Kablu wrote: Yes just migrated to mongodb, and there really exist some issue. using CASCADE or SET NULL, it does not matter, web2py does not respect and remove the reference from the referencing

[web2py] Re: Global search form example

2015-03-09 Thread Gael Princivalle
Sure. The search field at the top: http://www.chainreactioncycles.com/us/en Il giorno lunedì 9 marzo 2015 17:47:09 UTC+1, Ron Chatterjee ha scritto: Can you give an example of global Search. Any reference site? On Monday, March 9, 2015 at 12:18:54 PM UTC-4, Gael Princivalle wrote: Hello

[web2py] Re: Global search form example

2015-03-09 Thread Ron Chatterjee
Can you give an example of global Search. Any reference site? On Monday, March 9, 2015 at 12:18:54 PM UTC-4, Gael Princivalle wrote: Hello all. I would like to add a global search form in a website, the classical one with one field and a search button. I've got some idea's about how doing

[web2py] Re: is it possible to conditionally format grid field based on other field in the row?

2015-03-09 Thread Ron Chatterjee
Have you tried, lastmodified ? On Monday, March 9, 2015 at 1:31:04 PM UTC-4, Alex Glaros wrote: ahhh... this worked...needed quotes db.InternalMessage.subjectLine.represent = lambda value,row: DIV(value, _style='font-size:75%;color:#656555') if 'modified_on' != None else DIV( value,

[web2py] Re: {{=LOAD()}} problem with views

2015-03-09 Thread Annet
Thank you both for your replies. I finally found the issue has nothing to do with the controller and views. I am using a CDN to get jquery, in layout.html I've got: script src=//code.jquery.com/jquery-1.11.1.min.js/script {{include 'web2py_ajax.html'}} and from web2py_ajax.html I removed

[web2py] Re: is it possible to conditionally format grid field based on other field in the row?

2015-03-09 Thread Alex Glaros
ahhh... this worked...needed quotes db.InternalMessage.subjectLine.represent = lambda value,row: DIV(value, _style='font-size:75%;color:#656555') if 'modified_on' != None else DIV( value, _style='font-size:135%;color:#991155') -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: is it possible to conditionally format grid field based on other field in the row?

2015-03-09 Thread Alex Glaros
wait... did NOT work can anyone type example of correct syntax or say that the concept doesn't exist? -- 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) ---

[web2py] Re: Global search form example

2015-03-09 Thread Ron Chatterjee
SQLFORM.build_query[(db.table.field)] Passing a list ([]) into that will give you a text in that field. and then you can use a form input to do the display like the book on page 84 on the book. Damn I am getting good at this! On Monday, March 9, 2015 at 1:44:23 PM UTC-4, Gael Princivalle

[web2py] Select categories that are in use

2015-03-09 Thread Gael Princivalle
Hello all. I've got some news categories: db.define_table('news_categories', Field('name', type='string', requires=IS_NOT_EMPTY(), label= 'Nome'), format = '%(name)s') And some news: db.define_table('news', Field('title', type='string',

[web2py] is it possible to conditionally format grid field based on other field in the row?

2015-03-09 Thread Alex Glaros
can content of one grid field control formatting of other field in same row? tried many variations including this but got: 'Row' object has no attribute 'modified_on' db.InternalMessage.subjectLine.represent = lambda value,row: DIV(value, _style='font-size:75%;color:#656555') if

[web2py] how do I add form attributes to SQLFORM.factory?

2015-03-09 Thread Oliver Holloway
How do I get the form to autofocus the cursor into the text box? Here's one of the approaches I've tried. attributes = {'_autofocus':'autofocus', '_type':'tel', '_autocomplete':'off', '_style':'height:80px; width:80px'} score_box = SQLFORM.factory(Field('score', 'integer'), **attributes)

[web2py] Re: DAL negate a query - error

2015-03-09 Thread Dmitry Ermolaev
but db((db.progs.promo==True)).select(): is work! понедельник, 9 марта 2015 г., 16:58:26 UTC+3 пользователь Niphlod написал: for the same exact reason. NOT field = True in t-sql means just FALSE, not FALSE and NULL On Monday, March 9, 2015 at 2:37:46 PM UTC+1, Dmitry Ermolaev wrote:

[web2py] .decode('utf-8') on a string containg €

2015-03-09 Thread Kenneth
Hello, is there a way to do a decode('utf-8') on a string containg for example the € sign? Kenneth -- 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) ---

[web2py] Re: DAL negate a query - error

2015-03-09 Thread Dmitry Ermolaev
not work: for pr in db((db.progs.promo.belongs((None, False))) (db.progs.closed.belongs((None, False.select(): work: for pr in db(db.progs).select(): if pr.promo or pr.closed: continue понедельник, 9 марта 2015 г., 16:58:26 UTC+3 пользователь Niphlod написал:

[web2py] SQLFORM.grid search with multiple terms

2015-03-09 Thread Ian Holser
The search function on SQLFORM grid works fine for single terms, but when typing multiple terms, it doesn't seem to work. For example: If I have a field value of 'example example1', it will find it with a search for 'example' or 'example1'. A search for 'example example1' comes up with the

[web2py] Different template in the same PDF file

2015-03-09 Thread Kenneth
Hi, I have built an PDF report using the Template of pyfpdf, but I have done it a stupid way. The problem is that I need different templates on every page. This is not directly a web2py questions, but maybe somebody might have an idea how to use different Templates on different pages when

[web2py] Re: DAL negate a query - error

2015-03-09 Thread Niphlod
with that query you get None or False for both promo and closed. What do you want ? On Monday, March 9, 2015 at 8:27:27 PM UTC+1, Dmitry Ermolaev wrote: not work: for pr in db((db.progs.promo.belongs((None, False))) (db.progs.closed.belongs((None, False.select(): work:

[web2py] Re: is it possible to conditionally format grid field based on other field in the row?

2015-03-09 Thread Alex Glaros
thanks Ron. This below really works db.InternalMessage.subjectLine.represent = lambda value,row: DIV(value, _style='font-size:115%;color:#33') if row.InternalMessage.modified_on == None else DIV(value, _style='font-size:85%;color:#99') -- Resources: - http://web2py.com -

[web2py] Re: db query

2015-03-09 Thread Garry Smith
Hi Thanks for the reply I have messing about a little with jquery today. With some success, then not with others. I put this code in a js file. function DoAction( id ) { $.ajax({ type: POST, url: http://127.0.0.1:8080/School_Clubs/default/test1;, data: id= + id,

Re: [web2py] Re: {{=LOAD()}} problem with views

2015-03-09 Thread Richard Vézina
Because web2py_ajax.html is loading jquery if I remember... Richard On Mon, Mar 9, 2015 at 2:15 PM, Annet anneve...@googlemail.com wrote: Thank you both for your replies. I finally found the issue has nothing to do with the controller and views. I am using a CDN to get jquery, in

[web2py] SQLFORM Validation and Password Hashes

2015-03-09 Thread horridohobbyist
I use SQLFORM to add records to a table. However, one of the fields is a password which requires=[IS_STRONG(upper=2),CRYPT(salt=False)]. I would like to use SQLFORM to update records in the table, but I run into a problem: the password field contains the hash of the password, which will not

[web2py] Re: .decode('utf-8') on a string containg €

2015-03-09 Thread Leonel Câmara
Yes, utf-8 is perfectly capable of representing €, that decode should convert an utf-8 string with the € character into unicode. If you're having any problems somewhere in your stack something isn't using utf-8. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Re: Bootstrap is really killing web2py

2015-03-09 Thread Johann Spies
Try createing a new app from the admin interface and replace it's bootstrap css-files (in static/css) and js-files (in static/js) with bootstrap3 files and see what you get. Regards Johann On 5 March 2015 at 07:16, Moiz Nagpurwala moiz...@gmail.com wrote: Hello, I'm using latest relaease of

[web2py] Re: gluon/Portlocker.py LockedFile BROKEN!

2015-03-09 Thread Niphlod
still don't see any reference in the docs.. On Monday, March 9, 2015 at 8:01:13 AM UTC+1, da...@mail.hebrew.edu wrote: the work around is to set truncate(0). On Sunday, March 8, 2015 at 5:14:14 PM UTC+2, da...@mail.hebrew.edu wrote: hi, after python 2.7.2, seek(0) on an opened file

[web2py] Re: gluon/Portlocker.py LockedFile BROKEN!

2015-03-09 Thread danny
the work around is to set truncate(0). On Sunday, March 8, 2015 at 5:14:14 PM UTC+2, da...@mail.hebrew.edu wrote: hi, after python 2.7.2, seek(0) on an opened file for append does not seek to the begining - read the manual. so LockedFile(...) used by languages, is screwing up the language

[web2py] {{=LOAD()}} problem with views

2015-03-09 Thread Annet
I have the following page/index.html view: {{extend 'scaffolding/outer_layout.html'}} div class=main {{include 'page/ad.html'}} {{if groupcomponent:}} section class=main-group div class=container div id=group-component {{include 'page/group.html'}} /div !--

[web2py] Re: gluon/Portlocker.py LockedFile BROKEN!

2015-03-09 Thread danny
i replied from my mailer, which goggle sent to the moderator :-) here we go again: sure, e.g: https://docs.python.org/2.4/lib/bltin-file-objects.html look for seek: *seek*( *offset*[*, whence*]) Set the file's current position, like stdio's fseek(). The *whence* argument is optional

[web2py] Re: gluon/Portlocker.py LockedFile BROKEN!

2015-03-09 Thread danny
the docs: sure, e.g: https://docs.python.org/2.4/lib/bltin-file-objects.html look for seek: *seek*( *offset*[*, whence*]) Set the file's current position, like stdio's fseek(). The *whence* argument is optional and defaults to 0 (absolute file positioning); other values are 1 (seek

Re: [web2py] Bunch/Batch/Bulk insert Re-use db.define_table field definition in SQLFORM.factory() ?

2015-03-09 Thread Ramkrishan Bhatt
Hi All, My question is about expanding form on dynamically for example. we have two tables. company and address now did SQLFORM.factory(db.company,db.address) Now requirement is says that where company can have multiple address so i need a button for add more address. On click we need to