I love both, you and web2py.
Regards,
>
>> Ashraf
>>
>
--
Sorry, it took me a while to understand your question. But you actually
have a very good question. Here is how you do it:
db=DAL()
db.define_table('auth_user',
Field('name'))
db.define_table('message',
Field('to_user',db.auth_user),
Field('from_user
is the question too easy or too difficult ?
>
> Ashraf
>
--
>
> Thank you for your time.
>
But unfortunately, I don't understand.
maybe the question is not clear enough.
the query will be like
*( db.from_to.from_user == db.auth_user.id ) & ( db.from_to.to_user ==
db.auth_user.id )*
How to select the two names? both are * db.auth_user.name*
--
Let's say your table name is from_to.
Then you have something like
arbitrary_last_name = 'Smith' # make this assignment at run time
query = (
(db.auth_user.last_name==arbitrary_last_name) &
(db.auth_user.id==db.from_to.from_user) &
(db.from_to.to_user==db.auth_user.id)
)
db(query).select(db
5 matches
Mail list logo