>
> That's not how it works. When the table is defined, if you have
> Field('location', db.location, ...) with no explicit "represent=...", then
> it will automatically set the "represent" attribute for you based on the
> _format attribute of the db.location table. However, if you set an explic
>
> I've removed the two lines, but the behavior is still the same. So there
> must be an other error in my code?
>
Hmm, I would think it should work -- not sure what the problem is.
> My idea is that the format does specify the string for db.object.location
> and the db.object.location.repr
>
> db.object.location.represent = lambda location, row: \
>>A(location,_href=URL('location', 'update', args=(location.id),
>> user_signature=True))
>>
>
> In the above line, you have specified your own "represent" attribute for
> the "location" field, so it will not use the "format"
>
> db.object.location.represent = lambda location, row: \
>A(location,_href=URL('location', 'update', args=(location.id),
> user_signature=True))
>
In the above line, you have specified your own "represent" attribute for
the "location" field, so it will not use the "format" attribu
Hi
Yes you're right!
But I had to remove the
db.location.id.readable = False
line. Else it doesn't work.
Thank you for helping!
-Luca.
Am Mittwoch, 7. März 2012 12:18:41 UTC+1 schrieb Alan Etkin:
>
> row.id should contain the record id, shouldn't it?
>
> db.location.name.represent = lambda
row.id should contain the record id, shouldn't it?
db.location.name.represent = lambda name, row: \
A(name, _href=URL('update', args=row.id, user_signature=True)))
Hi
This is exactly the example from which I started. I've removed the
request.args(0) part, because I do not need the generic controller as I
already know which table I want to display.
I want to change the representation of db.location.name: Display
db.location.name, but use db.location.id for
Look at this example (at the book's crud - methods):
A('edit:',id,_href=URL(args=(request.args(0),id)))
I think you need to pass a sequence to args (, ) for
the required behavior. Not sure really, as I didn't use the example.
On Mar 7, 7:15 am, Gian Luca Decurtins wrote:
> Hi all
>
> I would li
8 matches
Mail list logo