[web2py] row.update_record(effectiveSize-=1)

2013-03-23 Thread Annet
In defined a table with a field effectiveSize, after a user deleted a record from the child table effectiveSize should be decreased by 1, does this work? def onsuccess_related_names(form): row=db(db.groups.id==session.groupID).select(db.groups.effectiveSize).first() if row: row.u

[web2py] Re: How can I run multiple applications with multiple domains on nginx?

2013-03-23 Thread peter
Sorry about replying late Tito. I struggled with your problem for quite a while, and here is a solution. In the web2py folder have a routes.py like this #!/usr/bin/python # -*- coding: utf-8 -*- routes_app=[ ('.*://www.site1.com:\w* /$anything','app1'), ('.*://s

[web2py] Javascript (unescaped string) error with Italian translation in web2py_ajax.html

2013-03-23 Thread Mauro Allegrini
Hello, in views/web2py_ajax.html you have: var ajax_error_500 = '{{=XML(T('An error occured, please %s the page') % A(T('reload'), _href=URL(args=request.args, vars=request.vars))) }}' Since Italian translation (and possibly others) include an apostrophe in it, Javascript string comes up bad fo

[web2py] Re: Problem with legacy db and primarykey

2013-03-23 Thread DenesL
It works for me using appadmin web2py 2.4.5 source on windows XP, python 2.7.3, MSSQL server 2008R2. Please post full error traceback. On Friday, March 22, 2013 2:19:09 PM UTC-4, Raul Monares wrote: > > I have a MSSQL database with a 4 column primary key: > > dbcomercial.define_table('libros',

[web2py] Re: row.update_record(effectiveSize-=1)

2013-03-23 Thread Niphlod
row.update_record(effectiveSize=row.effectiveSize-1) has better chances On Saturday, March 23, 2013 9:25:02 AM UTC+1, Annet wrote: > > In defined a table with a field effectiveSize, after a user deleted a > record from the child table > effectiveSize should be decreased by 1, does this work? > >

Re: [web2py] Re: Help on a web2py query

2013-03-23 Thread Niphlod
so, you want the last 3 capitulo rows, for each novela, and for each row you want to retrieve also all the data from the novela "attached" to each capitulo.all in a single select ? On Friday, March 22, 2013 11:41:06 PM UTC+1, Tito Garrido wrote: > > db.define_table('novela', > Field('nom

[web2py] Re: row.update_record(effectiveSize-=1)

2013-03-23 Thread DenesL
Or you could count them on the fly: effectiveSize = db(db.groups.id==session.groupID).count() On Saturday, March 23, 2013 8:26:07 AM UTC-4, Niphlod wrote: > > row.update_record(effectiveSize=row.effectiveSize-1) > has better chances > > On Saturday, March 23, 2013 9:25:02 AM UTC+1, Annet wrote

[web2py] Re: record representation format that refer to another table and that table is refer to another table

2013-03-23 Thread Anthony
Oh, yeah, even better, you can make the "format" attribute a function (it takes a record of its own table) -- so: db.define_table('room', Field('room_no'), Field('category', 'list:string'), Field('status', 'list:string'), Field('branch', 'reference branch'), format=lambda r: '

[web2py] Re: row.update_record(effectiveSize-=1)

2013-03-23 Thread Annet
Thanks you both for your replies, I don't know which solution to choose :-( At the moment groups don't have 100+ members but that might change in the near future I suppose in that case effectiveSize=row.effectiveSize-1 is faster than effectiveSize = db(db.groups.id==session. groupID).count() isn't

[web2py] Re: simple loop question

2013-03-23 Thread Alex Glaros
Anthony, Can you recommend any online tutorials or videos to help someone that doesn't know object oriented programming? Hopefully something that can be related to web2py so that I would learn that response.write() is a method, not an attribute. I just started writing an app without knowing oo

[web2py] Quality of Code

2013-03-23 Thread Alfonso de la Guarda
Hi, Trying to make some final adjustments to one of my projects, i have notice than when i try to pass the code from models or controllers through pylint, the score goes down < 0... I am not a purist, but always try to code with good ratios, how we can solve this? By the way, the pep problems s

Re: [web2py] Quality of Code

2013-03-23 Thread Jonathan Lundell
On 23 Mar 2013, at 8:26 AM, Alfonso de la Guarda wrote: > > Trying to make some final adjustments to one of my projects, i have > notice than when i try to pass the code from models or controllers > through pylint, the score goes down < 0... > > I am not a purist, but always try to code with go

[web2py] Re: Quality of Code

2013-03-23 Thread LightDot
I believe this thread is related and has some suggestions: https://groups.google.com/d/topic/web2py/-wanxR44Aro/discussion Regards, Ales On Saturday, March 23, 2013 4:26:59 PM UTC+1, Alfonso de la Guarda Reyes wrote: > > Hi, > > Trying to make some final adjustments to one of my projects, i h

Re: [web2py] Re: Quality of Code

2013-03-23 Thread Alfonso de la Guarda
Hi, Basicly, the same procedure than any editor Thanks! Saludos, Alfonso de la Guarda Twitter: @alfonsodg Redes sociales: alfonsodg Telef. 991935157 1024D/B23B24A4 5469 ED92 75A3 BBDB FD6B 58A5 54A1 851D B23B 24A4 On Sat, Mar 23, 2013 at 10:51 AM, Lig

Re: [web2py] Re: Quality of Code

2013-03-23 Thread Alfonso de la Guarda
Hello, Nope! That is not the solution, however the Jonathan option reduces the lines of error but still a problem: Field, T or whatever doesn't exits and the score goes down... Another experience? Thanks! Alfonso de la Guarda Twitter: @alfonsodg Redes sociales:

Re: [web2py] Re: Quality of Code

2013-03-23 Thread Alfonso de la Guarda
Hi, This approach solves the problem, at least gives me 8 points or more if False: import Field, T, settings, Session, Request, Response, IS_IN_DB, DAL import SQLFORM session = Session() request = Request() response = Response() Thanks! Saludos, --

Re: [web2py] Re: Help on a web2py query

2013-03-23 Thread Tito Garrido
Yes, you got it... On Sat, Mar 23, 2013 at 9:33 AM, Niphlod wrote: > so, you want the last 3 capitulo rows, for each novela, and for each row > you want to retrieve also all the data from the novela "attached" to each > capitulo.all in a single select ? > > > On Friday, March 22, 2013 11:41

Re: [web2py] Re: REF: Upload of Files

2013-03-23 Thread wwwgong
Thanks for sharing the solution, I did not know that quotes_file holds the file content On Friday, March 22, 2013 2:34:16 AM UTC-4, software.ted wrote: > > Ok great and thanks for all your help, the file is being saved and all > works as expected!!! code that works below: > > def index(): >

[web2py] Re: simple loop question

2013-03-23 Thread greaneym
Hi Alex, www.programr.com has python object-oriented examples www.coursera.org has a python course in April. The mvc approach can be learned by trying the examples in web2py's on-line manual, using the welcome app that comes with the install. Trying examples yourself is a great way to lear

[web2py] Re: No CMS for Web2Py?

2013-03-23 Thread Loïc
Hi Marcel For my personal use I developed a basic CMS. The goal was to have something very simple to use. Some features need to be improved, but I released the project recently. You can have a look at https://github.com/espern/tiny_website Regards Le mercredi 13 mars 2013 00:06:09 UTC+1, mjm a

[web2py] Re: row.update_record(effectiveSize-=1)

2013-03-23 Thread Niphlod
it's kinda unclear what you want from the posted snippet, however your original snippet would fail because of an invalid syntax (you can't do row.update_record(something-=1), no matter what) from my pov, you asked for something able to decrease a column value of a preselected row by 1, and that

[web2py] insert many rows using a single form

2013-03-23 Thread Rohit
Hi, I want to insert multiple rows using a single form like the image shown below. This is my code: {{=form.custom.label.award_name}}: {{=form.custom.widget.award_name}} {{=form.custom.label.employee_name}}: {{=form.custom.widget.employe

Re: [web2py] Re: No CMS for Web2Py?

2013-03-23 Thread Ovidio Marinho
Loic Very god CMS! Congratulations! Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com 83 8826 9088 - Oi 83 9336 3782 - Claro Brasil 2013/3/23 Loïc > Hi Marcel > > For my personal use

[web2py] Re: No CMS for Web2Py?

2013-03-23 Thread Relsi Hur Maron
\o/ Cool!!! Forked!! Em sábado, 23 de março de 2013 16h34min39s UTC-3, Loïc escreveu: > > Hi Marcel > > For my personal use I developed a basic CMS. The goal was to have > something very simple to use. > Some features need to be improved, but I released the project recently. > You can have a

[web2py] Re: record representation format that refer to another table and that table is refer to another table

2013-03-23 Thread 黄祥
it works, many thanks, anthony > > -- --- 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. For more options, visit https://gro

[web2py] Re: How to get selective update rows from SQLFROM.grid

2013-03-23 Thread 黄祥
why not use default auth user table and use editable and deletable on your grid? e.g. *db.py* auth.settings.extra_fields['auth_user']=[ Field('gender', 'list:string', notnull=True), Field('address', 'text', notnull=True), Field('zip', length=10, notnull=True), Field('city', length

[web2py] Re: No CMS for Web2Py?

2013-03-23 Thread Niphlod
candidate for submission on the poweredby ? or appliances ? On Saturday, March 23, 2013 8:34:39 PM UTC+1, Loïc wrote: > > Hi Marcel > > For my personal use I developed a basic CMS. The goal was to have > something very simple to use. > Some features need to be improved, but I released the project

Re: [web2py] Digest for web2py@googlegroups.com - 10 Messages in 8 Topics

2013-03-23 Thread samuel bonilla
woww very very good cms nice https://github.com/espern/tiny_website ! Fork in github !!! 2013/3/23 > Today's Topic Summary > > Group: http://groups.google.com/group/web2py/topics > >- insert many rows using a single form<#13d991390944b9fe_group_thread_0>[1 > Update] >- row.update

[web2py] Re: No CMS for Web2Py?

2013-03-23 Thread samuel bonilla
woww very very good cms nice https://github.com/espern/tiny_website ! Fork in github !!! El martes, 12 de marzo de 2013 16:31:23 UTC-5, mjm escribió: > > I really like Web2Py to get things done without much fuss. But I am > somewhat surprised there seems to be no CMS for W2P. > > Projects m

[web2py] Error when listing newly created database tables from appadmin

2013-03-23 Thread Spring
Hi there, I've created 7 tables from my app and 2 of them cause error when to be listed from Appadmin (/appadmin/select/db?query=db.t_leads.id>0). Don't see anything particular in the table definition that may cause the problem. Any help would be apprecicated. Traceback Traceback (most rec

[web2py] Re: How to get selective update rows from SQLFROM.grid

2013-03-23 Thread Sarbjit singh
Thanks Alan. Since, I am a beginner, I will study the mentioned chapters and would try. In case of any problem, I will revert back. @ 黄祥, I gave it a quick try, In this case when has_membership is True, all of the rows in the grid are editable. My requirement is to get few rows of the grid edi

[web2py] Re: How to get selective update rows from SQLFROM.grid

2013-03-23 Thread Sarbjit singh
@黄祥, Below is my complete db.py, I am getting error in registration of user stating gender can't be null. # -*- coding: utf-8 -*- from gluon.tools import Auth db = DAL("sqlite://storage.sqlite") auth = Auth(db) auth.settings.create_user_groups=True auth.define_tables(username=False, signature=T