Re: Comparing two lists

2017-01-26 Thread Richard Hall
Melvyn, thanks for looking at this. Despite my inept attempt at explanation you've understood what I am trying to do - I need to revisit my relationships and fully explore my options at the model level. Thanks again, Richard P.S. I'll try to use clearer analogies in the future - in my head the

Re: Comparing two lists

2017-01-26 Thread Melvyn Sopacua
Hello, I don't know if you've changed names to protect the innocent, but conceptually, these models are hard to translate to the real world. This is the opposite of what object oriented programming is trying to accomplish and probably why you're having a hard time figuring it out and explain

Re: Comparing two lists

2017-01-26 Thread ludovic coues
Building.objects.filter(addresses__street__pk=patientid) will return all buildings with an address in the same street as the patient. If I understand correctly, that is :) 2017-01-26 10:41 GMT+01:00 Richard Hall : > Thanks for replying, I need all the help I can get. What I'm trying to do is > the

Re: Comparing two lists

2017-01-26 Thread Richard Hall
Thanks for replying, I need all the help I can get. What I'm trying to do is the opposite of what I seem to be doing. Rather than looking for an address without a building I am trying to see, from my list of all buildings, which one has an address (filtered by patientid). I can easily list all

Re: Comparing two lists

2017-01-26 Thread Richard Hall
Thanks for replying to my question. What I am trying to do is for each building in the list see if there is a corresponding address record for that building. Thus I'm trying to test the opposite of what you've pointed out i.e. not that there will be an address without a building, but if that b

Re: Comparing two lists

2017-01-26 Thread ludovic coues
You are assuming you can have address without building. {% if x.building %} 2017-01-26 0:27 GMT+01:00 Richard Hall : > Hello, I've only just started with Django and need a bit of help steering > myself in the right direction. > > I want to create a page that has a list of possible forms that could

Comparing two lists

2017-01-25 Thread Richard Hall
Hello, I've only just started with Django and need a bit of help steering myself in the right direction. I want to create a page that has a list of possible forms that could be filled in for a patient in a medical study and differentiate between those forms which have already been completed and