Two questions:
I have the following scheme:
db.define_table('table',
Field('title'),
Field('author_id', default=auth.user_id,readable=False,
writable=False),
...
)
db.define_table('videos',
Field('author_id',default=auth.user_id,readable=False,
writable=False),
Field('table',db.table)
)
and i want the videos.table field to take values only from the entries
that the same user has entered or Null
db.videos.table.requires =
IS_IN_DB(db(db.table.author_id==auth.user.id), db.table.id, '%
(title)s')
I get an error
NoneType' object has no attribute 'id' , because the user initially is
not logged in so there is no auth.user.id
How can i solve this?
Second question, if the user had entered a lot of entries which is the
best way to display the dropdown list of "tables"???
Thodoris