Question: I have a relational model set that has 5 tables each with a one to many relationship. I'm having trouble accessing model information after the 2nd table. ex.

```
class TableA(models.Model):
  pass

class TableB(models.Model):
  tablea = models.ForeignKey(TableA, oncascade...)

class TableC(models.Model):
  tableb = models.ForeignKey(TableB, oncas...)

class TableD(models.Model):
  tablec = models.ForeignKey(TableC, ...)

class TableE(models.Model):
  tabled = models.ForeignKey(TableE, ...)

```

In my views.py i'm using the prefetch related method on TableA:

```
from . models import *
data = TableA.objects.all().prefetch_related('tableb_set__tablec_set__tabled_set')

```

I can't seem to access information from TableC, TableD or TableE.

```
for a in data:
  print(a.id)
  for b in a.tableb_set.values():
    print(b['id])
    for c in b.tablec_set.values(): #This is where I get an error message stating the model doesn't have a relatedmanager

```

How can I access model information 2+ tables deep into the prefetch\_related relationship?

Thanks in advance

Answer: 
What you got is a JSON string. You need to parse the JSON. There is a library for that.

```
import json
text = '{"word":"hello","synonyms":["hi","how-do-you-do","howdy","hullo"]}'
data = json.loads(text)
print(" ".join(data["synonyms"]))

```
The object you got is called a [JSON](https://en.wikipedia.org/wiki/JavaScript_Object_Notation) or a `dict` and it's awesome.

if you assign it to a variable like this:

```
a = {"word":"hello","synonyms":["hi","how-do-you-do","howdy","hullo"]}

```

you can then reference them like this:

```
for item in a['synonyms']:
     print(item)

```

It would be really useful in order for SO to help you to provide what's called a full working example of what you're trying to achieve