[web2py] SQL grid "edit" page not as intended

2015-11-09 Thread Carla Raquel
I'm using an SQL grid to display values from two distinct tables. This is what I have: def manageUsers(): query = (db.Extension.Person == db.auth_user.id ) grid = SQLFORM.grid(query,csv = False,paginate=25,user_signature=True) return (grid = grid) The grid shows perfectly fine with both t

[web2py] SQlite to Postgres insert problems

2015-11-18 Thread Carla Raquel
I'm having some troubles importing from csv files while using a Postgres connection, when a table has one or more references to other tables like so: db.define_table('Extension', Field('Person',db.auth_user), Field('Supervisor',db.auth_user), Field(

[web2py] Re: SQlite to Postgres insert problems

2015-11-19 Thread Carla Raquel
Problem solved!Everything is working fine now! quarta-feira, 18 de Novembro de 2015 às 15:35:32 UTC, Carla Raquel escreveu: > > I'm having some troubles importing from csv files while using a Postgres > connection, when a table has one or more references to other

[web2py] Format option in extra_fields

2015-04-07 Thread Carla Raquel
Hi! I'm trying to do something like the code below, but it prompts me the following error : 'SyntaxError: invalid syntax' auth.settings.extra_fields['auth_user']= [Field('Supervisor', 'reference auth_user'), format = '%(db.auth_user.first_name)s %(db.a

[web2py] Querying in appadmin

2015-04-16 Thread Carla Raquel
I'm having some troubles making a sum query in appadmin.I want to sum all the values of field 'Custo' and then group by type of service, much like you would do in a dal query.I tried db.Chamada.Custo.sum() just to start, but that doesn't work.It gives me a 'misuse of aggregate: SUM()' error. Any

[web2py] Navbar icon

2015-05-18 Thread Carla Raquel
How can one add an icon before the 'Welcome' message in the navbar,just like the one next to the 'Profile' in the drop-down? I tried using something like in auth.navbar('Welcome',mode='dropdown'), unfortunately to no avail. Any help would be much appreciated! -- Resources: - http://web2py.com

[web2py] Customizable forms in "user" function

2015-06-18 Thread Carla Raquel
How can I, in the "user" function, customize the forms in a way that when I click the "Profile" like it shows all the fields pertaining to the profile and, when I click on "Password" I can see the "old Password", etc?Currently I have something like: {{=T( request.args(0).replace('_',' ').capita

[web2py] Ajax and table with queried values

2015-06-24 Thread Carla Raquel
I'm having a bit of trouble figuring out how to add info to a bootstrap table in a panel, through ajax.This's a phone call register system and I have the following code in the html: resumoMensal.html   Extensions

[web2py] Re: Ajax and table with queried values

2015-06-25 Thread Carla Raquel
the values I want individually in each of the td of the table. Also will I need to do an ajax request for each thing I want to calculate(like call duration,types of services,etc.) or I can do all in one? quarta-feira, 24 de Junho de 2015 às 11:39:39 UTC+1, Carla Raquel escreveu: > > &

[web2py] Re: Ajax and table with queried values

2015-06-25 Thread Carla Raquel
Since I have the values stored inside tables in a db, I am doing the queries I need and calculating values in the appropriate controllers and I am showing these values in the view like this: total_cost["_extra"]["SUM(Call.Cost)"] Otherwise, how can I do it in javascript on the client side? qui

[web2py] Request.vars based on dropdown

2015-06-26 Thread Carla Raquel
I have two dropdown lists like the ones below and I would like to compose my URL using the month and year as vars, after I click a certain link.How can I change my current request.vars to the selected values? Select month: {{for m in months:}} {{=m}} {{pass}}

[web2py] JSON and url vars

2015-07-07 Thread Carla Raquel
I'm passing a few variables from the controller(including one of them a list) to the view and I have a link that is built using those variables.Below is the controller function: def indexResumo(): meses = {'Janeiro':1,'Fevereiro':2,'Março':3,'Abril':4,'Maio':5,'Junho':6,'Julho':7,'Agosto':8

[web2py] Re: How to insert data in data base by xml file

2015-07-07 Thread Carla Raquel
This is how I dealt with my xml files: doc = xml.dom.minidom.parse("...my_xml.xml")// Here you parse the xml file for node in doc.getElementsByTagName("recipe")://Here you read in a cycle the tags which contain numerous attributes each t=node.getAttribute("name")//Each attribute is st

[web2py] Re: JSON and url vars

2015-07-08 Thread Carla Raquel
So, you're saying I should avoid sending vars on the URL and instead use json? -- 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

[web2py] Re: JSON and url vars

2015-07-08 Thread Carla Raquel
Thanks for your reply Massimo!I have a question though, why do you say JSON by itself won't help?Wouldn't it solve the problem 1)? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issue

[web2py] Re: JSON and url vars

2015-07-09 Thread Carla Raquel
I don't mind at all Leonel! It is always good to learn from more seasoned coders and put the newfound knowledge into practice. Anyway, I have a dictionary because when the page loads I want the previous month to be displayed. Since this code month = T(request.now.strftime("%B")) gives me the cu

[web2py] Re: JSON and url vars

2015-07-10 Thread Carla Raquel
This piece of code throws me some unicode problems on "Março". I've searched for a solution but didn't find one. {{for m in [datetime.date(2000, m, 1).strftime('%B') for m in range(1, 13 )]:}} {{=m}} {{pass}} -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:

[web2py] Pylint with web2py in sublime error

2015-08-31 Thread Carla Raquel
I'm using Pylint in sublime but it gives me some errors on web2py specific variables(request,response,etc.). I've read somewhere that to solve this you had to do something like: if 0: from gluon import * The problem is, I'm getting the error 'Unable to import gluon'. Do you know of any fi

[web2py] Self-referencing tables and queries

2015-09-16 Thread Carla Raquel
Hello, I'm currently tring to solve a problem regarding a table da references itself. The default auth_user table has an extra field called 'Supervisor' that references that same table, since Supervisor is an user(a specialization of it,to be more specific).I have the following parameters adde

[web2py] Re: Self-referencing tables and queries

2015-09-16 Thread Carla Raquel
I guess my code is more messed up than I thought. I'll try and clarify your points: *What am I trying to achieve?* In the db there are people (given by the auth_user table). From those people there are ones who are hierarchically above them and supervise them.They are called Supervisors. All

[web2py] Re: Self-referencing tables and queries

2015-09-16 Thread Carla Raquel
*They should be strings (otherwise how do you store the '+' character)*. I think in this case they won't be strings since I read the numbers from a XML and they don't have the '+' character. *Then you want to get the extensions of all the supervisors? * Not all the supervisors.I want to get the

[web2py] Re: Self-referencing tables and queries

2015-09-17 Thread Carla Raquel
*So what? You should future proof the app. Some day there might be extensions in India or something.* Actually, the extensions are internal to the company, either phone numbers or mobile numbers, so your scenario won't ever apply. *Do you mean the extensions of the persons he supervises?* That

[web2py] Inserting in db and summing with default values

2015-10-21 Thread Carla Raquel
I'm trying to add(or update in case it isn't alreadythere) some records to a db in a loop and I want to fill the entries with the sum of the default db values with some other values, but somehow, when trying to insert,it's not working. It's something like this: db.cTable.update_or_insert((db.c

[web2py] Submenu of submenu not working?

2015-10-21 Thread Carla Raquel
I want to implement a submenu of a submenu within Web2py, but as it is, no submenu of submenu 'Communications' is showing. Below is my code: response.menu = [] submenu=[] submenu2=[] response.menu += [[(SPAN(_class='glyphicon glyphicon-wrench',_style='padding:0px 5px;color:black;'),(T('Manag

[web2py] Re: Inserting in db and summing with default values

2015-10-21 Thread Carla Raquel
Well, it seems I had to add db.cTable.cost.*default *to make it work and retrieve the default value, as db.cTable.cost is a field object. The case is now closed,then. quarta-feira, 21 de Outubro de 2015 às 10:36:05 UTC+1, Carla Raquel escreveu: > > I'm trying to add(or update in ca