> Shouldn't it be IS_IN_DB(db, 'journal.id', ...) -- note 'journal.id'
> rather than 'journal_id'? Also, your list:reference has to refer to a
> referenced table.
>
>
Well spotted! Thanks. That was my mistake.
Regards
Johann
--
May grace and peace be yours in abundance through the full know
On Friday, September 2, 2011 10:47:42 AM UTC-4, spyker wrote:
>
> On 26 August 2011 17:07, Martín Mulone wrote:
>
>> To debug the problem, start passing one by one the fields:
>>
>>
> The following models work:
>
> db.define_table('journal',
> Field('title'),
> Fiel
Sorry,
> requires = IS_IN_DB('journal_id', 'title)%s',
> zero = None)
>
must be
requires = IS_IN_DB(db,'journal_id', '%(title)s',
zero = None)),
With the same result.
Johann
--
May grace and peace be yours in abundance through
On 26 August 2011 17:07, Martín Mulone wrote:
> To debug the problem, start passing one by one the fields:
>
>
The following models work:
db.define_table('journal',
Field('title'),
Field('issn'),
Field('subject'),
Field('heading'),
To debug the problem, start passing one by one the fields:
fields = [db.dog.id,
db.dog.owner
]
SQLFORM.grid(
...
fields=fields,
...
)
2011/8/26 Bruno Rocha
> Do you have some field.of type list:... ?
>
> I am having trouble with it in grid.
>
> http://zerp.ly/rochacbruno
Do you have some field.of type list:... ?
I am having trouble with it in grid.
http://zerp.ly/rochacbruno
Em 26/08/2011 10:54, "Johann Spies" escreveu:
> Hallo Martín,
>
> Thanks for your reply.
>
> Unfortunately the problem persists:
>
> I have in Massimo's demo code for the SQLFORM.smartgrid/g
Hallo Martín,
Thanks for your reply.
Unfortunately the problem persists:
I have in Massimo's demo code for the SQLFORM.smartgrid/grid:
def index():
db.define_table('person',Field('name'),format='%(name)s')
db.define_table('dog',Field('name'),Field('owner',db.person),format='%(name)s')
Another thing when you are using SQLFORM.grid and .smartgrid this notation
is required:
db.dog.owner.represent = lambda value, row: db.person(value).name
*because this notation raise an error:*
db.dog.owner.represent = lambda value: db.person(value).name
(take this in consideration or you are
db.dog.owner.represent = lambda value, row: db.person(value).name
Value is the value of the current field, in this example dog owner is
an id of the person for example "1", so to display person name I have
to pass this value to search a person with this id:
db.person(value).name.
Row is the all r
Thanks.
It will be very helpful if somebody can update these lines in the book
because it still not clear to me how to use the new syntax in each of these
instances. I still do not know how 'record' is defined here.
db.mytable.name.represent = lambda name: name.capitalize()
db.mytable.other_id
You just change this:
def rp(author):
an =
db(db.akb_reprint.uuid==author).select(db.akb_reprint.rp_author)
if len(an):
a_name = an.first()['rp_author']
else:
a_name = 'No rp_author'
return a_name
into this:
def rp(author,record):
an =
db(db.akb_reprint.uuid==
11 matches
Mail list logo