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
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
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=
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
I am creating a table using SQLFROM.grid() and want to set the id
attribute in the created HTML ,
how can I do that?
--
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\":
\"
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!
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
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
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
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')),
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(
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
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),
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:
>
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
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 ..
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
--
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
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'),
*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
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
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
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
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
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
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
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
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
29 matches
Mail list logo