primary keys are primary keys. their only purpose is to be as small as
possible while uniquely identifiyng a row, with the added bonus of being
ordered.
if you need strict sequential ordering, use another field.
On Wednesday, January 27, 2016 at 12:49:09 PM UTC+1, Pierre wrote:
>
> Hi everyone
>
You can explicitly specify the id field of a table:
Field('id', type='id', ...)
And you can even give it a different name:
Field('myid', type='id', ...)
See http://web2py.com/books/default/chapter/29/6?search=named+id+field.
But why do you want to set ondelete for an id field -- it's supposed
Well, the problem is most likely in my (not) understanding the concept
of cascade deletion. In my case, I try to create an interface
application for network load tests. Each time I run a test with certain
params I want them to be stored so the user can see them and repeat test
whenever he wants
>
> Thanks for your quick response, Anthony. If I got it correctly, it would
> be working as expected if I changed the test_id type from integer to id. I
> gave it a try, but it only raised some errors (missing required field)
>
Changing "test_id" to type "id" should work, but you might need to
Thanks for your quick response, Anthony. If I got it correctly, it would
be working as expected if I changed the test_id type from integer to id.
I gave it a try, but it only raised some errors (missing required field)
and more importantly, it did not allow me to insert this field manually.
Is
Note, when you create a table with define_table, it automatically creates a
field called "id" of type "id", which serves as the record ID. In your
test_counts table, the test_id field is therefore referencing the "id"
field of the tests table, not the test_id field, which is just a regular
inte
6 matches
Mail list logo