Re: Getting foreign relationship data in views

2006-07-24 Thread andyhume
Thanks Martin - the example apge is helpful. All I'm trying to do though is have the data from instruments available as attributes of the client object. eg, client.instrument.name. Is that the correct syntax? Andy. --~--~-~--~~~---~--~~ You received this messag

Re: Getting foreign relationship data in views

2006-07-24 Thread Martin Robinsson
Hi Not sure I completely get your code. If client_search initially is a variable holding a string I assume you're aware that declaring a function with the same name will override the original variable... When you write ´´first_name__icontains=client_search´´, is client_search supposed to hold a st

Getting foreign relationship data in views

2006-07-23 Thread andyhume
Hi - new to the group here. And new to Django too. I'm having trouble understanding how to use the database API to get data back which includes any data from a table with a ManyToManyField relationship. eg, below. The function below searches in the first_name and last_name fields in the Client t