[web2py] id field is added by web2py to grid's orderby. Does anyone know why? And how to remove it?

2019-03-16 Thread João Matos
Hello, I was checking the SQL statements used by web2py and found that the id field of a table is always added to the orderby when using a grid (didn't test in other forms). Even if the grid definition doesn't include a orderby argument, web2py always adds the ORDER BY id. Does anyone know why

[web2py] id table in web2py contain uuid

2017-01-25 Thread 黄祥
let say i got the csv file from another web app, in that csv file contain a field id that contain uuid e.g. a.csv (got from another web app) Id,Name 58801d5a3f9591dc47fbcc39,a 58801e67fc61af1a706ac9e1,b is it possible to have id table in web2py that contain uuid? how to define table in dal to fa

[web2py] Id set to None on save record

2014-05-16 Thread António Ramos
Mayday, mayday, I have a "bug" in my app. Sudenly i detect records with no id set i go to admin to create one record in the "buggy" table and the id is not set. All other tables are fine just in case , my model db.define_table('trabalhador', Field('empresa',db.empresa,readable=True,writable=

[web2py] id field is editable through REST PUT request

2014-04-08 Thread Henry Nguyen
Our product is using the @request.restful() decorator to specify REST endpoints for our resources. During testing, I noticed that I can specify a PUT request var of "id=x" where x is some new id and the id of that row will change to x. This is even WITH "db.table.id.writable = False." The PUT

[web2py] id tag in SQLFORM.grid()

2012-11-08 Thread HP
I am creating a table using SQLFROM.grid() and want to set the id attribute in the created HTML , how can I do that? --

[web2py] 'id'

2012-11-07 Thread Mike Anson
Greetings... I have a bash script that uses cURL to send a json packet of data in order to save it in sqlite DB. #!/bin/bash message=$1 uid=$2 url="https://somehost"; curl -v -k -X POST -H "Content-Type: application/json" --data "{\"message\": \"This will prbbly be my lst post.\", \"uid\": \"

Re: [web2py] id and legacy id name in row object gone with 1.99.7 can we have it back

2012-09-01 Thread Richard Vézina
Gone! I get my app to work under 2.0.5 without much problem, just one thing broke, but I don't understand why for now, but it pretty not important. So, I confirm that : for row in db(db.table.id>0).select(): print row.id OR print row.legacy_id Works. I am pretty happy about that!

Re: [web2py] id and legacy id name in row object gone with 1.99.7 can we have it back

2012-08-28 Thread Richard Vézina
If you want I can make a diff over 1.99.4 and 1.99.5 and try to locate what breaks the old behavior... Also, I understand that it was something experimental, but I think it is pretty usefull for legacy database users. I will try trunk tomorrow to see if your fix works as expect. Thank you Massimo

Re: [web2py] id and legacy id name in row object gone with 1.99.7 can we have it back

2012-08-28 Thread Massimo Di Pierro
For now I have committed a fix in trunk. I am not sure it belong there? It is not obvious to me the previous behavior was better or not (the feature you are using was never documented). Pros? Cons? On Tuesday, 28 August 2012 11:56:13 UTC-5, Richard wrote: > > FYI what you suggest trigger this e

Re: [web2py] id and legacy id name in row object gone with 1.99.7 can we have it back

2012-08-28 Thread Richard Vézina
FYI what you suggest trigger this error message : Object exists and cannot be redefined: id Richard On Tue, Aug 28, 2012 at 12:46 PM, Richard Vézina < ml.richard.vez...@gmail.com> wrote: > Not sure I follow, in the pass we were allowed to define a legacy id for a > table like this : > > db.def

Re: [web2py] id and legacy id name in row object gone with 1.99.7 can we have it back

2012-08-28 Thread Richard Vézina
Not sure I follow, in the pass we were allowed to define a legacy id for a table like this : db.define_table('test_endotoxin', *Field('something_id','id'),* Field('result','decimal(10,2)', notnull=True, requires=[IS_NOT_EMPTY(error_message=T('field can\'t be empty')),

Re: [web2py] id and legacy id name in row object gone with 1.99.7 can we have it back

2012-08-28 Thread Massimo Di Pierro
How about table.id = Field.Virtual(lambda row: row.table.something_id) On Tuesday, 28 August 2012 10:30:37 UTC-5, Richard wrote: > > Hello Massimo, > > I notice when I try to migrate to 1.99.7 some times ago that I could not > anymore do something like this : > > rows = db(db.table.id>0).select(

[web2py] id and legacy id name in row object gone with 1.99.7 can we have it back

2012-08-28 Thread Richard
Hello Massimo, I notice when I try to migrate to 1.99.7 some times ago that I could not anymore do something like this : rows = db(db.table.id>0).select() for row in rows: print row.id I can did it before 1.99.5. Has Anthony wrote in this thread : https://groups.google.com/forum/#!msg/we

Re: [web2py] id field? when using SQLForm.grid

2012-08-20 Thread Omi Chiba
I didn't test it but I'm sure it will work if there is only one primary key. My table has five key fields so I cannot do the solution. I think this is still a problem and should be fixed so it will work without defining 'id' field. db.define_table('EDTPOH00', Field('POIMHF', length=1),

Re: [web2py] id field? when using SQLForm.grid

2012-08-17 Thread Simon Carr
I have tested with the solution I posted and it works fine. Does it work for you? Simon On 17 August 2012 21:41, Omi Chiba wrote: > Actually I have issue #547 for this. > http://code.google.com/p/web2py/issues/detail?id=547 > > > On Friday, August 17, 2012 3:22:53 PM UTC-5, Simon Carr wrote: >

Re: [web2py] id field? when using SQLForm.grid

2012-08-17 Thread Omi Chiba
Actually I have issue #547 for this. http://code.google.com/p/web2py/issues/detail?id=547 On Friday, August 17, 2012 3:22:53 PM UTC-5, Simon Carr wrote: > > Hi, > > I found the answer to this question, so if anyone else is looking for an > answer to this question, here is the solution. > > in y

Re: [web2py] id field? when using SQLForm.grid

2012-08-17 Thread Simon Carr
Hi, I found the answer to this question, so if anyone else is looking for an answer to this question, here is the solution. in your model you need to just add 'id' to the to your primary field here is an example. db.define_table( 'product', Field('id_product','id'), your other fields as usual ..

[web2py] id field? when using SQLForm.grid

2012-08-17 Thread Simon Carr
Do I need an ID field in my database when using the SQLForm.grid I am reading data from a legacy MySQL database which does not have an id field. Many thanks Simon --

[web2py] 'id' on 1.99.3 with SQLFORM.grid and links

2011-12-01 Thread David Watson
I am running web2py version 1.99.3 I have the following code in my default controller. The view shows the item. When i run links = [lambda row: A('Edit',_href=URL("default","sweeps",args=[row.id])), lambda row: A('Delete',_href=URL("default","promos",args=[row.id]))] grid2 = SQL

Re: [web2py] Id been Shown Instead of Name in dropdown list

2011-11-10 Thread Naleen Yadav
Thanks for your reply Bruno but still its not working , it is behaving as it was. Regards, Naleen Yadav GENPRO Technologies Pvt Ltd. On Fri, Nov 11, 2011 at 11:41 AM, Bruno Rocha wrote: > I guess you need > > db.define_table("tblDriver", > Field("DriverName",'string',label='Driver Name'),

Re: [web2py] Id been Shown Instead of Name in dropdown list

2011-11-10 Thread Bruno Rocha
*or you can try:* db.define_table("tblVehicle", Field("*VehicleName_id*",db.tblVehicleName,label='Vehicle Name'), Field("VehicleNo", default=None,label='VehicleNo'), format=*lambda row: "%s" % row.**VehicleName_id.VehicleName* ) db.tblVehicle.VehicleName.requires=IS_IN_DB(db,'tbl

Re: [web2py] Id been Shown Instead of Name in dropdown list

2011-11-10 Thread Bruno Rocha
I guess you need db.define_table("tblDriver", Field("DriverName",'string',label='Driver Name'), Field('id_tblVehicle', db.tblVehicle,label='Vehicle Name')) db.tblDriver.id_tblVehicle.requires=IS_IN_DB(db, 'tblVehicle.id', '%( VehicleName)s') -- Bruno Rocha [http://rochacbruno.com.br

[web2py] Id been Shown Instead of Name in dropdown list

2011-11-10 Thread Naleen Yadav
Hii all, for the past few days I was trying my hands on inheritance and i have done single Inheritance but in case of multiple inheritance i am facing a problem here is my code *Model:* *# Creating a master table for storing vehicle names.* db.define_table("tblVehicleName", Field("Vehi

[web2py] ID Encoding oddity

2011-11-02 Thread Philip Kilner
Hi, Where I have a "next" in CRUD create/update, rather than the "[id]" substring being replaced by the ID of the created/updated record, I'm seeing "%5Bid%5D". My first question is "why?", and that leads me to ask how I can refer to the ID if I use the URL helper here rather than a simple s

Re: [web2py] id not starting with 1?

2011-06-30 Thread Martin Weissenboeck
Thank you for your answer. I am using the built-in database, sqlite3. Where can I find the "sequence"? 2011/6/30 Richard Vézina > I think it will depend of your database backend and how you setup your > sequence generating... Web2py by default will create a basic sequence then > you should go in

Re: [web2py] id not starting with 1?

2011-06-30 Thread Richard Vézina
I think it will depend of your database backend and how you setup your sequence generating... Web2py by default will create a basic sequence then you should go in your database management software (ex.: pgAdmin for postgres) to setup the proper caracteristic of your sequence... Your may override t

[web2py] id not starting with 1?

2011-06-30 Thread Martin Weissenboeck
Hi, is it possible to create a new table with an id-field not starting with 1. I think it would be better to have numbers of equal length. And - if it's possible - does it reduce efficiency? Regards., Martin

[web2py] id pb

2011-02-15 Thread Richard Vézina
Hello Massimo, Is there something wrong with this syntax : Field('table_id','id') sequence_name='table_table_id_seq' You introduced it, a couples of month ago... It works just fine with Postgres... But now I am facing problem. If I want to make one form for many tables, it is not possible since

[web2py] id field representation (.represent) pb on unnormalized table crud.read

2010-07-29 Thread Jean-Guy
Hello, I define the way to show the id field in crud.read like this : db.atable.othertablefield_id.represent=\ lambda value: "%(num)s" %db.v_othertable_num[value] Placed in model. v_othertable_num is a database view of the related table because the number are formed of many fields so I c