[web2py] Re: how do i return several rows from json using ajax?

2013-11-02 Thread Mihir Lade
I have made changes to the $.ajax which now gives me a different error but i think it's moving forward.. i have changed this line.. url:"{{=URL('suzannecollins', 'onlineStore', 'purchaseHistoryJson')}}", the error i encounte

Re: [web2py] Re: Upload form

2013-11-02 Thread Martin Weissenboeck
Thank you fpr these details. 2013/11/3 Anthony > The admin upload widget you see is actually handled via JS in layout.html: > https://github.com/web2py/web2py/blob/master/applications/admin/views/layout.html#L80 > > There is some associated CSS in bootstrap_essentials.css: > https://github.com/

[web2py] how do i return several rows from json using ajax?

2013-11-02 Thread Mihir Lade
hi, i have a function in a controller which queries the database if the user is logged in and then grabs the information using json (as below) def pruchaseHistoryJson(): if auth.user: rows = db(db.sale.auth_id == auth.user.id ).select(db.sale.title,

[web2py] add new button in GRID with same look and feel

2013-11-02 Thread Sarbjit
I have added a new button in grid using links as below :- links = [dict(header='', body=lambda row: A('CustomButton',_class="w2p_trap button btn", _href=URL('customhandler',args=[row.id])))] Is it possible that I can have the placement of this button under the same header where the defaul

[web2py] Downloading files from the disk using the path specfied in the db

2013-11-02 Thread Sarbjit
I have a model which is having a field having the path of the file (could be of big size) and is present outside the web2py folder. In the web2py book, examples given for downloading files are specific to files uploaded or in the static folder. Can some one please provide me an example of how t

[web2py] Re: view says that a variable defined in controller does not exist

2013-11-02 Thread Rupesh Pradhan
Please give a suggestion too. -- 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] Re: Prevent user from modifying a form field that already has a default value

2013-11-02 Thread Rupesh Pradhan
Model db.define_table('student', Field('admission_number', 'integer', notnull=True, unique=True), Field('name', 'string', length=255, notnull=True)) Controller student = db.student(row.id) form = SQLFORM(db.student, student, readonly=True) All the three fields of the table show up when I

[web2py] Re: view says that a variable defined in controller does not exist

2013-11-02 Thread Massimo Di Pierro
Your controller defines student_details inside the else:. If the form is not accepted or the if is true, the else clause is never executed and student_details never defined. On Saturday, 2 November 2013 21:32:00 UTC-5, Rupesh Pradhan wrote: > > The table definition: > > db.define_table('student

[web2py] view says that a variable defined in controller does not exist

2013-11-02 Thread Rupesh Pradhan
The table definition: db.define_table('student', Field('admission_number', 'integer', notnull=True, unique=True), Field('name', 'string', length=255, notnull=True)) db.define_table('school_session', Field('school_session', 'reference session_master'), Field('admission_number', 'in

[web2py] Re: Prevent user from modifying a form field that already has a default value

2013-11-02 Thread Massimo Di Pierro
Do not use crud.create(table) instead use: form = SQLFORM(table).process() You make it readonly with form = SQLFORM(table,readonly=True) Massimo On Saturday, 2 November 2013 20:45:12 UTC-5, Rupesh Pradhan wrote: > > Also, is there a way of making the entire form read only without having to

[web2py] Re: Prevent user from modifying a form field that already has a default value

2013-11-02 Thread Rupesh Pradhan
Also, is there a way of making the entire form read only without having to make 'writable = False' for each field in that form? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/lis

[web2py] Re: Page not saving info SQLFORM.grid

2013-11-02 Thread Niphlod
you can't treat the same page as a single fragment while retaining the possibility to flip in and out grid details (while maintaining all the markup that is not related to the grid). those links will carry you around as told, and you'll loose the previous inserted values and so on. Use com

[web2py] Re: Page not saving info SQLFORM.grid

2013-11-02 Thread LaDarrius Stewart
No one have any idea? On Friday, November 1, 2013 4:03:49 PM UTC-5, LaDarrius Stewart wrote: > > def index(): > form=FORM(TABLE(TR("Last > Name:",INPUT(_type="text",_name="lname",requires=IS_LENGTH(minsize=3))), > TR("",INPUT(_type="submit",_value="SUBMIT" > messag

Re: [web2py] Re: Upload form

2013-11-02 Thread Anthony
The admin upload widget you see is actually handled via JS in layout.html: https://github.com/web2py/web2py/blob/master/applications/admin/views/layout.html#L80 There is some associated CSS in bootstrap_essentials.css: https://github.com/web2py/web2py/blob/master/applications/admin/static/css/bo

[web2py] Re: wsgi on directory

2013-11-02 Thread jonten
Hi, I think the trick is not to use Apache mod_rewrite but instead to change the directive WSGIScriptAlias to WSGIScriptAliasMatch. See earlier post here: https://groups.google.com/forum/#!topic/web2py/ZKXaTlqyuWw //Jon On Friday, November 1, 2013 10:02:06 PM UTC+1, Simon Berry wrote: > > Plea

[web2py] Re: Upload form

2013-11-02 Thread Niphlod
the images that **shuould** be attached to this post in the group aren't included can you show an example of what you're trying to achieve ? On Saturday, November 2, 2013 4:25:00 PM UTC+1, mweissen wrote: > > A question about the upload form (Version 2.7.4): > > A form like > > form = SQLFOR

[web2py] Re: Prevent user from modifying a form field that already has a default value

2013-11-02 Thread Massimo Di Pierro
db.school_session.admission_number.writable = False On Saturday, 2 November 2013 12:28:34 UTC-5, Rupesh Pradhan wrote: > > This is the table definition: > > db.define_table('school_session', > Field('school_session', 'reference session_master'), > Field('admission_number', 'integer', notnu

Re: [web2py] aplicação com calculo de campos

2013-11-02 Thread Ovidio Marinho
Hermano boa tarde faz isso no python: >>>a =0 >>>b =1 >>>c=2 >>>a=b+c e ve o resultado. Ovidio Marinho Falcao Neto ITJP.NET.BR ovidio...@gmail.com Brasil 2013/11/2 Hermano Ponce > Alguém pode disponibilizar uma app que tenh

[web2py] Prevent user from modifying a form field that already has a default value

2013-11-02 Thread Rupesh Pradhan
This is the table definition: db.define_table('school_session', Field('school_session', 'reference session_master'), Field('admission_number', 'integer', notnull=True), Field('class_name', 'reference class_master'), Field('roll_number', 'integer', notnull=True)) This is the contr

[web2py] Auto-complete Error

2013-11-02 Thread raferbop
#Model db.define_table( 'order_cab', Field('pick_up', db.location, widget = SQLFORM.widgets.autocomplete(request,db.location.street_address,limitby=(0,10), min_length=2)), Field('drop_off', db.location, widget = SQLFORM.widgets.autocomplete(request,db.location.street

[web2py] Upload form

2013-11-02 Thread Martin Weissenboeck
A question about the upload form (Version 2.7.4): A form like form = SQLFORM.factory(Field('file', 'upload', uploadfield=False)) shows something like But in the admin application the widget for an upload filename looks like Nice - but how to get it? Regards, Martin -- Resources: - http

[web2py] aplicação com calculo de campos

2013-11-02 Thread Hermano Ponce
Alguém pode disponibilizar uma app que tenha cálculos entre campos. por exemplo: campo A * campo B = campo C oucampo A + campo B = campo C. App tipo estoque de produtos. Quero somente um exemplo da aplicação. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:/

[web2py] Re: Converting python list into javascript array in views (web2py) ?

2013-11-02 Thread Massimo Di Pierro
What do you mean it is not? It should. Can you provide a more complete example? On Friday, 1 November 2013 14:18:35 UTC-5, Gaurav singh wrote: > > I am using {{=XML(response.json(array))}} for converting python array to > javascript array in views but it aint working , it just converts a python

Re: [web2py] Re: Alteração descrição de botões da SQLFORM.grid (Add, Delete)...

2013-11-02 Thread Ovidio Marinho
Voce precisa criar um arquivo 0.py e usa alguns tratamentos por exemplo: Para o Botao Submit: def conserta_submit(rows): #Pega a lista de elementos HTML input com a propriedade type = submit submit = rows.elements('input',_type='submit') #For que varre a lista de botoes submit e muda

[web2py] redirect depending on controller name

2013-11-02 Thread Alex
since I found out that naming my controllers 'list' (to display all existing rows of a specific table) is not a good idea (because it overwrites the internal list type), I'd now like to rename all 'list' controllers to 'view'. To make the transitions for the users as smooth as possible all urls

[web2py] Converting python list into javascript array in views (web2py) ?

2013-11-02 Thread Gaurav singh
I am using {{=XML(response.json(array))}} for converting python array to javascript array in views but it aint working , it just converts a python variable or string to a javascript variable but it aint doing the same with an array or list ? Please help me , Is there any other alternative way of

[web2py] Aplicação Estoque

2013-11-02 Thread Hermano Ponce
I do not know if I'm asking the right question, but I wonder if anyone has a model of an application type product inventory, where there are calculations in the fields of the table being shown in the view. who can send me. Thank you. Não sei se estou fazendo a pergunta correta, mas gostaria de

[web2py] Re: Alteração descrição de botões da SQLFORM.grid (Add, Delete)...

2013-11-02 Thread Hermano Ponce
Vá no arquivo pt-br.py, no módulo de linguagens, e procure pelas palavras que queira modificar. Em quinta-feira, 31 de outubro de 2013 14h29min13s UTC-3, Carlynhos77 escreveu: > > Ola, boa tarde > > Estou usando a SQLFORM.grid para criar alguns formularios q nao necessitam > de muito implemento

[web2py] Web2Py, Apache, WSGI and a mount point other than /

2013-11-02 Thread Simon Berry
Does the latest version of Web2Py using Apache and WSGI support a mount point of anything other than /? The following works on my system i.e. when I go to www.[mydomain].com the hello world app comes up. (This is a line from my /etc/apache2/sites-available/www.[mydomain].com file.) WSGIScript

[web2py] Page not saving info SQLFORM.grid

2013-11-02 Thread LaDarrius Stewart
def index(): form=FORM(TABLE(TR("Last Name:",INPUT(_type="text",_name="lname",requires=IS_LENGTH(minsize=3))), TR("",INPUT(_type="submit",_value="SUBMIT" message = " " grid = None fields = [db.Member.FIRST_NAME, db.Member.LAST_NAME] default_sort_ord

[web2py] Re: wsgi on directory

2013-11-02 Thread Simon Berry
Please could someone who has actually set up an Apache server with WSGI and successfully mounted www.[domain].com/web2py kindly weigh in on this topic? As a newbie to this group, there seem to be a lot of people requesting this - however none of the solutions posted has worked for me yet... On

[web2py] Re: can grid export represented values rather than raw db values?

2013-11-02 Thread weheh
All good suggestions. Thanks! On Saturday, November 2, 2013 2:11:29 AM UTC+8, Anthony wrote: > > On Friday, November 1, 2013 12:05:56 PM UTC-4, weheh wrote: > >> Anthony, TSV works pretty well. Now I have to figure out how to get rid >> of the html formatting I've put in, but I think TSV basicall